It's always been my goal to automate as much of the lighting setup as possible, so that the lighting artists can spend their time working on the custom attributes of each shot rather than repeating things that are the same in almost every shot. As yet it's been a daunting task and I'm not that familiar with scripting for situations that could contain different assets in each shot. But I discussed it further with Wes at our Austin 3D User group and he'd like to have a go at it.

I'm sure Iskander can also offer his support, as someone with more familiarity with the project. He's written numerous scripts for us already which we keep in sync across the team here:
C:\Devils_Angels_Dating\My Dropbox\assets\scripts

I've written a lighting setup guide which can be used as a template to start figuring out what can be scripted and that's here:

Other useful relevant tips can be found here:

I've created a file to get us started so that we know where to find the latest version (this is automatically synced to the entire team and appears in a their Maya menu).
C:\Devils_Angels_Dating\My Dropbox\assets\scripts\lightingSetup.mel

Here's a good scene to look at for reference:
C:\Devils_Angels_Dating\My Dropbox\030_Lighting\sh0040_DTH_huff\

Please post progress, questions and tips in this thread so that we can keep track of it.

Views: 1128

Reply to This

Replies to This Discussion

Thanks Wes. I think I see what happened. They have always been "Death_Chair_RNDR" in the lighting phase, but the namespace was usually still "Death_Chair" because that's the version the animators used. I must have done the switch at a different point in the process.
S'OK, I fixed it. Just never came up before.

The chairs have some duplication of names for the geometry items, not all, some. And it is easier and faster to doe the various render assignments and light links on the whole chair, except for the belts, which have to be singled out.

The script will now work properly with any thing that starts with "Death_Chair" (or Cupid or Devil) so if you ever need a special _RNDR2 or something for a special problem, it is good to go.

<* Wes *>
Next time we'll know to make all geometry names unique. Thanks.
Something weird is happening. Once the geo cache is done on Cupid's hair and the lighting script is run the hair is not assigned to the render layer or any lights. Does this mean that it's not the same geo name?

This is the file you can use to test it:
C:\Devils_Angels_Dating\My Dropbox\030_Lighting\sh1335_CPD_beamcollideB\
OK, I have spent enough time on this to be totally confused.

If I take the master scene, reference in the Anim Scene and run the script, the Hair is fine. If I load the scene you referenced and then run the script, there is not any error message, but at the end of the process the hair is missing from the rest of the beard in the CupidHair layer (as you noted).

I used the Relationship Editor and in the ...ICM file it showed that the hair was not a member of the CupidHair layer. Clicking on the hair item added it, and after assigning the Cupid Halo shader to it (from the rendering menu) it looked fine in a test render. So it has dropped from teh layer and lost the shader assignment. But it is linked to the three lights.

So I don't know what happens. All four hair items are being assigned one after the other in the same part of the script. Three work and Maya apparently drops one. But I cannot see a name change or error message or other visible issue causing it.

<* Wes *>
I was hoping your investigation might reveal something. I guess Iskander is probably more familiar with the problem. He's currently trying to re-work the geo caching methods to deal with this. It seems geo caching messes up lots of things whether it's done before or after the lighting script. At best I'm finding myself manually fixing all the problems... it's not very consistent what goes wrong each time, partly because all the scenes we're working on have used different versions of the scripts to get them to their current stage. Hopefully this will settle down as we go along and become more robust.
OK, I think I have isolated what is causing this, although I have no full explanation for why it happens on this file versus the unmodified one.

In the outliner, when you enable the Display -> Shapes checkbox, you can see the shape nodes underneath each geometry. Usually, by default, these are named the same as the transform node, plus "Shape" is appended to them. So for Beard, you have a BeardShape node.

But for Hair, the shape node is named Hair. So when you do an ls -r true "*:Cupid*:Hair" you get two nodes.

The fact that the shape nodes in the ICM file have "Deformed" appended to them may also be a factor. So BeardShape is named BeardShapeDeformed, and Hair is named HairDeformed. But I am not sure how that plays into this, because the Beard works fine, but the Hair does not.

However, the Hair name conflict issue is old, I wrote a while routine just for that item to try to get around the conflict. I will try to resolve this somehow, but given your special effort to hurry progress along, maybe you can just manually fix it if you need to get this one rendering sooner rather than later.

Also, it is not just the CupidHair layer that is missing the Hair piece. CupidMain and CupidTail also should have the hair geometry in it, just with the masking shader (useBackground). It is missing from them, too, although that may not be surprising because I add the hair items in the same way in all three layers, the only difference is in what shader is applied to them.

<* Wes *>
Alright, I have a fix. I am still not sure why the old method I was using worked on older files and does not work on this new one, but I changed the MEL routine I was using to find the Hair (specifically) node names by removing the -geometry flag from an ls command. I am sure the name conflict is at the root of this, but frankly, we should not change anything like that without a lot of testing, and I have successfully worked around the issue. The old saw "best to let a sleeping dog lie" is certainly wise advice here.

So that works on your new file, and still works on the straight "Anim" file. So I have uploaded a version 25 (hair is now back in all three layers) and will await your confirmation.

<* Wes *>
I have this particular scene on the render farm already, having made a lot of manual changes. But this is still good for future scenes I need to light. I think the "shape" name is the problem, it sounds very likely... not that I've ever understood what the shape node was before.
I don't know what they are separate entities myself, but every mesh you make has a transform and a shape paired up. The shape node cannot exist by itself, it requires a transform to anchor it in the world.

I have been thinking I understand the problem now. The old way I was doing it found the shape node named "Hair" because of the -geometry flag, and Maya applied the change specified for the shape node to both. In the newer file, the shape nodes are renamed to include "Deformed" (I guess as a side effect of the caching or something) and thus there was no hit looking for "Hair" (since it is now named HairDeformed).

Glad you got that file going, hopefully something like this will not recur in the rest of the scenes. I'm sorry I found no chance to say hello last night, too many people (a good problem, though). I saw you were there, though.

<* Wes *>
That's ok, I got there late and floated around the front of the room as it was too packed to get back there.
Hey Wes. Can you remove the motion blur override from the BubbleRndr layer?

Reply to Discussion


Links & Social Media

HD Teaser Trailer

This is the development website showcasing the work done on a zero-budget, volunteer team based short animated film directed by Michael Cawood.

Networks - Join us at:

Podcast - Subscribe or Play

eMail when there's film news

Customise subscription

Supporting our Short

Join in with the creation of a CG character animation short film.

© 2016   Created by Michael Cawood - Director.   Powered by

Badges  |  Report an Issue  |  Terms of Service