// =========================================================================== // 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 is called to take the panel in focus // . back to its previous view // if the $direction is -1; // . or go to its next view // if the $direction is 1. // global proc goToView(int $direction) { // Get the panel with focus. // string $panel = `getPanel -withFocus`; if ($panel == "") { // No panel is in focus. Check which panel has the cursor // over it. // $panel = `getPanel -underPointer`; } if ($panel == "") { string $warningMessage = (uiRes("m_goToView.kDoNotKnowWhichPanel")); warning($warningMessage); return; } string $type = `getPanel -typeOf $panel`; // Model panel. // if ($type == "modelPanel") { if ($direction == -1) { viewSet -animate (`optionVar -q animateRollNextLastCameraView`) -pv `hotkeyCurrentCamera $panel`; } else { viewSet -animate (`optionVar -q animateRollNextLastCameraView`) -nv `hotkeyCurrentCamera $panel`; } return; } // Scripted panel. // if ($type == "scriptedPanel") { string $scriptedType = `scriptedPanel -query -type $panel`; int $isCustomView = `scriptedPanelType -q -customView $scriptedType`; //Custom panel if ( $isCustomView ) { if ($direction == -1) { viewSet -animate (`optionVar -q animateRollNextLastCameraView`) -pv `hotkeyCurrentCamera $panel`; } else { viewSet -animate (`optionVar -q animateRollNextLastCameraView`) -nv `hotkeyCurrentCamera $panel`; } return; } else if ($scriptedType == "hyperShadePanel") { if ($direction == -1) { hyperShadePanelGraphCommand($panel, "showPreviousGraph"); } else { hyperShadePanelGraphCommand($panel, "showNextGraph"); } return; } else if ($scriptedType == "polyTexturePlacementPanel") { if ($direction == -1) { textureWindow -edit -previousView $panel; } else { textureWindow -edit -nextView $panel; } return; } if ($scriptedType == "graphEditor") { if ($direction == -1) { animView -edit -previousView ($panel+"GraphEd"); } else { animView -edit -nextView ($panel+"GraphEd"); } } } }