instancing to geometries

248 views
Skip to first unread message

László Gulyás

unread,
Mar 3, 2021, 8:52:08 AM3/3/21
to gaffer-dev
Hi!

First post here, we are evaluating using gaffer in our pipeline in the future so we are quite beginners, so expect more questions :)

Say that I have a geometry of a warehouse with lots of fluorescent tubes mounted on the ceiling and I want to instance a cylinder light to every geometry automatically. So that if the environment artist modifies the layout or adds/removes these geometries, the lighting would change accordingly. I tried instancing to one of the tubes, but so far I only managed to do it to every vertex of it, and only one of the tubes I targeted manually.

Thanks for all the help in advance!

Laszlo

Andrew Kaufman

unread,
Mar 3, 2021, 12:00:33 PM3/3/21
to gaffe...@googlegroups.com
Hi Laszlo

What file format are you using to load the environment into Gaffer? If it's USD then you should be able to add a Collection which identifies all the tubes, which will load as a Set in Gaffer. From there you can use a Parent node with a SetFilter to attach a light to each tube.

If you can't author the Collection then you can still try this approach with a PathFilter, but that will be more fragile to hierarchy changes in the layout.

Let us know if that works or if you have any other questions.

Cheers,
Andrew


--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/9562db0e-4834-45d6-a6bc-0221a00f3339n%40googlegroups.com.


--
IED Logo
Andrew Kaufman | Software Engineering Supervisor
Image Engine | 15 West 5th Ave, Vancouver, BC, V5Y 1H4
t: +1 604 874 5634
image-engine.com [a Cinesite Partner Company]

John Haddon

unread,
Mar 4, 2021, 4:20:09 AM3/4/21
to gaffe...@googlegroups.com
Hi Laszlo,
I've attached a very small practical example of the setup Andrew described, using a PathFilter that selects both eyes on the robot using wildcards. Note that I used an Appleseed light as I'm not sure what renderer you have there - you might want to replace it with an Arnold light.
Cheers...
John

parentLights.gfr

László Gulyás

unread,
Mar 4, 2021, 5:15:29 AM3/4/21
to gaffer-dev
Amazing, very helpful, thanks for both of you! I wouldn't have thought that parenting can deal with multiple locations. One additional question would be how can I deal with the parented lights being nested deep down in the environment hierarchy, is there a way to take them out from those locations and group them in a lights group for example?

Laszlo

John Haddon

unread,
Mar 4, 2021, 6:01:46 AM3/4/21
to gaffe...@googlegroups.com
Rather than parent them deep into the hierarchy and then move them to a group, it's probably better to make them where you want them in the first place. This is completely possible, but not quite as straightforward as we'd like. I've attached another example script with a couple of options. The simplest one builds a sparse hierarchy that matches the environment but contains only lights, and the more complex one flattens it so all the lights are grouped under one parent. Even more complex versions are possible, where you parent the lights somewhere relative to the geometry location, but I'll leave that as an exercise :)

We'd like to wrap this up into a single node because it is something that crops up fairly often. The main question is how it should be parameterised, because different folks want to parent things in different places at different times. If you have any thoughts, then please let us know!

Cheers...
John


parentLights.gfr

László Gulyás

unread,
Mar 4, 2021, 9:00:40 AM3/4/21
to gaffer-dev
Thanks a lot John, very helpful examples!

Laszlo

John Haddon

unread,
Apr 16, 2021, 6:45:04 AM4/16/21
to gaffer-dev
Quick update. I've just added support for "parenting" to alternative destinations in the scene : https://github.com/GafferHQ/gaffer/pull/4200. This isn't released yet but should make it into `0.59.7.0` which I expect to release next week...
Cheers...
John

William Eguienta

unread,
Apr 16, 2021, 6:49:39 AM4/16/21
to gaffe...@googlegroups.com
Hey john,
Great add, this will helps a lot 

Cheers

William Eguienta
Creative Director / VFX supervisor
06 88 700 364

De : gaffe...@googlegroups.com <gaffe...@googlegroups.com> de la part de John Haddon <jo...@gafferhq.org>
Envoyé : Friday, April 16, 2021 12:45:03 PM
À : gaffer-dev <gaffe...@googlegroups.com>
Objet : Re: [gaffer] instancing to geometries
 

László Gulyás

unread,
Apr 16, 2021, 6:52:09 AM4/16/21
to gaffer-dev
That is amazing John! Thanks a lot!

Cheers,
Laszlo

Reply all
Reply to author
Forward
0 new messages