// =========================================================================== // 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: Aug 15 1996 // // Description: // This script initializes the Time slider. Initialization involves // determining the initial Time slider preferences, creating the UI // and setting the initial visibility. // { // Declare referenced or returned globals. // global string $gPlayBackSlider; // Create the time slider. // if( `exists timeSlider` ) { eval "source timeSlider"; } ////////////////////////////////////////////////////////// // // ANIMATION CONTROLS // ////////////////////////////////////////////////////////// // Height // timeControl -e -h `optionVar -q timeSliderHeight` $gPlayBackSlider; // Key Ticks // int $showKeysCombined = 0; string $showKeysVal = `optionVar -q timeSliderShowKeys`; if ($showKeysVal != "active" && $showKeysVal != "none") { // If optionVar contains name of the channel box, make sure // it is using the proper name for the channelbox. // $showKeysVal = "mainChannelBox"; optionVar -sv timeSliderShowKeys "mainChannelBox"; $showKeysCombined = `optionVar -q timeSliderShowKeysCombined`; } timeControl -e -animLayerFilterOptions `optionVar -q timeSliderAnimLayerOptions` $gPlayBackSlider; timeControl -e -animLayerShowWeight `optionVar -q timeSliderAnimLayerWeight` $gPlayBackSlider; string $showFramesVal = `optionVar -q timeSliderShowFrames`; timeControl -e -showKeys $showKeysVal -showGreaseFrames $showFramesVal $gPlayBackSlider; timeControl -e -showKeysCombined $showKeysCombined $gPlayBackSlider; // Options: Tick size // timeControl -e -tickSize `optionVar -q timeSliderTickSize` $gPlayBackSlider; // Options: Time dislay mode $timeDisplayModeValue = `optionVar -q timeDisplayMode`; animDisplay -tc $timeDisplayModeValue; // Options: Snapping // timeControl -e -snap `optionVar -q timeSliderSnapping` $gPlayBackSlider; // Options: Tick span // timeControl -e -tickSpan `optionVar -q timeSliderTickSpan` $gPlayBackSlider; ////////////////////////////////////////////////////////// // // PLAYBACK // ////////////////////////////////////////////////////////// // Update View // playbackOptions -v `optionVar -q timeSliderPlayView`; // Looping // playbackOptions -l `optionVar -q timeSliderPlayLoop`; // Playback Speed // playbackOptions -playbackSpeed `optionVar -query timeSliderPlaySpeed`; // Max Playback Speed // playbackOptions -maxPlaybackSpeed `optionVar -query timeSliderMaxPlaySpeed`; // Playback By // playbackOptions -by `optionVar -q timeSliderPlayBy`; ////////////////////////////////////////////////////////// // // KEYS // ////////////////////////////////////////////////////////// // Auto Key // autoKeyframe -state `optionVar -q autoKeyframeState`; // Weighted Tangents // keyTangent -g -weightedTangents `optionVar -q weightedTangents`; // Default in tangent // keyTangent -g -inTangentType `optionVar -q inTangentType`; // Default out tangent // keyTangent -g -outTangentType `optionVar -q outTangentType`; ////////////////////////////////////////////////////////// // // SOUND // ////////////////////////////////////////////////////////// // Waveform Display // timeControl -e -waveform `optionVar -q timeSliderSoundDisplay` $gPlayBackSlider; // Repeat on Hold // timeControl -e -roh `optionVar -q timeSliderRepeatOnHold` $gPlayBackSlider; // Repeat Size // timeControl -e -rcs `optionVar -q timeSliderRepeatChunk` $gPlayBackSlider; ////////////////////////////////////////////////////////// // // MISCELLANEOUS // ////////////////////////////////////////////////////////// // Bind the time slider's selection connection to the animation list // timeControl -e -mainListConnection animationList $gPlayBackSlider; // Create the time dragger 3D slider // timeDragger; // Set the initial height of the Time Slider in the main window. // string $timeSliderWorkspaceControl = getUIComponentToolBar("Time Slider", false); workspaceControl -e -initialHeight 32 -heightProperty "fixed" $timeSliderWorkspaceControl; // Set the Time slider's initial visibility. // setTimeSliderVisible( `optionVar -query timeSliderVisible` ); }