// =========================================================================== // 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: August 30, 1999 // // Description: // This script a panel which has both an outliner and a graph editor // within it. // // Input Arguments: // None. // // Return Value: // None. // global proc buildClipEditorViewMenu (string $clipEditor, string $parentMenu) // // Procedure Name: // buildClipEditorViewMenu // // Description: // This creates submenu items for view // functionality in the dope sheet. // // Input Arguments: // None. // // Return Value: // None. // { } global proc buildTraxContextHelpItems(string $nameRoot, string $menuParent) // // Description: // Build context sensitive menu items // // Input Arguments: // $nameRoot - name to use as the root of all item names // $menuParent - the name of the parent of this menu // // Return Value: // None // { menuItem -label (uiRes("m_clipEditorPanel.kHelpTrax")) -annotation (uiRes("m_clipEditorPanel.kHelpTraxAnnot")) -enableCommandRepeat false -command "showHelp TraxEditor"; } global proc createClipEditorPanel (string $whichPanel) // // Description: // Define the editors that are used in this panel. No // controls (widgets) are created at this point. // { // create unique names for editors based on panel name // string $clipEditor = clipEditorNameFromPanel($whichPanel); string $highlightConnection = ($whichPanel + "HighlightConnection"); // WARNING: Changes here must also be made in buildNewSceneUI.mel // // Create the clip editor. selectionConnection $highlightConnection; clipEditor -unParent -mainListConnection clipEditorList -highlightConnection $highlightConnection $clipEditor; selectionConnection -edit -parent $clipEditor $highlightConnection; registerEditor $clipEditor clipEditorList; if (`exists clipEditorRegisterActions`) clipEditorRegisterActions $clipEditor; // Add support for the Context Sensitive Help Menu. // addContextHelpProc $whichPanel "buildTraxContextHelpItems"; } global proc addClipEditorPanel (string $whichPanel) // // Description: // Add the panel to a layout. // Parent the editors to that layout and create any other // controls (widgets) required. // { string $clipEditor = clipEditorNameFromPanel($whichPanel); string $baseForm = `formLayout clipEditorPanelBaseForm`; // Make toolbar // frameLayout -visible true -borderVisible false -labelVisible false -collapsable false -collapse true clipEditorToolbarFrame; string $toolBarForm = `formLayout -visible true clipEditorToolbarForm`; string $toolBarFlow = `flowLayout -visible true clipEditorToolbarFlow`; int $iconsize = 26; setParent $toolBarFlow; iconTextButton -i1 "traxCreateClip.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kCreateClipIconAnnot")) -command ("CreateClip; doReload " + $clipEditor) createClipButton; iconTextButton -i1 "traxCreateBlend.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kCreateBlendIconAnnot")) -command ("performBlendClip 0 " + $clipEditor) createBlendButton; separator -h $iconsize -horizontal false -style single ctbSeparator1; string $clipTabName = (uiRes("m_clipEditorPanel.kCharacterClips")); iconTextButton -i1 "traxOpenLibrary.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kGetClipsIconAnnot")) -command ("{VisorWindow; string $pnl=visorPanelName();if(size($pnl)>0) visorPanelMenuCommand( $pnl, \"selectOrCreateTabByLabel "+$clipTabName+"\");}" ) openVisorButton; separator -h $iconsize -horizontal false -style single ctbSeparator2; string $cmd = "FrameAll"; iconTextButton -i1 "traxFrameAll.png" -w $iconsize -h $iconsize -annotation (getRunTimeCommandAnnotation($cmd)) -command $cmd frameAllButton; iconTextButton -i1 "traxFrameRange.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kFramePlaybackRangeIconAnnot")) -command ("frameTimelineRange " + $clipEditor) frameRangeButton; iconTextButton -i1 "centerCurrentTime.png" -width $iconsize -height $iconsize -annotation (uiRes("m_clipEditorPanel.kCenterCurrentTimeIconAnnot")) -command ("clipEditor -edit -lookAt currentTime " + $clipEditor) centerCurrentTimeButton; separator -h $iconsize -horizontal false -style single ctbSeparator3; iconTextButton -i1 "traxGraphAnimCurves.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kGraphAnimCurvesIconAnnot")) -command ("clipGraphEditor " + $clipEditor) graphAnimCurvesButton; separator -h $iconsize -horizontal false -style single ctbSeparator4; iconTextButton -i1 "puppetAdd.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kLoadSelCharsIconAnnot")) -command ("doReload " + $clipEditor) addCharacterButton; iconTextButton -i1 "traxGraphWeightCurves.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kGraphWeightCurvesIconAnnot")) -command ("clipWeightGraph `getSelectedClips(\"includeCache\")`") graphWeightCurvesButton; iconTextButton -i1 "summaryCreate.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kGroupIconAnnot")) -command ("createCharacterSummary `ls -sl`") createSummaryButton; iconTextButton -i1 "summaryRemove.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kUngroupIconAnnot")) -command ("removeFromCharacterSummary `ls -sl`") removeSummaryButton; iconTextButton -i1 "trimBefore.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kTrimClipBeforeIconAnnot")) -command ("traxTrim 0 `getSelectedClips(\"noOptions\")`") trimBeforeButton; iconTextButton -i1 "trimAfter.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kTrimClipAfterIconAnnot")) -command ("traxTrim 1 `getSelectedClips(\"noOptions\")`") trimAfterButton; iconTextButton -i1 "keyIntoclip.png" -w $iconsize -h $iconsize -annotation (uiRes("m_clipEditorPanel.kKeyIntoClipIconAnnot")) -command ("doKeyIntoClip(1, {\"\"})") keyIntoClipButton; setParent $toolBarForm; // Get Graph Editor and Dope Sheet from Trax iconTextButton -i1 "getGraphEditor.png" -width $iconsize -height $iconsize -command ( "replaceEditor graphEditor1 GraphEditor" ) -annotation (uiRes("m_clipEditorPanel.kGetGraphEditorIconAnnot")) -version "2017" getGraphEditorButton; iconTextButton -i1 "getDopeSheet.png" // TODO: FIX -width $iconsize -height $iconsize -command ( "replaceEditor dopeSheetPanel1 DopeSheetEditor" ) -annotation (uiRes("m_clipEditorPanel.kGetDopeSheetIconAnnot")) getDopeSheetButton; formLayout -edit -attachForm $toolBarFlow "left" 0 -attachForm $toolBarFlow "top" 0 -attachForm $toolBarFlow "bottom" 0 -attachControl $toolBarFlow "right" 0 getGraphEditorButton -attachNone getGraphEditorButton "left" -attachControl getGraphEditorButton "right" 0 getDopeSheetButton -attachNone getDopeSheetButton "left" -attachForm getDopeSheetButton "right" 0 $toolBarForm; setParent $baseForm; // Define container widget to hold the clip editor $containerWidget = `formLayout -visible true`; $scrollWidget = `intScrollBar -horizontal false -visible true -width 16`; setParent $containerWidget; // Put the clip editor into the container. clipEditor -edit -parent $containerWidget $clipEditor; string $clipEditorControl = `clipEditor -query -control $clipEditor`; int $scrollPosition = 0; int $leftScrollPosition = -16; formLayout -edit -attachForm $clipEditorControl top 0 -attachForm $clipEditorControl left 0 -attachForm $clipEditorControl bottom 0 -attachControl $clipEditorControl right 0 $scrollWidget -attachForm $scrollWidget top 0 -attachForm $scrollWidget bottom 0 -attachOppositeForm $scrollWidget left $leftScrollPosition -attachForm $scrollWidget right $scrollPosition $containerWidget; // attach the the container widget to the edges of the base form // and the bottom of the toolbar // formLayout -edit -attachForm clipEditorToolbarFrame top 0 -attachForm clipEditorToolbarFrame left 0 -attachForm clipEditorToolbarFrame right 0 -attachForm $containerWidget left 0 -attachForm $containerWidget right 0 -attachForm $containerWidget bottom 0 -attachControl $containerWidget top 0 clipEditorToolbarFrame $baseForm; setParent `scriptedPanel -query -control $whichPanel`; setParent -top; int $autoLoad = 0; if (`optionVar -exists traxAutoLoadSel`) { $autoLoad = `optionVar -q traxAutoLoadSel`; } if ($autoLoad) { clipEditor -edit -unlockMainConnection $clipEditor; } else { clipEditor -edit -lockMainConnection $clipEditor; } } global proc removeClipEditorPanel (string $whichPanel) // // Description: // Remove the panel from a layout. // Delete controls. // { string $clipEditor = clipEditorNameFromPanel($whichPanel); if (`clipEditor -exists $clipEditor`) { clipEditor -edit -unParent $clipEditor; } } global proc deleteClipEditorPanel (string $whichPanel) // // Description: // This proc will delete the contents of the panel, but not // the panel itself. // // Note: // We only need to delete editors here. Other UI will be taken care of // by the remove proc. // { string $clipEditor = clipEditorNameFromPanel($whichPanel); if (`clipEditor -exists $clipEditor`) { deleteUI -editor $clipEditor; } } global proc string saveStateClipEditorPanel (string $whichPanel) // // Description: // This proc returns a string that when executed will restore the // current state of the panel elements. // { string $indent = "\n\t\t\t"; string $clipEditor = clipEditorNameFromPanel($whichPanel); return ( $indent + "$editorName = clipEditorNameFromPanel($panelName);\n" + `clipEditor -query -stateString $clipEditor` ); } global proc clipEditorPanel (string $panelName) { } global proc string [] clipEditorFilterCategories() // // Description: // Return the types of filters that the Clip Editor will display // in its "Show->Objects" filter menu. // { string $result[] = { "Modeling", "Camera", "Animating" }; return $result; }