// =========================================================================== // 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: May 29, 1997 // // Procedure Name: // AEmotionTrailShapeTemplate // // Description Name; // Creates the attribute editor controls for the motionTrailShape node // // Input Value: // nodeName // // Output Value: // None // proc AEmotionTrailColorNew(string $item, string $labelName) { // we use a custom control so that the map button can be hidden // string $attr = plugAttr($item); string $niceName = `attributeName -nice $item`; if ($labelName == "") attrColorSliderGrp -label $niceName -showButton 0 -at $item ($attr+"SliderGrp"); else attrColorSliderGrp -label $labelName -showButton 0 -at $item ($attr+"SliderGrp"); } proc AEmotionTrailColorReplace(string $item) { // associate the new attribute with the widget // string $attr = plugAttr($item); attrColorSliderGrp -e -at $item ($attr+"SliderGrp"); } // Custom Color Label handlers //**************************************************************************** //**************************************************************************** //**************************************************************************** // Default, for attributes keeping their Nice Name global proc AEmotionTrailColorNewDefaultName(string $item) { string $msg = (uiRes("m_AEmotionTrailShapeTemplate.kNewTrailColor")); AEmotionTrailColorNew($item, $msg); } global proc AEmotionTrailColorReplaceDefaultName(string $item) { AEmotionTrailColorReplace($item); } // Alternate Trail Color global proc AEmotionTrailColorNewAlternateTrailColor(string $item) { string $msg = (uiRes("m_AEmotionTrailShapeTemplate.kAlternateTrailColor")); AEmotionTrailColorNew($item, $msg); } global proc AEmotionTrailColorReplaceAlternateTrailColor(string $item) { AEmotionTrailColorReplace($item); } // Colors for 'All Markers' global proc AEmotionTrailColorNewAllMarkersColor(string $item) { string $msg = (uiRes("m_AEmotionTrailShapeTemplate.kColorAllMarkers")); AEmotionTrailColorNew($item, $msg); } global proc AEmotionTrailColorReplaceAllMarkersColor(string $item) { AEmotionTrailColorReplace($item); } // Frame Marker and Cross Color global proc AEmotionTrailColorNewNumberAndCrossColor(string $item) { string $msg = (uiRes("m_AEmotionTrailShapeTemplate.kFrameCrossColor")); AEmotionTrailColorNew($item, $msg); } global proc AEmotionTrailColorReplaceNumberAndCrossColor(string $item) { AEmotionTrailColorReplace($item); } //Color for Editing Markers global proc AEmotionTrailColorNewEditingMarkersColor(string $item) { string $msg = (uiRes("m_AEmotionTrailShapeTemplate.kColorEditingMarkers")); AEmotionTrailColorNew($item, $msg); } global proc AEmotionTrailColorReplaceEditingMarkersColor(string $item) { AEmotionTrailColorReplace($item); } //**************************************************************************** //**************************************************************************** //**************************************************************************** // End of Custom Color Label handlers global proc AEmotionTrailPinnedDrawNew( string $item ) { string $nodeName = plugNode($item); radioButtonGrp -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_Draw")) -numberOfRadioButtons 2 -label1 (uiRes("m_AEmotionTrailShapeTemplate.kEMT_Selected")) -label2 (uiRes("m_AEmotionTrailShapeTemplate.kEMT_Always")) -changeCommand ("EMT_Pinned_FromCustomControlsUI\"" + $nodeName + "\"") EMT_Pinned_RBG; int $pinnedValue = `getAttr ($nodeName+".pinned")` + 1; radioButtonGrp -edit -select $pinnedValue EMT_Pinned_RBG; } global proc AEmotionTrailPinnedDrawReplace( string $item ) { string $nodeName = plugNode($item); int $pinnedValue = `getAttr ($nodeName+".pinned")` + 1; radioButtonGrp -edit -select $pinnedValue -changeCommand ("EMT_Pinned_FromCustomControlsUI\"" + $nodeName + "\"") EMT_Pinned_RBG; } global proc EMT_Pinned_FromCustomControlsUI(string $nodeName) { int $display = `radioButtonGrp -query -select EMT_Pinned_RBG`; if ($display == 1) { setAttr ($nodeName + ".pinned", 0); }else{ // $display will be 2 setAttr ($nodeName + ".pinned", 1); } } global proc AEmotionTrailShapeTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEmotionTrailShapeTemplate.kMotionTrailShapeAttributes")) -collapse 0; // Change to radio button //editorTemplate -label "Always Draw" -addControl "pinned"; editorTemplate -suppress "pinned"; editorTemplate -callCustom "AEmotionTrailPinnedDrawNew" "AEmotionTrailPinnedDrawReplace" "pinned"; editorTemplate -interruptOptimize; editorTemplate -addControl "xrayDraw"; editorTemplate -addSeparator; editorTemplate -addControl "trailDrawMode"; // Timing Display Mode —> Trail Draw Mode // Show Current Frame —> Past / Future *default* // Show Frame Timing —> Alternating Frames // Normal —> Constant editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_fadeInoutFrames")) -addControl "fadeInoutFrames"; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_preFrame")) -addControl "preFrame"; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_postFrame")) -addControl "postFrame"; editorTemplate -addControl "trailThickness"; editorTemplate -callCustom "AEmotionTrailColorNewDefaultName" "AEmotionTrailColorReplaceDefaultName" "trailColor"; // Extra Trail Color -> Alternate Trail Color editorTemplate -callCustom "AEmotionTrailColorNewAlternateTrailColor" "AEmotionTrailColorReplaceAlternateTrailColor" "extraTrailColor"; editorTemplate -addSeparator; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showFrames")) -addControl "showFrames"; editorTemplate -interruptOptimize; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showExtraKeys")) -addControl "showExtraKeys"; editorTemplate -addControl "keyframeSize"; editorTemplate -callCustom "AEmotionTrailColorNewDefaultName" "AEmotionTrailColorReplaceDefaultName" "keyframeColor"; editorTemplate -callCustom "AEmotionTrailColorNewDefaultName" "AEmotionTrailColorReplaceDefaultName" "activeKeyframeColor"; // ExtraKeyframeColor Color -> Color for 'All Markers' editorTemplate -callCustom "AEmotionTrailColorNewAllMarkersColor" "AEmotionTrailColorReplaceAllMarkersColor" "extraKeyframeColor"; editorTemplate -addSeparator; editorTemplate -interruptOptimize; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showFrameMarkers")) -addControl "showFrameMarkers"; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_frameMarkerSize")) -addControl "frameMarkerSize"; editorTemplate -interruptOptimize; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showFrameMarkerFrames")) -addControl "showFrameMarkerFrames"; editorTemplate -interruptOptimize; // Frame Marker and Cross Color editorTemplate -callCustom "AEmotionTrailColorNewNumberAndCrossColor" "AEmotionTrailColorReplaceNumberAndCrossColor" "frameMarkerColor"; editorTemplate -addSeparator; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showInTangent")) -addControl "showInTangent"; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showOutTangent")) -addControl "showOutTangent"; editorTemplate -interruptOptimize; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showInBead")) -addControl "showInBead"; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_showOutBead")) -addControl "showOutBead"; editorTemplate -interruptOptimize; editorTemplate -label (uiRes("m_AEmotionTrailShapeTemplate.kEMT_modifyKeys")) -addControl "modifyKeys"; // Bead Color -> Color for Editing Markers editorTemplate -callCustom "AEmotionTrailColorNewEditingMarkersColor" "AEmotionTrailColorReplaceEditingMarkersColor" "beadColor"; editorTemplate -addSeparator; editorTemplate -suppress "frames"; editorTemplate -suppress "points"; editorTemplate -suppress "drawStyle"; editorTemplate -suppress "startTime"; editorTemplate -suppress "increment"; editorTemplate -suppress "transformToMove"; editorTemplate -suppress "keyframeTimes"; editorTemplate -suppress "inputGeometry"; editorTemplate -suppress "motionTrail"; editorTemplate -suppress "keyframeFlags"; editorTemplate -suppress "extraKeyframeTimes"; editorTemplate -endLayout; AEcontrolPointTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }