// =========================================================================== // 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. // =========================================================================== // Description: This procedure creates a new hyper graph panel // of the given type and display it in the display panel with the // the given panelName. // global proc showNewHyperGraphPanel(string $panelName, string $type) { // Create new hyper graph panel. // string $panelLabel = hyperGraphGenerateNewPanelLabel($type); string $whichPanel = `scriptedPanel -label $panelLabel -type hyperGraphPanel -replacePanel $panelName`; // Show the scene hierarchy view or the dg view. // string $hyperGraphEd = $whichPanel + "HyperGraphEd" ; if ($type == "DG") { showDGLevel $hyperGraphEd; } else if ($type == "DAG") { showDAGLevel $hyperGraphEd; } } // Description: This procedure builds the hyper graph submenu under // the panel menu. It lists // . the list of hyper graph with scene hierarchy view (i.e., DAG view), // . the list of hyper graph with input and output connection // view (i.e., DG view), // . a menuItem for creating new hyper graph with // scene hierarchy view, // . a menuItem for creating new hyper graph with // input and output connection view. // global proc buildPanelHypergraphSubMenu(string $parentMenu, string $panelName) { // Get hyper graph panels: // . one list for the panels using scene hierarchy view, // . one list for the panels using input and output connection view. // string $hyperGraphPanelsWithSceneHierarchy[]; string $hyperGraphPanelsWithInputAndOutputConnection[]; hyperGraphWindowList($hyperGraphPanelsWithSceneHierarchy, $hyperGraphPanelsWithInputAndOutputConnection); // Rebuild menu // setParent -m $parentMenu; menu -e -deleteAllItems $parentMenu; // Existing hyper graph windows with scene hierarchy view. // string $panel; string $panelLabel; for ($panel in $hyperGraphPanelsWithSceneHierarchy) { $panelLabel = `scriptedPanel -query -label $panel`; menuItem -l $panelLabel -command ("hyperGraphReplacePanel \""+$panelName+"\" \""+$panel+"\""); } if (size($hyperGraphPanelsWithInputAndOutputConnection) != 0) { menuItem -divider true; } // Existing hyper graph windows with input and output connection view. // for ($panel in $hyperGraphPanelsWithInputAndOutputConnection) { $panelLabel = `scriptedPanel -query -label $panel`; menuItem -l $panelLabel -command ("hyperGraphReplacePanel \""+$panelName+"\" \""+$panel+"\""); } menuItem -divider true; // menuItems for creating new hyper graph panels. // menuItem -l (uiRes("m_buildPanelHypergraphSubMenu.kNewHyperGraphWithSceneHierarchy")) -command ("showNewHyperGraphPanel \""+$panelName+"\" \"DAG\""); menuItem -l (uiRes("m_buildPanelHypergraphSubMenu.kNewHyperGraphWithInputAndOutputConnections")) -command ("showNewHyperGraphPanel \""+$panelName+"\" \"DG\""); }