// =========================================================================== // 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: 31 May 1997 // // Procedure Name: // HotboxSouthMenu // // Description: // Create the user customizable Hotbox South Menu for hotbox // // Input Arguments: // parent to parent the menu to. // // Return Value: // None. // global proc switchPanelToType(string $panelType) { string $curPanel = `getPanel -withFocus`; string $firstPanel; global string $gToggledOutlinerLabel; if ($curPanel == "" || $panelType == "") return; // If the panel is torn-off then abort operation. // int $tornOff = `panel -q -tearOff $curPanel`; if ($tornOff) return; string $allPanelsOfType[]; switch ($panelType) { case "Outliner": // There are 2 Outliner panels, the correct one to grab is not the ToggledOutliner. $allPanelsOfType = `getPanel -typ outlinerPanel`; for ($i = 0; $i < size($allPanelsOfType) && $firstPanel == ""; ++$i) { if (`outlinerPanel -q -label $allPanelsOfType[$i]` != $gToggledOutlinerLabel) $firstPanel = $allPanelsOfType[$i]; } if ($firstPanel != "" && !`panel -q -to $firstPanel`) outlinerPanel -e -rp $curPanel $firstPanel; break; case "GraphEditor": $allPanelsOfType = `getPanel -sty graphEditor`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; break; case "DopeSheet": $allPanelsOfType = `getPanel -sty dopeSheetPanel`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; break; case "NodeEditor": $allPanelsOfType = `getPanel -sty nodeEditorPanel`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; break; case "Hypergraph": $firstPanel = getHyperGraphPanel("DAG"); hyperGraphReplacePanel($curPanel, $firstPanel); string $editor = $firstPanel+"HyperGraphEd"; showDAGLevel $editor; break; case "Hypershade": $allPanelsOfType = `getPanel -sty hyperShadePanel`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; break; case "DynRelationships": $allPanelsOfType = `getPanel -sty dynRelEdPanel`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; break; case "RenderView": $allPanelsOfType = `getPanel -sty renderWindowPanel`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; break; case "SetEditor": $allPanelsOfType = `getPanel -sty relationshipPanel`; $firstPanel = $allPanelsOfType[0]; if ($firstPanel != "" && !`panel -q -to $firstPanel`) scriptedPanel -e -rp $curPanel $firstPanel; relationshipEditorBeginTask($firstPanel,"setMembership"); break; } // ensure that panes are drawn global string $gMainPane; if ( `about -mac` && $gMainPane != "") paneLayout -e -manage true $gMainPane; } global proc HotboxSouthMenu( string $parent ) { setParent -m $parent; if( `menu -q -ni $parent` != 0 ) { // // Menu is built already - just return // return; } menuItem -rp "N" -label (localizedPanelLabel("Outliner")) -c "switchPanelToType Outliner"; menuItem -rp "E" -label (localizedPanelLabel("Graph Editor")) -c "switchPanelToType GraphEditor"; menuItem -rp "SE" -label (localizedPanelLabel("Dope Sheet")) -c "switchPanelToType DopeSheet"; menuItem -rp "S" -label (localizedPanelLabel("Hypergraph")) -c "switchPanelToType Hypergraph"; menuItem -rp "SW" -label (localizedPanelLabel("Node Editor")) -c "switchPanelToType NodeEditor"; menuItem -rp "W" -label (localizedPanelLabel("Hypershade")) -c "switchPanelToType Hypershade"; menuItem -rp "NW" -label (localizedPanelLabel("Render View")) -c "switchPanelToType RenderView"; menuItem -rp "NE" -label (localizedHotboxMenuItem("Set Editor")) -c "switchPanelToType SetEditor"; setParent -m ..; }