// =========================================================================== // 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. // =========================================================================== // // provided at the time of installation or download, or which otherwise accompanies global proc ilrUpdateAELightOptions(string $parent, string $node) { string $oldParent = `setParent -q`; setParent $parent; if (`attributeQuery -exists -node $node "ilrRadiusOfInfluence"`) { int $enable = `getAttr ($node + ".ilrCustomDecay")`; attrFieldSliderGrp -e -enable $enable ilrDistanceExp; attrFieldSliderGrp -e -enable $enable ilrFalloffExp; } if (`attributeQuery -exists -node $node "ilrDepthMapShadows"`) { int $dmEnable = `getAttr ($node + ".ilrDepthMapShadows")`; attrFieldSliderGrp -e -enable $dmEnable ilrDmapResolution; attrFieldSliderGrp -e -enable $dmEnable ilrDmapFilterSize; attrFieldSliderGrp -e -enable $dmEnable ilrDmapSamples; attrFieldSliderGrp -e -enable $dmEnable ilrDmapBias; attrControlGrp -e -enable $dmEnable ilrDmapUseMidDist; attrEnumOptionMenuGrp -e -enable $dmEnable ilrDmapUseFile; attrControlGrp -e -enable $dmEnable ilrDmapFile; } if (`attributeQuery -exists -node $node "ilrEmit"`) { int $enable = `getAttr ($node + ".ilrEmit")`; attrFieldSliderGrp -e -enable $enable ilrPhotonEnergy; attrFieldSliderGrp -e -enable $enable ilrCausticsPhotons; attrFieldSliderGrp -e -enable $enable ilrGlobalPhotons; } setParent $oldParent; } global proc ilrCreateAELightOptions(string $parent, string $node) { string $oldParent = `setParent -q`; setParent $parent; string $updcmd = "ilrUpdateAELightOptions(\\\"" + $parent + "\\\", \\\"" + $node + "\\\")"; int $intensitySettingsExist = 0, $decaySettingsExist = 0, $lightGISettingsExist = 0; int $shadowSettingsExist = 0, $iesSettingsExist = 0; if (`attributeQuery -exists -node $node "ilrEyeIntensity"`) { $intensitySettingsExist = 1; } if (`attributeQuery -exists -node $node "ilrRadiusOfInfluence"`) { $decaySettingsExist = 1; } if (`attributeQuery -exists -node $node "ilrDepthMapShadows"`) { $shadowSettingsExist = 1; } if (`attributeQuery -exists -node $node "ilrEmit"`) { $lightGISettingsExist = 1; } if (`attributeQuery -exists -node $node "ilrLightProfileFileName"`) { $iesSettingsExist = 1; } if ($intensitySettingsExist) { frameLayout -label "Intensity" -cll true -cl true; columnLayout -adjustableColumn true; attrFieldSliderGrp -label "Primary Intensity" -attribute ($node + ".ilrEyeIntensity"); attrFieldSliderGrp -label "Reflection Intensity" -attribute ($node + ".ilrReflIntensity"); attrFieldSliderGrp -label "Refraction Intensity" -attribute ($node + ".ilrRefrIntensity"); attrFieldSliderGrp -label "Indirect Intensity" -attribute ($node + ".ilrIndirectIntensity"); separator; attrControlGrp -label "Use Indirect Light" -attribute ($node + ".ilrIndirectLight"); setParent ..; setParent ..; } if ($decaySettingsExist) { frameLayout -label "Decay" -cll true -cl true; columnLayout -adjustableColumn true; attrFieldSliderGrp -label "Radius Of Influence" -attribute ($node + ".ilrRadiusOfInfluence"); attrControlGrp -label "Use Custom Decay" -attribute ($node + ".ilrCustomDecay") -changeCommand $updcmd; attrFieldSliderGrp -label "Distance Exponent" -attribute ($node + ".ilrDistanceExp") ilrDistanceExp; attrFieldSliderGrp -label "Falloff Exponent" -attribute ($node + ".ilrFalloffExp") ilrFalloffExp; setParent ..; setParent ..; } if ($shadowSettingsExist) { frameLayout -label "Shadow Settings" -cll true -cl true; columnLayout -adjustableColumn true; attrFieldSliderGrp -label "Min Shadow Rays" -attribute ($node + ".ilrRtraceMinShadowRays"); separator; attrControlGrp -label "Use Depth Map Shadows" -attribute ($node + ".ilrDepthMapShadows") -changeCommand $updcmd; attrFieldSliderGrp -label "Resolution" -attribute ($node + ".ilrDmapResolution") ilrDmapResolution; attrFieldSliderGrp -label "Filter Size" -attribute ($node + ".ilrDmapFilterSize") ilrDmapFilterSize; attrFieldSliderGrp -label "Samples" -attribute ($node + ".ilrDmapSamples") ilrDmapSamples; attrFieldSliderGrp -label "Bias" -attribute ($node + ".ilrDmapBias") ilrDmapBias; attrControlGrp -label "Use Mid Distance" -attribute ($node + ".ilrDmapUseMidDist") ilrDmapUseMidDist; attrEnumOptionMenuGrp -label "Use Depth Map File" -attribute ($node + ".ilrDmapUseFile") ilrDmapUseFile; attrControlGrp -label "Depth Map File" -attribute ($node + ".ilrDmapFile") ilrDmapFile; setParent ..; setParent ..; } if ($lightGISettingsExist) { frameLayout -label "Global Illumination" -cll true -cl true; columnLayout -adjustableColumn true; attrControlGrp -label "Emit Photons" -attribute ($node + ".ilrEmit") -changeCommand $updcmd; attrFieldSliderGrp -label "Photon Energy" -attribute ($node + ".ilrPhotonEnergy") ilrPhotonEnergy; separator; attrFieldSliderGrp -label "Caustics Photons" -attribute ($node + ".ilrCausticsPhotons") ilrCausticsPhotons; attrFieldSliderGrp -label "Global Photons" -attribute ($node + ".ilrGlobalPhotons") ilrGlobalPhotons; setParent ..; setParent ..; } if ($iesSettingsExist) { frameLayout -label "IES Settings" -cll true -cl true; columnLayout -adjustableColumn true; rowLayout -nc 3 ilrLightProfileFileName; text -l "File Name"; textField ilrLightProfileFileNameField; symbolButton -image "navButtonBrowse.xpm" -c ("ilrLightProfileFileBrowser " + $node); setParent ..; connectControl -fileName ilrLightProfileFileNameField ($node + ".ilrLightProfileFileName"); attrControlGrp -label "IES Counter Clockwise" -attribute ($node + ".ilrIESCounterClockwise"); setParent ..; setParent ..; } setParent $oldParent; ilrUpdateAELightOptions($parent, $node); } global proc ilrLightProfileFileBrowser(string $node) { string $workspace = `workspace -q -fn`; setWorkingDirectory $workspace "image" "sourceImages"; fileBrowser ("ilrLightProfileAssignFileNameCB " + $node, "Open", "ies", 0); } global proc ilrLightProfileAssignFileNameCB(string $node, string $filename, string $fileType) { setAttr ($node + ".ilrLightProfileFileName") -type "string" $filename; }