Im writing a script that will automatically do all of the following at once
- create a spotlight,
- create the RSL shadow attributes needed like deep shadows
- put a variable in the shadowMap name so i can manage this in another place
- attach a rsl uberLight shader to it and a custom viewport visualizer
- move it to 0 10 0
- look through it
I am very close to doing this - however! I have to execute the code in two stages to get the RSL attributes to attach to the lightAttributes of the spotlight.
I want to do it in one command. Probably an if statement?
I'm using a proc
that was included with 3delight which make me able to select the fourth tab in the AE and then i can get the name of it with the maya proc $gAECurrentTab and then filter it with startString.
However, when I run this all at once it doesnt work and when I try to print the result of $currrentNode i just get $currentNode unless like I said I execute the the second part after the first :?: I am probably going to have a lot of lights so I need it to be dynamic and depend on this variable. I figure that if I have more than 9 lights i can run an alternate version of the script that does
$currentNode = startString($gAECurrentTab, [B]21[/B]);
instead of 20.
I've done a lot of research, been working on it for 2 days now. Ive tried return arguments, eval deferred, timerX, splitting it up into (global) procs etc but they arent working.
Any help is appreciated. Im sure this is a common question.:nod:
defaultSpotLight(1.5, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1, 0) ;
DL_shaderAssignmentPanelCreateNewAttribsNode delightLightAttribs object;
move -r -os -wd 0 10 0 ;
$currentNode = startString($gAECurrentTab, 20);
setAttr ($currentNode +".generateShadowMaps") 1;
setAttr ($currentNode +".shadowMapType") 6;
//lookThru `ls -sl`;