Created
September 30, 2013 20:56
-
-
Save nbreslow/6770141 to your computer and use it in GitHub Desktop.
Here is a small script to automate the creation of a point light. It creates a point light with a connected Physical Light. Alternatively it connects a physical Light to the selected Lights.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Here is a small script to automate the creation of a point light. It creates a point light with a connected Physical Light. Alternatively it connects a physical Light to the selected Lights. | |
proc string create_Physical_Light(int $interior){ | |
string $sel_lights[] = `ls -sl -dag -leaf -lights`; | |
string $phyLight = `mrCreateCustomNode -asUtility "" physical_light`; | |
string $blackbody; | |
if ($interior) { | |
$blackbody = `mrCreateCustomNode -asUtility "" mib_blackbody`; | |
} else { | |
$blackbody = `mrCreateCustomNode -asUtility "" mib_cie_d`; | |
} | |
setAttr ($blackbody+".intensity") 1000; | |
connectAttr -force ($blackbody+".outValue") ($phyLight+".color"); | |
if (0 == size ($sel_lights) ){ | |
$sel_lights[0] = `pointLight`; | |
} | |
for ($light in $sel_lights){ | |
connectAttr -force ($phyLight+".message") ($light+".miLightShader"); | |
} | |
return $phyLight; | |
} | |
create_Physical_Light(false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment