// =========================================================================== // 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. // =========================================================================== // // // // // // // nextOrPreviousFrame (string $advanceFlag) // // // None // // // Script for going to the next or previous frame. // // // string $advanceFlag Valid values are "next" or "previous". // // // // To go to the next frame // nextOrPreviousFrame next // // // To go to the previous frame // nextOrPreviousFrame previous // // ///////////////////////////////////////////////////////////////////////// // // Procedure Name: // nextOrPreviousFrame // // Return Value: // none // global proc nextOrPreviousFrame(string $advanceFlag) { int $frameDiff = ($advanceFlag == "next") ? 1 : (-1); int $changedSequenceTime = 0; // Check for the sequencer as the active window // string $currentPanel = `getPanel -withFocus`; string $panelType = `getPanel -to $currentPanel`; if ($panelType == "scriptedPanel") { string $scriptedPanelType = `scriptedPanel -q -type $currentPanel`; if ($scriptedPanelType == "sequenceEditorPanel") { sequenceManager -ct ( `sequenceManager -q -ct ` + $frameDiff ); $changedSequenceTime = 1; } } if (! $changedSequenceTime) { currentTime ( `currentTime -q` + $frameDiff ); } }