// =========================================================================== // 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 12 1996 // // Description: // This script creates the UI for the main window on startup. // // Input Arguments: // None. // // Return Value: // None. // // Note: // None. // { global float $gGuiStartupTime = 0.0; $gGuiStartupTime = `timerX`; int $printMemoryExists = `exists printMemory`; if ($printMemoryExists) { printMemory("Static initializers complete"); } global string $gMainWindow = ""; global string $gCommandWindow = "CommandWindow"; // // Determine values for initial setup states // int $buildMainWindow = !`optionVar -q mainWindowDisable`; // // Get the window positions before creating any windows // windowPref -enableAll `optionVar -q saveWindowPos`; if (`optionVar -q saveWindowPos`) { windowPref -loadAll; } // Force out of xformNoSelect mode selectPref -xformNoSelect off; // // Start building the application UI. // if (`exists setDefaultTemplates`) { eval "source setDefaultTemplates"; } setStartupMessage (uiRes("m_initialLayout.kInitCommandWindow")); if (`exists initCommandWindow`) eval "source initCommandWindow"; if ($buildMainWindow && `exists initMainWindow`) { source initMainWindow; source initContexts; if (`isTrue "AnimationExists"` && `exists animationStartup`) { eval "source animationStartup"; } //////////////////////////////////////////////////////////// // // Attribute Editor // //////////////////////////////////////////////////////////// if(`exists initAttributeEditor`) { if($printMemoryExists) { printMemory("Attribute Editor Start"); } setStartupMessage (uiRes("m_initialLayout.kInitAttribEditor")); eval "source initAttributeEditor"; if ($printMemoryExists) { printMemory("Attribute Editor Complete"); } } //////////////////////////////////////////////////////////// // // Tool Settings // //////////////////////////////////////////////////////////// if(`exists initToolSettings`) { if($printMemoryExists) { printMemory("Tool Settings Start"); } setStartupMessage (uiRes("m_initialLayout.kInitToolSettings")); eval "source initToolSettings"; if ($printMemoryExists) { printMemory("Tool Settings Complete"); } } ////////////////////////////////////////////////////////////// //// //// Channel Box and Layer Editor Area. //// ////////////////////////////////////////////////////////////// if(`exists initChannelsLayers`) { if($printMemoryExists) { printMemory("Channel Box and Layer Editor Start"); } setStartupMessage (uiRes("m_initialLayout.kInitChannelsLayers")); eval ("source initChannelsLayers"); if ($printMemoryExists) { printMemory("Channel Box and Layer Editor Complete"); } } ////////////////////////////////////////////////////////////// //// //// Channel Box Area. //// ////////////////////////////////////////////////////////////// if(`exists initChannels`) { if($printMemoryExists) { printMemory("Channel BoxStart"); } setStartupMessage (uiRes("m_initialLayout.kInitChannelBox")); eval ("source initChannels"); if ($printMemoryExists) { printMemory("Channel Box Complete"); } } ////////////////////////////////////////////////////////////// //// //// Layer Editor Area. //// ////////////////////////////////////////////////////////////// if(`exists initLayers`) { if($printMemoryExists) { printMemory("Layer Editor Start"); } setStartupMessage (uiRes("m_initialLayout.kLayerEd")); eval ("source initLayers"); if ($printMemoryExists) { printMemory("Layer Editor Complete"); } } /////////////////////////////////////////////////////////////// //// //// Outliner //// /////////////////////////////////////////////////////////////// if(`exists initOutliner`) { if($printMemoryExists) { printMemory("Outliner Start"); } setStartupMessage (uiRes("m_initialLayout.kInitOutliner")); eval "source initOutliner"; if ($printMemoryExists) { printMemory("Outliner Complete"); } } if (`exists outlinerStateCallback`){ eval "source outlinerStateCallback"; } //////////////////////////////////////////////////////////// // // Main window view panes. // //////////////////////////////////////////////////////////// if (`exists initMainPane`) { setStartupMessage (uiRes("m_initialLayout.kInitViewPanes")); if (`exists mainPaneStateCallback`){ eval "source mainPaneStateCallback"; } eval "source initMainPane"; if ($printMemoryExists) { printMemory("Main Pane Complete"); } } //////////////////////////////////////////////////////////// // // Panels. // //////////////////////////////////////////////////////////// if (`exists initPanels`) { setStartupMessage (uiRes("m_initialLayout.kInitPanels")); eval "source initPanels"; if ($printMemoryExists) { printMemory("Panels Complete"); } } //////////////////////////////////////////////////////////// // // Status line. // //////////////////////////////////////////////////////////// if (`exists initStatusLine`) { setStartupMessage (uiRes("m_initialLayout.kInitStatusLine")); eval "source initStatusLine"; if ($printMemoryExists) { printMemory("Status Line Complete"); } } //////////////////////////////////////////////////////////// // // Time Slider and Playback range. // //////////////////////////////////////////////////////////// if (`isTrue "AnimationExists"` && `exists initTimeSlider` ) { setStartupMessage (uiRes("m_initialLayout.kInitTimeSlider")); eval "source initTimeSlider"; eval "source initPlaybackRange"; } //////////////////////////////////////////////////////////// // // Command line. // //////////////////////////////////////////////////////////// if (`exists initCommandLine` ) { setStartupMessage (uiRes("m_initialLayout.kInitCommandLine")); eval "source initCommandLine"; } //////////////////////////////////////////////////////////// // // Shelf. // //////////////////////////////////////////////////////////// if (`exists initShelf`) { if ($printMemoryExists) { printMemory("Shelf Start"); } setStartupMessage (uiRes("m_initialLayout.kInitShelf")); eval "source initShelf"; if ($printMemoryExists) { printMemory("Shelf Complete"); } } //////////////////////////////////////////////////////////// // // Help line. // //////////////////////////////////////////////////////////// if (`exists initHelpLine`) { setStartupMessage (uiRes("m_initialLayout.kInitHelpLine")); eval "source initHelpLine"; } //////////////////////////////////////////////////////////// // // Toolbox. // //////////////////////////////////////////////////////////// if (`exists toolbox`) { setStartupMessage (uiRes("m_initialLayout.kInitToolbox")); eval "source toolbox"; } } if (`exists initAuxiliary`) { eval "source initAuxiliary"; } // Set minor nodes that will not appear in Maya UI. // if (`exists initMinorNodeTypes`) { eval "source initMinorNodeTypes"; } if (`window -exists $gMainWindow`) { if (`exists initMainMenuBar`) { if ($printMemoryExists) { printMemory("Menu Bar Start"); } setStartupMessage (uiRes("m_initialLayout.kInitMenuBar")); source initMainMenuBar; if ($printMemoryExists) { printMemory("Menu Bar Complete"); } } setStartupMessage (uiRes("m_initialLayout.kInitColors")); if (`exists initColors`) eval "source initColors"; setStartupMessage (uiRes("m_initialLayout.kInitManipulators")); if (`exists initManipulators`) eval "source initManipulators"; // Map the main window after initColors or refresh callbacks // on color changes will cause startup to be slow // setStartupMessage (uiRes("m_initialLayout.kInitShowMayaWindow")); windowPref -restoreMainWindowState startupMainWindowState; showWindow $gMainWindow; } // These globals are used internally and need to be declared in advance. // global string $gBuffStr; global string $gBuffStr0; global string $gBuffStr1; // Not sure where to declare this, so.. // // This variable is used to store the last action // the user performed, or the last tool that they // were using before switching to another tool // // Note: Really the global variable $gSelect should be used instead // of hard coding selectSuperContext but the syntax doesn't allow it. // global string $gLastAction = "setToolTo selectSuperContext"; // The next variable is used to allow the user to // quickly return to a 'working' keyframe. This // allows user to scrub through time to evaluate the // effects of changing/setting a keyframe, and // quickly return to that frame to make further // changes, if necessary. // global float $gCurrentWorkingFrame = 1; if ($printMemoryExists) { printMemory("Layout complete"); } // Initialize the help broswer // global int $gUseHelpBrowserWin; global int $gRaiseHelpBrowserWin; $gUseHelpBrowserWin = `optionVar -q helpBrowserUseWindow`; $gRaiseHelpBrowserWin = `optionVar -q helpBrowserRaiseWindow`; // Initialize selection masks // source selectionMaskStackInit; $gGuiStartupTime = `timerX -startTime $gGuiStartupTime`; // Initialize Render Sequence // initRenderSequence(); }