// =========================================================================== // 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. // =========================================================================== // // Creation Date: April 11, 2008 // // Procedure Name: // AEdirectorTemplate // // Description Name; // Creates the attribute editor controls for the shot node. // // Input Value: // nodeName // // Output Value: // None // source "sequencerUtils.mel"; global proc AEHResolutionReplace( string $attribute) { int $res = `getAttr ($attribute)`; string $cmd = "optionVar -intValue createShotHResolution #1; setAttr " + ($attribute) + " #1"; intFieldGrp -edit -value1 $res -cc $cmd shotHResolution; } global proc AEWResolutionReplace( string $attribute) { int $res = `getAttr ($attribute)`; string $cmd = "optionVar -intValue createShotWResolution #1; setAttr " + ($attribute) + " #1"; intFieldGrp -edit -value1 $res -cc $cmd shotWResolution; } global proc AEHResolutionNew ( string $attribute) { int $res = `getAttr ($attribute)`; string $cmd = "optionVar -intValue createShotHResolution #1; setAttr " + ($attribute) + " #1"; intFieldGrp -label (uiRes("m_AEshotTemplate.kHResolution")) -value1 $res -cc $cmd shotHResolution; } global proc AEWResolutionNew ( string $attribute) { int $res = `getAttr ($attribute)`; string $cmd = "optionVar -intValue createShotWResolution #1; setAttr " + ($attribute) + " #1"; intFieldGrp -label (uiRes("m_AEshotTemplate.kWResolution")) -value1 $res -cc $cmd shotWResolution; } global proc AEshotTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEshotTemplate.kShotAttrs")) -collapse 0; // Camera pull-down editorTemplate -callCustom "AEcameraSetup" "AEcameraReplace" "currentCamera"; editorTemplate -addControl "startFrame"; editorTemplate -addControl "endFrame"; editorTemplate -addControl "sequenceStartFrame"; editorTemplate -addControl "sequenceEndFrame"; editorTemplate -dimControl $nodeName "sequenceEndFrame" 1; editorTemplate -addControl "scale"; editorTemplate -addControl "preHold"; editorTemplate -addControl "postHold"; editorTemplate -addControl "shotName"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEshotTemplate.kImagePlaneAttributes")) -collapse true; editorTemplate -callCustom "AEWResolutionNew" "AEWResolutionReplace" "wResolution"; editorTemplate -callCustom "AEHResolutionNew" "AEHResolutionReplace" "hResolution"; editorTemplate -endLayout; editorTemplate -beginLayout (uiRes("m_AEshotTemplate.kTransitionAttributes")) -collapse true; editorTemplate -addControl "transitionInType"; editorTemplate -addControl "transitionOutType"; editorTemplate -addControl "transitionInLength"; editorTemplate -addControl "transitionOutLength"; editorTemplate -endLayout; // suppressed attributes editorTemplate -suppress "members"; editorTemplate -suppress "currentCamera"; editorTemplate -suppress "track"; editorTemplate -suppress "animLayers"; editorTemplate -suppress "customEdits"; editorTemplate -suppress "trackState"; editorTemplate -suppress "clipDuration"; editorTemplate -suppress "audio"; editorTemplate -suppress "clip"; editorTemplate -suppress "clipScale"; editorTemplate -suppress "clipTrim"; editorTemplate -suppress "clipZeroOffset"; editorTemplate -suppress "clipValid"; editorTemplate -suppress "clipPreHold"; editorTemplate -suppress "clipPostHold"; editorTemplate -suppress "favorite"; editorTemplate -suppress "customAnim"; editorTemplate -suppress "flags"; editorTemplate -suppress "hasIncomingStt"; editorTemplate -suppress "hasOutgoingStt"; // include/call base class/node attributes AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; } // // Procedure Name: // AEcameraSetup - update the camera menu // global proc AEcameraSetup(string $attribute) { string $buffer[]; tokenize($attribute, ".", $buffer); string $shot = $buffer[0]; string $currentCamera = getShotCurrentCamera( $shot ); string $allCameras[] = getCameraChoicesForShots(); int $i; setUITemplate -pst attributeEditorTemplate; rowLayout -nc 2 linkCameraLayout; text -label (uiRes("m_AEshotTemplate.kLinkToCamera")); optionMenu -label "" -cc ("linkCameraToShot " + $attribute ) AEshotCameraMenu; menuItem -label (uiRes("m_AEshotTemplate.kNone")) "shotCameraAEnone"; for ($i = 0; $i < size($allCameras); $i++) { menuItem -label $allCameras[$i] ("AEshotCameraItem" + $i); // see if this should be the selected menu item if ($currentCamera == $allCameras[$i]) { optionMenu -e -sl ($i+2) AEshotCameraMenu; } } setParent ..; AEcameraReplace($attribute); } // // Procedure Name: // AEcameraReplace - replace method for camera menu. // global proc AEcameraReplace(string $attribute) { string $buffer[]; tokenize($attribute, ".", $buffer); string $shot = $buffer[0]; string $currentCamera = getShotCurrentCamera( $shot ); string $allCameras[] = getCameraChoicesForShots(); int $i, $j; setUITemplate -pst attributeEditorTemplate; setParent -m AEshotCameraMenu; optionMenu -e -sl 1 AEshotCameraMenu; $j = 0; for ($i = 0; $i < size($allCameras); $i++) { // create new menu item if not already there if (`menuItem -exists ("AEshotCameraItem" + $j)`) menuItem -e -label $allCameras[$i] ("AEshotCameraItem" + $j); else menuItem -label $allCameras[$i] ("AEshotCameraItem" + $j); $j++; // see if this should be the selected menu item if ($currentCamera == $allCameras[$i]) { optionMenu -e -sl ($j+1) AEshotCameraMenu; } } // delete ones which are gone while (`menuItem -exists ("AEshotCameraItem" + $j)`) { deleteUI ("AEshotCameraItem" + $j); $j++; } setParent -m ..; setUITemplate -ppt; optionMenu -e -cc ("linkCameraToShot " + $attribute) AEshotCameraMenu; } global proc linkCameraToShot (string $attribute) { string $buffer[]; tokenize($attribute, ".", $buffer); string $shot = $buffer[0]; string $newCamera = ""; // The first entry is reserved for "None". if (`optionMenu -q -sl AEshotCameraMenu` != 1) { $newCamera = `optionMenu -q -v AEshotCameraMenu`; } switchShotCamera ($shot, $newCamera); }