// =========================================================================== // 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 13, 2003 // // Procedure Name: // lookThroughModelPanelSetup // // Description: // Procedure used by lookThroughModelPanel and lookThroughModelPanelClipped to setup state // // Input Arguments: // panelName - name of the panel to look though object in // // Return Value: // The panel displaying the view. // global proc string lookThroughModelPanelSetup( string $panelName ) { string $ret = $panelName; if (`getPanel -typeOf $panelName` != "modelPanel") { string $invisibles[] = `getPanel -invisiblePanels`; int $success = 0; for ($item in $invisibles) { if (`getPanel -typeOf $item` == "modelPanel") { modelPanel -e -replacePanel $panelName $item; $ret = $item; $success = 1; break; } } // if we were not able to find an unused model panel // to swap into place, then we must create a new one. // if ( $success == 0 ){ int $showMenubar = `optionVar -q allowMenusInPanels`; string $pname = `modelPanel -unParent -mbv $showMenubar`; modelPanel -e -replacePanel $panelName -label `interToUI $pname` $pname; $ret = $pname; } } return $ret; }