// =========================================================================== // 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 procedure creates the main maya window. // global proc storeWindowStates() { string $windows[] = `lsUI -windows`; for($win in $windows) { if($win != "MayaWindow") { optionVar -stringValue ($win + "State") `window -q -state $win`; } } } global proc restoreWindowStates() { string $windows[] = `lsUI -windows`; for($win in $windows) { if($win != "MayaWindow" && `optionVar -exists ($win + "State")`) { evalDeferred("window -e -state `optionVar -q (\"" + $win + "State\")` " + $win); } } } { global string $gMainWindow; global string $gMainWindowForm; global string $gStatusLineForm; global string $gShelfForm; global string $gWorkAreaForm; global string $gMainPane; global string $gViewportWorkspaceControl; global string $gOutlinerForm; global string $gToolboxForm; global string $gTimeSliderForm; global string $gPlaybackRangeForm; global string $gCommandLineForm; global string $gHelpLineForm; global string $gAttributeEditorForm; global string $gToolSettingsForm; global string $gChannelsLayersForm; global string $gChannelsForm; global string $gLayersForm; // These globals track the visibility of the corresponding window // component. Whenever a toggleUIComponentVisibility("Component") call // is made these values are updated. Set all these flags to be // initially visible, they will be updated accordingly when each // component is initialized and their startup preferences are // loaded. // global int $gStatusLineVisible = 1; global int $gShelfVisible = 1; global int $gToolboxVisible = 1; global int $gTimeSliderVisible = 1; global int $gPlaybackRangeVisible = 1; global int $gCommandLineVisible = 1; global int $gHelpLineVisible = 1; global int $gToolSettingsVisible = 1; global int $gChannelsVisible = 1; global int $gLayersVisible = 1; // These flags used by toolbar button in the main window on Mac global int $gUIElementsRestored = 1; global int $gShowAllUIElements = 0; global int $gHideAllUIElements = 0; // Default size of window is full screen. // int $top = 33; int $left = 9; int $width = 1262; int $height = 982; if (`about -nt`) { // window size/position is non-client size. $top = 0; $left = 0; $width = 1280; $height = 1024; } // QT_TODO // if (`about -mac`) { // // default to a 1024 x 768 display // // // $top = 0; // $left = 0; // $width = 1024; // // allow space for the title bar and the dock // // // $height = 768 - 24 - 72; // } // Read in the preference values. // int $useTitleBar = `optionVar -q mainWindowTitleBarVis`; int $menubarVis = `optionVar -q mainWindowMenubarVis`; // Create the main Maya window. // $gMainWindow = `window -retain -mainWindow -menuBarVisible $menubarVis -topLeftCorner $top $left -widthHeight $width $height -titleBar $useTitleBar -minimizeCommand "storeWindowStates" -restoreCommand "restoreWindowStates" -title "Maya" -iconName "Maya" "MayaWindow"`; // if a title bar was specified, annotate it so that it // will always display the current file and selected object. // if ( $useTitleBar ){ showSelectionInTitle "MayaWindow"; } // ------------------------------------------------------------ // Top level form. // ------------------------------------------------------------ // The Work area. This contains the main view panes // $gWorkAreaForm = `workspacePanel -mainWindow`; // The Status line. // $gStatusLineForm = "MainStatusLineLayout"; // The Shelf and Toolbox. // $gShelfForm = "MainShelfLayout"; // The Time slider. // $gTimeSliderForm = "MainTimeSliderLayout"; // The Playback range. // $gPlaybackRangeForm = "MainPlaybackRangeLayout"; // The Command line. // $gCommandLineForm = "MainCommandLineLayout"; // The Help line. // $gHelpLineForm = "MainHelpLineLayout"; $gViewportWorkspaceControl = "MainPane"; $gMainPane = "viewPanes"; int $minSize = `optionVar -q workspacesNarrowPanelInitialWidth` ; workspaceControl -uiScript "global string $gMainPane; paneLayout -nbg 0 $gMainPane;" -loadImmediately true -label `localizedPanelLabel("viewPanes")` -initCallback "mainPaneStateCallback" -minimumHeight $minSize -minimumWidth $minSize -dockToMainWindow "left" false $gViewportWorkspaceControl; // The Toolbox. // $gToolboxForm = "MainToolboxLayout"; // The Attribute Editor. // $gAttributeEditorForm = "MainAttributeEditorLayout"; // The Tool Settings. // $gToolSettingsForm = "MainToolSettingsLayout"; // The combined Channel Box / Layer Editor area. // $gChannelsLayersForm = "MainChannelsLayersLayout"; // The Channel Box area. // $gChannelsForm = "MainChannelBoxLayout"; // The Layer Editor area. // $gLayersForm = "MainLayerEditorLayout"; // The toggled outliner // $gOutlinerForm = "ToggledOutlinerLayout"; source "UIComponents.mel"; // ------------------------------------------------------------ // Now create the UI component areas. // ------------------------------------------------------------ // // Use the createUIComponentToolBar() or createUIComponentDockControl() procedures for each component. // createUIComponentDockControl( "Tool Settings", localizedUIComponentLabel("Tool Settings"), "global string $gToolSettingsForm; formLayout $gToolSettingsForm;", "left", false); createUIComponentDockControl( "Attribute Editor", localizedUIComponentLabel("Attribute Editor"), "global string $gAttributeEditorForm; formLayout $gAttributeEditorForm;", "right", false); createUIComponentDockControl( "Channel Box / Layer Editor", localizedUIComponentLabel("Channel Box / Layer Editor"), "global string $gChannelsLayersForm; formLayout $gChannelsLayersForm;", "right", true); createUIComponentDockControl( "Channel Box", localizedUIComponentLabel("Channel Box"), "global string $gChannelsForm; formLayout $gChannelsForm;", "right", true); createUIComponentDockControl( "Layer Editor", localizedUIComponentLabel("Layer Editor"), "global string $gLayersForm; formLayout $gLayersForm;", "right", true); createUIComponentToolBar( "Tool Box", localizedUIComponentLabel("Tool Box"), "global string $gToolboxForm; formLayout $gToolboxForm;", "left", false); createUIComponentDockControl( "Outliner", localizedPanelLabel("Outliner"), "global string $gOutlinerForm; formLayout $gOutlinerForm;", "right", false); createUIComponentToolBar( "Shelf", localizedUIComponentLabel("Shelf"), "global string $gShelfForm; formLayout $gShelfForm;", "top", false); createUIComponentToolBar( "Status Line", localizedUIComponentLabel("Status Line"), "global string $gStatusLineForm; formLayout $gStatusLineForm;", "top", false); createUIComponentToolBar( "Time Slider", localizedUIComponentLabel("Time Slider"), "global string $gTimeSliderForm; formLayout $gTimeSliderForm;", "bottom", false); createUIComponentToolBar( "Range Slider", localizedUIComponentLabel("Range Slider"), "global string $gPlaybackRangeForm; formLayout $gPlaybackRangeForm;", "bottom", false); createUIComponentToolBar( "Command Line", localizedUIComponentLabel("Command Line"), "global string $gCommandLineForm; formLayout $gCommandLineForm;", "bottom", false); createUIComponentToolBar( "Help Line", localizedUIComponentLabel("Help Line"), "global string $gHelpLineForm; formLayout $gHelpLineForm;", "bottom", false); // ------------------------------------------------------------ // Create a default cluster for any toolbox or shelf tools. // if (!`toolCollection -exists toolCluster`) { toolCollection -global true toolCluster; } }