// =========================================================================== // 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. // =========================================================================== source workingTimeUtil; // // Procedure Name: // updatePlaybackRange // // Description: // When the playback range is changed *during* playback, // we stop and re-start playback (in whatever direction // playback is currently operating) so that playback is // reset to include the newly changed range. // // Input Arguments: // None. // // Return Value: // None. // global proc updatePlaybackRange () { $sound = `play -query -sound`; if (`play -query -state` && `play -query -forward`) { play -state off; play -state on -sound $sound; } else if (`play -query -state` && ! `play -query -forward`) { play -state off; play -forward false -state on -sound $sound; }; } // // Procedure Name: // setMinPlayback // // Description: // Set the min playback value to whatever // has been set in the min field // // Input Arguments: // Name of the field. // // Return Value: // None. // global proc setMinPlayback(string $field) { playbackOptions -min `timeField -query -value $field`; updatePlaybackRange(); } // // Procedure Name: // setMinMaxPlayback // // Description: // Set the min/max playback values to whatever // has been set in the range slider. Then update // the min/max fields to show these values as well, // and resample the sound in the time slider to fit // the new scale of the time slider. // // Input Arguments: // Names of the minimum and maximum fields. // // Return Value: // None. // global proc setMinMaxPlayback(string $minField, string $maxField) { timeField -edit -value `playbackOptions -q -min` $minField; timeField -edit -value `playbackOptions -q -max` $maxField; updatePlaybackRange(); } // // Procedure Name: // setMaxPlayback // // Description: // Set the max playback value to whatever // has been set in the max field // // Input Arguments: // Name of the field. // // Return Value: // None. // global proc setMaxPlayback(string $maxField) { playbackOptions -max `timeField -q -v $maxField`; updatePlaybackRange(); } // // Function called when user change the value in the frame rate list // global proc onTimeUnitChanged(string $framerateListWidget) { int $which = `optionMenuGrp -q -sl $framerateListWidget`; string $currentUnitCmdValue = getCurrentUnitCmdValue($which); // Change the current time unit currentUnit -t $currentUnitCmdValue; // Save the new current time unit optionVar -sv workingUnitTime $currentUnitCmdValue; // Changing the current time unit has side // effects so we need to update some optionVars optionVar -fv playbackMin `playbackOptions -q -min` -fv playbackMax `playbackOptions -q -max`; // Update the cadence line frequency if it's using the working units global string $gPreferenceWindow; int $exist = `window -exists $gPreferenceWindow`; if ($exist) { $exist = `floatField -exists animEdCadenceLineFreq`; int $type = `optionVar -q animEdCadenceLineType`; if (1 == $type && $exist) // Working Units { float $fps = getCadenceLineWorkingUnitInFPS(); optionVar -fv animEdCadenceLineFreq $fps; prefAnimEdCadenceLineChanged(); } } } // // Update the frame rate list // global proc onTimeUnitChangedCallback(string $framerateListWidget) { int $index = getIndexFromCurrentUnitCmdValue( `currentUnit -q -t` ); optionMenuGrp -e -sl $index $framerateListWidget; } // // This function is called when the user change the value in the playback speed list // global proc onPlaybackSpeedChanged(string $framerateListWidget) { float $speed = 0.0; int $index = `optionMenuGrp -q -sl $framerateListWidget`; switch ($index) { // Play every frame case 1 : playbackOptions -playbackSpeed 0; break; // 0.5x case 2: playbackOptions -playbackSpeed 0.5; break; // 1x case 3: playbackOptions -playbackSpeed 1; break; // 2x case 4: playbackOptions -playbackSpeed 2; break; // Other case 5: playbackOptions -playbackSpeed 10; break; } } proc string getOpenOrCloseBarIcon(int $openBar) // // Returns string of Icon to display based on value of $openBar // { if ($openBar) { return "openBar.png"; } else { return "closeBar.png"; } } // // Show / Hide a layout // $optionVar : the name of the option var use to save the setting // $toggle : 1 means toggle the value in the option var. Others values means use the value in the option var // $button : the button that call this function // $layout : the layout to display / hide // global proc toggleLayoutDisplay(string $optionVarName, int $toggle, string $button, string $layout) { int $state = 1; if(`optionVar -exists $optionVarName`) { $state = `optionVar -q $optionVarName`; if($toggle == 1) $state = !$state; } formLayout -edit -manage $state $layout; string $icon = getOpenOrCloseBarIcon($state); iconTextButton -edit -i1 $icon $button; optionVar -intValue $optionVarName $state; } // // Set the playback looping button state based on the current value. // This function is called when the user click on the button. // global proc setPlaybackLoopingButtonState(string $button) { string $mode = `playbackOptions -q -loop`; if($mode == "continuous") { iconTextButton -e - i1 playbackLoopingOnce.png -annotation (uiRes("m_playbackRange.kPlaybackLoopingOnce")) -statusBarMessage (uiRes("m_playbackRange.kPlaybackLoopingOnceHelp")) $button; playbackOptions -loop "once"; } else if($mode == "once") { iconTextButton -e - i1 playbackLoopingOscillate.png -annotation (uiRes("m_playbackRange.kPlaybackLoopingOscillate")) -statusBarMessage (uiRes("m_playbackRange.kPlaybackLoopingOscillateHelp")) $button; playbackOptions -loop "oscillate"; } else { iconTextButton -e - i1 playbackLoopingContinuous.png -annotation (uiRes("m_playbackRange.kPlaybackLoopingContinuous")) -statusBarMessage (uiRes("m_playbackRange.kPlaybackLoopingContinuousHelp")) $button; playbackOptions -loop "continuous"; } } // // Update the playback looping button based on the playbackOptions cmd // This function is attached to the playbackModeChanged event // global proc updatePlaybackLoopingButtonState(string $button) { string $mode = `playbackOptions -q -loop`; if($mode == "continuous") { iconTextButton -e - i1 playbackLoopingContinuous.png -annotation (uiRes("m_playbackRange.kPlaybackLoopingContinuous2")) -statusBarMessage (uiRes("m_playbackRange.kPlaybackLoopingContinuousHelp2")) $button; } else if($mode == "once") { iconTextButton -e - i1 playbackLoopingOnce.png -annotation (uiRes("m_playbackRange.kPlaybackLoopingOnce2")) -statusBarMessage (uiRes("m_playbackRange.kPlaybackLoopingOnceHelp2")) $button; } else { iconTextButton -e - i1 playbackLoopingOscillate.png -annotation (uiRes("m_playbackRange.kPlaybackLoopingOscillate2")) -statusBarMessage (uiRes("m_playbackRange.kPlaybackLoopingOscillateHelp2")) $button; } } { global string $gPlaybackRangeForm; global string $gTimeRangeSlider; int $topSpacing, $bottomSpacing; // Create a layout appropriate for the Playback range. // string $playbackRange = `formLayout -parent $gPlaybackRangeForm`; // Create a frame layout for the Playback range control. // string $playbackFrame = `frameLayout -parent $playbackRange -borderVisible false -labelVisible false -collapse false -collapsable false`; // Create the Playback range control. // // Note that the height is set to 1, but because form attachments // are used on the control it will expand to be as tall as the // other items in the layout. $gTimeRangeSlider = `rangeControl -parent $playbackFrame -height 1`; // Following annotation is disabled for the time being because it // interferes with user interaction - see bug 104317 //-annotation "Range Slider: Set the playback range displayed in the Time Slider"`; setParent $playbackRange; // Create the minimum range field. // string $minRangeField = `timeField -annotation (uiRes("m_playbackRange.kStartTimeSetAnnot")) -width 90 -precision 2`; timeField -edit -value `playbackOptions -q -animationStartTime` -changeCommand ("playbackOptions -ast `timeField -q -v " + $minRangeField + "`") $minRangeField; // Create the minimum playback field. // string $minField = `timeField -annotation (uiRes("m_playbackRange.kPlaybackStartTimeAnnot")) -width 90 -precision 2`; timeField -edit -value `playbackOptions -query -minTime` -changeCommand ("setMinPlayback " + $minField) $minField; // Create the maximum playback field. // string $maxField = `timeField -annotation (uiRes("m_playbackRange.kPlaybackEndTimeAnnot")) -width 90 -precision 2`; timeField -edit -value `playbackOptions -query -maxTime` -changeCommand ("setMaxPlayback " + $maxField) $maxField; // Create the maximum range field. // string $maxRangeField = `timeField -annotation (uiRes("m_playbackRange.kEndTimeSetTheEndTimeAnnot")) -width 90 -precision 2`; timeField -edit -value `playbackOptions -query -animationEndTime` -changeCommand ("playbackOptions -aet `timeField -q -v " + $maxRangeField + "`") $maxRangeField; // For improving the alignment of the buttons. // if (`about -nt`) { $topSpacing = 1; $bottomSpacing = 1; } else { $topSpacing = 0; $bottomSpacing = 1; } string $section1Layout = `formLayout`; // Create the current character setting widget, that // allows user to set which character is currently being // keyed. // string $characterForm = ""; $characterForm = `formLayout`; symbolButton -annotation (uiRes("m_playbackRange.kSetCurrentCharacterSetAnnot")) -image "pickMenuIcon.png" characterSelectionIcon; textField -ed false -drawInactiveFrame true characterField; if (`about -uiLanguage` == "ja_JP") { textField -e -width 120 characterField; } else { textField -e -width 102 characterField; } nameField -visible false -width 1 -nameChangeCommand ("updateCurrentCharacterField \"" + $characterForm + "\" {}") characterNameField; setParent ..; // Layout the above form // formLayout -e -af characterSelectionIcon left 0 -an characterSelectionIcon right -af characterSelectionIcon bottom $bottomSpacing -af characterSelectionIcon top $topSpacing -af characterField top 0 -ac characterField left 0 characterSelectionIcon -af characterField bottom 0 -an characterField right -af characterNameField top 0 -ac characterNameField left 0 characterField -af characterNameField bottom 0 -af characterNameField right 0 $characterForm; // Attach a popup menu that controls the // contents of the textField, and sets the // selection masks // string $menu = `popupMenu -b 1 -p $characterForm`; menu -e -pmc ( "buildSetCharacterMenu " + $menu ) $menu; setParent -m ..; // Set up callbacks to update the current character field // string $cmd = ( "updateCurrentCharacterField \"" + $characterForm + "\" " ); selectionConnection -edit -addScript $cmd -removeScript $cmd highlightList; evalDeferred( $cmd + "{}" ); // Create the current animation layer setting widget, that // allows users to set which layer is currently active. // string $animLayerForm = `formLayout`; symbolButton -annotation (uiRes("m_playbackRange.kSetCurrentAnimLayerAnnot")) -image "pickMenuIcon.png" animLayerSelectionIcon; textField -ed false -drawInactiveFrame true animLayerField; if (`about -uiLanguage` == "ja_JP") { textField -e -width 143 animLayerField; } else { textField -e -width 102 animLayerField; } nameField -visible false -width 1 -nameChangeCommand ("updateActiveAnimLayerField \"" + $animLayerForm + "\" {}") animLayerNameField; setParent ..; // Layout the above form // formLayout -e -af animLayerSelectionIcon left 0 -an animLayerSelectionIcon right -af animLayerSelectionIcon bottom $bottomSpacing -af animLayerSelectionIcon top $topSpacing -af animLayerField top 0 -ac animLayerField left 0 animLayerSelectionIcon -af animLayerField bottom 0 -an animLayerField right -af animLayerNameField top 0 -ac animLayerNameField left 0 animLayerField -af animLayerNameField bottom 0 -af animLayerNameField right 0 $animLayerForm; // Attach a popup menu that controls the // contents of the textField, and sets the // selection masks // string $layerMenu = `popupMenu -b 1 -p $animLayerForm`; menu -e -pmc ( "buildSetAnimLayerMenu " + $layerMenu ) $layerMenu; setParent -m ..; // Set up callbacks to update the current layer field // $cmd = ( "updateActiveAnimLayerField \"" + $animLayerForm + "\" " ); selectionConnection -global true -parent MayaWindow -highlightList animLayerHighlightList; selectionConnection -edit -addScript $cmd -removeScript $cmd animLayerHighlightList; evalDeferred( $cmd + "{}" ); setParent ..; int $iconHeight = 22; // And icon width, Real size = 20x20, but with padding for down/hover = 22x22 int $thinIconWidth = 9; int $controlSpacing = 5; // Real spacing is 7px, but flowLayout has a column spacing of 1 int $iconSpacing = 1; // ===================================================================== // Create the framerate list and playback speed in it own formLayout // ===================================================================== string $section2Layout = `formLayout`; // // Create the frame rate list // string $unitTime = `optionVar -q workingUnitTime`; int $index = getIndexFromCurrentUnitCmdValue($unitTime); string $frameRateList = `optionMenuGrp`; for($i = 0; $i < getTimeUnitDisplayStringCount(); $i++) { string $displayString = getTimeUnitDisplayString($i); menuItem -label $displayString; } optionMenuGrp -edit -annotation (uiRes("m_playbackRange.kFrameRateListAnnot")) -changeCommand ("onTimeUnitChanged " + $frameRateList) -sl $index $frameRateList; scriptJob -permanent -parent $frameRateList -event timeUnitChanged ("onTimeUnitChangedCallback " + $frameRateList); // // Create the playback looping button // string $playbackLoopingButton = `iconTextButton -i1 "playbackLoopingOnce.png"`; iconTextButton -edit -c ("setPlaybackLoopingButtonState " + $playbackLoopingButton) $playbackLoopingButton; updatePlaybackLoopingButtonState($playbackLoopingButton); scriptJob -permanent -parent $playbackLoopingButton -event playbackModeChanged ("updatePlaybackLoopingButtonState " + $playbackLoopingButton); // // Create the cached playback preferences button // python( "from maya.plugin.evaluator.cache_ui import cache_ui_toggle_create" ); string $cachedPlaybackButton = python( "cache_ui_toggle_create()" ); string $lastButton = $cachedPlaybackButton; // // Create the layout for the frame rate and playback speed list // formLayout -e -attachForm $frameRateList "top" $topSpacing -attachNone $frameRateList "left" -attachForm $frameRateList "bottom" $bottomSpacing -attachControl $frameRateList "right" 6 $playbackLoopingButton -attachControl $playbackLoopingButton "right" 6 $cachedPlaybackButton -attachForm $lastButton "top" $topSpacing -attachNone $lastButton "left" -attachForm $lastButton "bottom" $bottomSpacing -attachForm $lastButton "right" 0 $section2Layout; setParent ..; // // Create the button to hide/show the framerate list and play back list // string $toggleVisibilitySection2LayoutButton = `iconTextButton -visible true -height $iconHeight -width $thinIconWidth -annotation (uiRes("m_playbackRange.kToogleFrameRateListAnnot")) -i1 openBar.png`; iconTextButton -e -c ("toggleLayoutDisplay displayFramerateandPlaybackSpeed 1 " + $toggleVisibilitySection2LayoutButton + " " + $section2Layout) $toggleVisibilitySection2LayoutButton; toggleLayoutDisplay("displayFramerateandPlaybackSpeed", 0, $toggleVisibilitySection2LayoutButton, $section2Layout); //================================================== // Create the autokey and pref button in they own layout //================================================== string $section3Layout = `formLayout`; // // Create the autoKey mode button. // int $autoKeyState = `autoKeyframe -query -state`; string $autoKeyButton = `symbolCheckBox -image "autoKeyframe.png" -value $autoKeyState - h $iconHeight - w $iconHeight -hlc (207.0/255.0) (53.0/255.0) (57.0/255.0) -annotation (uiRes("m_playbackRange.kAutoKeyframeToggleAnnot")) -onCommand "autoKeyframe -state true" -offCommand "autoKeyframe -state false"`; // Create the button that access the preferences window. string $prefsButton = `symbolButton -image "animPrefsWndIcon.png" -annotation (uiRes("m_playbackRange.kAnimationPreferencesAnnot")) -command "preferencesWnd \"timeslider\""`; // // Create the layout for the frame rate and playback speed list // formLayout -e -attachForm $autoKeyButton "top" $topSpacing -attachNone $autoKeyButton "left" -attachNone $autoKeyButton "bottom" -attachControl $autoKeyButton "right" 6 $prefsButton -attachForm $prefsButton "top" $topSpacing -attachNone $prefsButton "left" -attachForm $prefsButton "bottom" $bottomSpacing -attachForm $prefsButton "right" 0 $section3Layout; setParent ..; // // Create the button to hide the prefenrece icon // string $toggleVisibilitySection3LayoutButton = `iconTextButton -visible true -height $iconHeight -width $thinIconWidth -i1 openBar.png`; iconTextButton -e -c ("toggleLayoutDisplay displayPreferenceIcon 1 " + $toggleVisibilitySection3LayoutButton + " " + $section3Layout) $toggleVisibilitySection3LayoutButton; toggleLayoutDisplay("displayPreferenceIcon", 0, $toggleVisibilitySection3LayoutButton, $section3Layout); // Make attachments for contents of Playback range. // formLayout -edit -attachForm $minRangeField "top" 0 -attachForm $minRangeField "left" 1 -attachForm $minRangeField "bottom" 0 -attachNone $minRangeField "right" -attachForm $minField "top" 0 -attachControl $minField "left" 6 $minRangeField -attachForm $minField "bottom" 0 -attachNone $minField "right" -attachForm $playbackFrame "top" 1 -attachForm $playbackFrame "bottom" 1 -attachControl $playbackFrame "left" 6 $minField -attachControl $playbackFrame "right" 6 $maxField -attachForm $maxField "top" 0 -attachNone $maxField "left" -attachForm $maxField "bottom" 0 -attachControl $maxField "right" 6 $maxRangeField $playbackRange; string $lastAttach= $toggleVisibilitySection2LayoutButton; formLayout -edit -attachForm $characterForm "top" 0 -attachNone $characterForm "left" -attachForm $characterForm "bottom" 0 -attachControl $characterForm "right" 6 $animLayerForm $section1Layout; $lastAttach = $characterForm; formLayout -edit -attachForm $animLayerForm "top" 0 -attachNone $animLayerForm "left" -attachForm $animLayerForm "bottom" 0 -attachForm $animLayerForm "right" 0 $section1Layout; $lastAttach = $animLayerForm; // // Create the button to show / hide the the anim layer and character form // string $toggleVisibilitySection1LayoutButton = `iconTextButton -visible true -height $iconHeight -width $thinIconWidth -i1 openBar.png`; iconTextButton -edit -c ("toggleLayoutDisplay displayAnimLayerAndCharacterForm 1 " + $toggleVisibilitySection1LayoutButton + " " + $section1Layout) $toggleVisibilitySection1LayoutButton; toggleLayoutDisplay("displayAnimLayerAndCharacterForm", 0, $toggleVisibilitySection1LayoutButton, $section1Layout); formLayout -edit -attachForm $toggleVisibilitySection1LayoutButton "top" 0 -attachNone $toggleVisibilitySection1LayoutButton "left" -attachForm $toggleVisibilitySection1LayoutButton "bottom" 0 -attachControl $toggleVisibilitySection1LayoutButton "right" 6 $section1Layout -attachForm $section1Layout "top" $topSpacing -attachNone $section1Layout "left" -attachForm $section1Layout "bottom" $bottomSpacing -attachControl $section1Layout "right" 6 $toggleVisibilitySection2LayoutButton $playbackRange; $lastAttach = $toggleVisibilitySection1LayoutButton; formLayout -edit -attachForm $maxRangeField "top" 0 -attachNone $maxRangeField "left" -attachForm $maxRangeField "bottom" 0 -attachControl $maxRangeField "right" 0 $lastAttach $playbackRange; // // Attach the play frame rate, playback speed list and the button to hide/show them // formLayout -edit -attachForm $toggleVisibilitySection2LayoutButton "top" $topSpacing -attachNone $toggleVisibilitySection2LayoutButton "left" -attachForm $toggleVisibilitySection2LayoutButton "bottom" $bottomSpacing -attachControl $toggleVisibilitySection2LayoutButton "right" 6 $section2Layout -attachForm $section2Layout "top" $topSpacing -attachNone $section2Layout "left" -attachForm $section2Layout "bottom" $bottomSpacing -attachControl $section2Layout "right" 6 $toggleVisibilitySection3LayoutButton $playbackRange; // // Attach the "auto key button" and the "pref button" to the play back range layout // formLayout -edit -attachForm $toggleVisibilitySection3LayoutButton "top" $topSpacing -attachNone $toggleVisibilitySection3LayoutButton "left" -attachForm $toggleVisibilitySection3LayoutButton "bottom" $bottomSpacing -attachControl $toggleVisibilitySection3LayoutButton "right" 6 $section3Layout -attachForm $section3Layout "top" $topSpacing -attachNone $section3Layout "left" -attachForm $section3Layout "bottom" $bottomSpacing -attachForm $section3Layout "right" 0 $playbackRange; // Attach Playback range to parent. // global int $gPanelHandleOffset; formLayout -edit -attachForm $playbackRange "top" 2 -attachForm $playbackRange "bottom" 2 -attachForm $playbackRange "right" 7 -attachForm $playbackRange "left" $gPanelHandleOffset $gPlaybackRangeForm; setUIComponentStateCallback( "Range Slider", "playbackRangeVisibilityStateChange"); // Set the initial height of the Playback Range in the main window. // string $playbackRangeWorkspaceControl = getUIComponentToolBar("Range Slider", false); workspaceControl -e -initialHeight 29 -heightProperty "fixed" -minimumWidth 2 // 0 and 1 can't be used. $playbackRangeWorkspaceControl; // Add call back to play back range... // scriptJob -permanent -parent $playbackRange -event "playbackRangeChanged" ( "setMinMaxPlayback " + $minField + " " + $maxField ); // Add callback to autoKey state // scriptJob -permanent -parent $playbackRange -conditionChange "autoKeyframeState" ( "symbolCheckBox -edit -value `autoKeyframe -query -state` " + $autoKeyButton ); // Add callback to rangeSlider changed trigger // scriptJob -permanent -parent $playbackRange -event "playbackRangeSliderChanged" ( "timeField -e -v `playbackOptions -q -ast` " + $minRangeField + "; " + "timeField -e -v `playbackOptions -q -aet` " + $maxRangeField + "; " ); } global proc int playbackRangeVisibilityStateChange( int $newState, string $layout) // // Description: // This procedure is called whenever the visibility state of the // Playback Range is changed. // // Arguments: // newState - The new visibile state of the Playback Range. // // layout - The parent layout for the Playback Range. // // Returns: // true - If the change of state is to be allowed. // // false - If the state change is rejected. // { int $result = true; // Defer these commands because this proc is called when the visibility // state is about to change. This proc must return true to accept // the state change. After this proc returns then restore the // panel focus and update the pref menu. // evalDeferred("restoreLastPanelWithFocus(); updatePrefsMenu();"); return $result; } // // Procedure Name: // updateCurrentCharacterField // // Description: // update the current character field which show the user what the // current character is. // // Input Arguments: // $parent - Name of the parent layout // $delta - the change in selection (not used) // // Return Value: // None. // global proc updateCurrentCharacterField( string $parent, string $delta[] ) { setParent $parent; string $currentCharacters[] = currentCharacters(); int $size = size( $currentCharacters ); string $text = ""; nameField -edit -object "" characterNameField; if ( $size == 0 ) { $text = (uiRes("m_playbackRange.kNoCharacterSet")); symbolButton -e -image "pickMenuIcon.png" characterSelectionIcon; } else if ( $size == 1 ) { $text = $currentCharacters[0]; nameField -edit -object $text characterNameField; symbolButton -e -image "currentCharMenuIcon.png" characterSelectionIcon; } else { $text = (uiRes("m_playbackRange.kMultiple")); symbolButton -e -image "currentCharMenuIcon.png" characterSelectionIcon; } textField -edit -text $text characterField; } // // Procedure Name: // updateActiveAnimLayerField // // Description: // update the current animation layer field which shows the user what the // current animation layer is. // // Input Arguments: // $parent - Name of the parent layout // $delta - the change in selection (not used) // // Return Value: // None. // global proc updateActiveAnimLayerField( string $parent, string $delta[] ) { if($parent != "") setParent $parent; global string $gSelectedAnimLayers[]; string $layers[] = $gSelectedAnimLayers; int $size = size( $layers ); string $bestLayers[] = `animLayer -query -bestAnimLayer`; int $bestSize = size( $bestLayers); string $text = ""; string $icon = ""; if($size > 0 && $bestSize > 0) { string $lastFound = ""; for($layer in $layers) { if(stringArrayContains($layer, $bestLayers)) { $icon = "activeSelectedAnimLayer.png"; $lastFound = $layer; } } if($lastFound != "") { if($size > 1) { //Show the last active and selected layer $text = ($lastFound + " ++"); } } } if($bestSize > 0 && $icon == "") { //There is no overlap between selected and active layers $icon = "activeDeselectedAnimLayer.png"; } if($icon == "") { //There are no layers active if this point is reached $icon = "pickMenuIcon.png"; } symbolButton -e -image $icon animLayerSelectionIcon; nameField -edit -object "" animLayerNameField; if ( $size == 0 ) { $text = (uiRes("m_playbackRange.kNoAnimLayerSet")); } else if ( $size == 1 ) { $text = $layers[0]; nameField -edit -object $text animLayerNameField; } else { //If there is no overlap between selected and active, //show the last selected layer name. if($text == "") { $text = ($layers[$size - 1] + " ++"); } } textField -edit -text $text animLayerField; }