// =========================================================================== // 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. // =========================================================================== // // Description: // // Options window for interactive sequence rendering. // global string $gRenderSequenceOptionsWindow = ""; global string $gRenderSequenceOptionsLayout = ""; // Creates the options used by sequence rendering // global proc createRenderSequenceOptionVars() { if(!`optionVar -exists "renderSequenceAllLayers"`) optionVar -intValue "renderSequenceAllLayers" 0; if(!`optionVar -exists "renderSequenceAllCameras"`) optionVar -intValue "renderSequenceAllCameras" 0; if(!`optionVar -exists "renderSequenceAddToRenderView"`) optionVar -intValue "renderSequenceAddToRenderView" 0; if(!`optionVar -exists "renderSequenceAddAllLayers"`) optionVar -intValue "renderSequenceAddAllLayers" 0; if(!`optionVar -exists "renderSequenceAddAllCameras"`) optionVar -intValue "renderSequenceAddAllCameras" 0; if(!`optionVar -exists "renderSequenceRegion"`) optionVar -intValue "renderSequenceRegion" 0; } // Updates the render sequence options window // global proc updateRenderSequenceOptionsWindow() { global string $gRenderSequenceOptionsWindow; global string $gRenderSequenceOptionsLayout; if ($gRenderSequenceOptionsLayout == "") { return; } int $animation = `getAttr "defaultRenderGlobals.animation"`; int $startFrame = `getAttr "defaultRenderGlobals.startFrame"`; int $endFrame = `getAttr "defaultRenderGlobals.endFrame"`; string $title = (uiRes("m_renderSequenceOptionsWindow.kRenderSequenceWindowTitle")); if ($animation) { $title += " (Frame: "; $title += $startFrame; $title += "-"; $title += $endFrame; $title += ")"; } else { $title += " ("; $title += (uiRes("m_renderSequenceOptionsWindow.kCurrentFrame")); $title += ")"; } window -edit -title $title $gRenderSequenceOptionsWindow; string $oldParent = `setParent -q`; setParent $gRenderSequenceOptionsLayout; int $save = `optionVar -q "renderSequenceAddToRenderView"`; checkBoxGrp -edit -enable $save renderSequenceAddAllLayersCtrl; checkBoxGrp -edit -enable $save renderSequenceAddAllCamerasCtrl; setParent $oldParent; } // Update the Render View current camera to match the render sequence current // camera control. // global proc renderSequenceCurrentCameraChanged() { string $camera = `optionMenuGrp -q -value renderSequenceCameraList`; string $panels[] = `getPanel -scriptType "renderWindowPanel"`; renderWindowEditor -edit -currentCamera $camera $panels[0]; } // When the list of cameras changes, we need to update our current camera // control to match. // global proc updateCameraList() { string $menuLongNames[] = `optionMenuGrp -query -itemListLong renderSequenceCameraList`; string $value = ""; if(size($menuLongNames) > 0) { // If the camera list had values, then keep track of the current value // as we may need to reapply this value after recreating the list of // cameras. $value = `optionMenuGrp -query -value renderSequenceCameraList`; // Deletes the camera menu items deleteUI -menuItem $menuLongNames; } // Add the list of cameras to the option menu group. for( $camera in `listCameras` ) { menuItem -p "renderSequenceCameraList|OptionMenu" $camera; } // Did we store the old value? if($value != "") { // If so, check to see if this value exists in the new camera list. int $found = 0; string $menuShortNames[] = `optionMenuGrp -query -itemListShort renderSequenceCameraList`; for($i=0; $i