Keithtron
06-13-2008, 07:50 PM
Hey everyone,
I'm working on a script that optimizes scenes for rendering, and I'm running into a weird problem dealing with layer material overrides. I need to assign the overrides to the actual objects themselves, so that the objects' shaders will be properly deleted when cleaning up unused nodes.
If a layer material override is created by right clicking on the render layer and manually setting the override, everything is fine and I can successfully assign that shading engine to the objects in the layer in my script. However, if I use a preset, such as ambient occlusion, everything is connected differently in that the actual objects are connected to the resulting shading engine. When I try to assign this shading engine to the actual objects, while running the script in batch mode, I get an error and the script bails. However, if I do the samething in Maya's script editor, it seems ok and doesn't error out on me.
I'm sorry if my description is confusing at all, but do any of you know what might be happening and/or how to deal with this? Thanks
I'm working on a script that optimizes scenes for rendering, and I'm running into a weird problem dealing with layer material overrides. I need to assign the overrides to the actual objects themselves, so that the objects' shaders will be properly deleted when cleaning up unused nodes.
If a layer material override is created by right clicking on the render layer and manually setting the override, everything is fine and I can successfully assign that shading engine to the objects in the layer in my script. However, if I use a preset, such as ambient occlusion, everything is connected differently in that the actual objects are connected to the resulting shading engine. When I try to assign this shading engine to the actual objects, while running the script in batch mode, I get an error and the script bails. However, if I do the samething in Maya's script editor, it seems ok and doesn't error out on me.
I'm sorry if my description is confusing at all, but do any of you know what might be happening and/or how to deal with this? Thanks
