danieljensen01
06-11-2011, 01:44 AM
Hello,
I'm just learning MEL, learn by doing right? I'm trying to automate something I do for every shot in my current project. Here's the basic code,
setCurrentRenderer mentalRay;
shadingNode -asShader surfaceShader;
mrCreateCustomNode -asTexture "" mib_amb_occlusion;
connectAttr -force mib_amb_occlusion1.outValue surfaceShader1.outColor;
setAttr "mib_amb_occlusion1.samples" 32;
setAttr "mib_amb_occlusion1.spread" 2;
setAttr "mib_amb_occlusion1.max_distance" 8;
hookShaderOverride("defaultRenderLayer", "", "surfaceShader1");
hideShow -lights -hide;
My question is, I need a few names replaced with variables, since they can obviously change, like the shader name and render layer name, when I run this script, I want it to prompt me to select from a button list, the render layer to apply this override to.
Right now if I could just get advice on how to have it prompt for the layer to apply the override to I'd have a functioning script for my purposes. Which is this line
hookShaderOverride("defaultRenderLayer", "", "surfaceShader1");
Thanks for any help, it'd be much appreciated!
I'm just learning MEL, learn by doing right? I'm trying to automate something I do for every shot in my current project. Here's the basic code,
setCurrentRenderer mentalRay;
shadingNode -asShader surfaceShader;
mrCreateCustomNode -asTexture "" mib_amb_occlusion;
connectAttr -force mib_amb_occlusion1.outValue surfaceShader1.outColor;
setAttr "mib_amb_occlusion1.samples" 32;
setAttr "mib_amb_occlusion1.spread" 2;
setAttr "mib_amb_occlusion1.max_distance" 8;
hookShaderOverride("defaultRenderLayer", "", "surfaceShader1");
hideShow -lights -hide;
My question is, I need a few names replaced with variables, since they can obviously change, like the shader name and render layer name, when I run this script, I want it to prompt me to select from a button list, the render layer to apply this override to.
Right now if I could just get advice on how to have it prompt for the layer to apply the override to I'd have a functioning script for my purposes. Which is this line
hookShaderOverride("defaultRenderLayer", "", "surfaceShader1");
Thanks for any help, it'd be much appreciated!