// =========================================================================== // 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. // =========================================================================== global proc string findPanelPopupParent() // // Description: // Find the paneLayout or workspaceControl under the mouse pointer. A popupMenu can be attached // to the layout for hotkey-enabled marking menus. // If neither can be found under the pointer, this method returns "viewPanes". This is // so that the user is not annoyed by error messages when they mistakenly use the wrong hotkey // on a non-panel window. ("viewPanes" is Maya's main paneLayout) // // Returns: // The paneLayout name. // { string $c = `getPanel -up`; if (`panel -q -ex $c`) { // get the paneLayout parent of this panel $c = `layout -q -p $c`; while (!(`paneLayout -q -ex $c` || `workspaceControl -q -ex $c`)) { $c = `control -q -p $c`; } if (`paneLayout -q -ex $c` || `workspaceControl -q -ex $c`) { return $c; } } return "viewPanes"; }