// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // defaultPointLight // // Description: // Create a default point light // // Input Arguments: // None. // // Return Value: // None. // global proc defaultPointLight( float $intensity, float $colourR, float $colourG, float $colourB, int $decay, int $useShadows, float $shadowColourR, float $shadowColourG, float $shadowColourB, int $shadowSamples ) { string $cmd = "shadingNode -asLight pointLight"; string $lightName = `eval $cmd`; // setOptionVars(false); $cmd = ("setAttr " + $lightName + ".intensity " + $intensity); eval $cmd; $cmd = ("setAttr " + $lightName + ".colorR " + $colourR); eval $cmd; $cmd = ("setAttr " + $lightName + ".colorG " + $colourG); eval $cmd; $cmd = ("setAttr " + $lightName + ".colorB " + $colourB); eval $cmd; // cant do exclusive, not in pointLight command!!!!! $cmd = ("setAttr " + $lightName + ".decayRate " + $decay); eval $cmd; $cmd = ("setAttr " + $lightName + ".useDepthMapShadows " + $useShadows); eval $cmd; $cmd = ("setAttr " + $lightName + ".shadColorR " + $shadowColourR); eval $cmd; $cmd = ("setAttr " + $lightName + ".shadColorG " + $shadowColourG); eval $cmd; $cmd = ("setAttr " + $lightName + ".shadColorB " + $shadowColourB); eval $cmd; select -r $lightName; objectMoveCommand; }