// =========================================================================== // 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: Sept 1996 // // Description: // This script performs various GUI startup related tasks. // It is run only in GUI mode and not batch mode. // // Input Arguments: // None. // // Return Value: // None. // // Note: // None. // { // // Set up some defaults for the tear-off panel sizes. // Normally, these windows use the last panel size but in // some cases this isn't a good fit. // windowPref -tlc 225 150 -wh 250 400 outlinerPanel1Window; windowPref -tlc 250 200 -wh 700 400 hyperGraphPanel1Window; windowPref -tlc 250 200 -wh 660 400 graphEditor1Window; windowPref -tlc 250 200 -wh 1400 400 timeEditorPanel1Window; windowPref -tlc 250 200 -wh 660 400 dopeSheetPanel1Window; windowPref -tlc 250 200 -wh 1040 600 nodeEditorPanel1Window; windowPref -tlc 250 200 -wh 660 400 shapePanel1Window; windowPref -tlc 250 200 -wh 1040 600 posePanel1Window; windowPref -tlc 250 200 -wh 660 400 clipEditorPanel1Window; windowPref -tlc 250 200 -wh 524 470 devicePanel1Window; windowPref -tlc 75 75 -wh 1440 900 hyperShadePanel1Window; windowPref -tlc 250 200 -wh 700 400 dynPaintScriptedPanelWindow; windowPref -tlc 250 200 -wh 550 562 blindDataEditor1Window; windowPref -tlc 150 200 -wh 1120 640 polyTexturePlacementPanel1Window; windowPref -tlc 235 230 -wh 1430 710 contentBrowserPanel1Window; global int $gPanelHandleOffset = 10; workspaceControlState -dc 225 150 -dwh 250 400 outlinerPanel1Window; workspaceControlState -dc 250 200 -dwh 700 400 hyperGraphPanel1Window; workspaceControlState -dc 250 200 -dwh 660 400 graphEditor1Window; workspaceControlState -dc 250 200 -dwh 1400 400 timeEditorPanel1Window; workspaceControlState -dc 250 200 -dwh 660 400 dopeSheetPanel1Window; workspaceControlState -dc 250 200 -dwh 1040 600 nodeEditorPanel1Window; workspaceControlState -dc 250 200 -dwh 660 400 shapePanel1Window; workspaceControlState -dc 250 200 -dwh 900 500 posePanel1Window; workspaceControlState -dc 250 200 -dwh 660 400 clipEditorPanel1Window; workspaceControlState -dc 250 200 -dwh 524 470 devicePanel1Window; workspaceControlState -dc 75 75 -dwh 1440 900 hyperShadePanel1Window; workspaceControlState -dc 250 200 -dwh 700 400 dynPaintScriptedPanelWindow; workspaceControlState -dc 250 200 -dwh 550 562 blindDataEditor1Window; workspaceControlState -dc 150 200 -dwh 1120 640 polyTexturePlacementPanel1Window; workspaceControlState -dc 235 230 -dwh 1430 710 contentBrowserPanel1Window; //Hypershade panels workspaceControlState -dc 250 200 -dwh 312 400 hypershadeCreatePanel; workspaceControlState -dc 250 200 -dwh 312 400 hypershadeBinsPanel; workspaceControlState -dc 250 200 -dwh 445 500 hypershadePropertyEditorPanel; workspaceControlState -dc 250 200 -dwh 750 215 hypershadeBrowserPanel; workspaceControlState -dc 250 200 -dwh 700 400 hypershadeShaderballPanel; workspaceControlState -dc 250 200 -dwh 1090 570 hypershadeModelEditorPanel; workspaceControlState -dc 250 200 -dwh 675 400 hypershadeSpreadsheetPanel; workspaceControlState -dc 250 200 -dwh 570 400 hypershadeRenderViewPanel; workspaceControlState -dc 225 150 -dwh 250 400 hypershadeOutlinerPanel; workspaceControlState -dc 250 200 -dwh 1090 570 hypershadeUVEditorPanel; workspaceControlState -dc 250 200 -dwh 660 400 hypershadeGraphEditorPanel; workspaceControlState -dc 250 200 -dwh 250 400 hypershadeShaderSourcePanel; workspaceControlState -dc 250 200 -dwh 250 400 hypershadeFragmentSourcePanel; // // General // translator -cmp `optionVar -q fileCompressionMode`; snapMode -useTolerance `optionVar -q useSnapTolerance` -tolerance `optionVar -q snapTolerance` -uvTolerance `optionVar -q snapUVTolerance` -edgeMagnet `optionVar -q snapMagnet` -edgeMagnetTolerance `optionVar -q snapMagnetTolerance`; mouse -mouseButtonTracking `optionVar -query mayaMacButtonMap`; mouse -enableScrollWheel `optionVar -query useScrollWheel`; multiTouch -gestures `optionVar -query useMultiTouchGestures`; if (`about -mac`) { multiTouch -trackpad `optionVar -query trackpadSetting`; } // // Selection // selectPref -singleBoxSelection `optionVar -q selectSingleMarquee` -clickDrag `optionVar -q selectClickDrag` -affectsActive `optionVar -q selectAffectsActive` -allowHiliteSelection true -ignoreSelectionPriority `optionVar -q ignoreSelectionPriority` -popupMenuSelection `optionVar -q popupMenuSelection` -expandPopupList `optionVar -q expandPopupList` -disableComponentPopups `optionVar -q disableComponentPopups` -preSelectHilite `optionVar -q preSelectHilite` -clickBoxSize `optionVar -q clickBoxSize` -manipClickBoxSize `optionVar -q manipClickBoxSize` -useDepth `optionVar -q selectPrefUseDepth` -autoUseDepth `optionVar -q selectPrefAutoUseDepth` -containerCentricSelection `optionVar -q containerCentricSelection` -autoSelectContainer `optionVar -q containerAutoSelectContainer` -trackSelectionOrder `optionVar -q TrackSelectionOrder` -selectTypeChangeAffectsActive `optionVar -q PreserveComponentSelections` -selectionChildHighlightMode `optionVar -q selectionChildHighlightMode` -preSelectSize `optionVar -q MT_preSelectSize` -preSelectDeadSpace `optionVar -q MT_selectDeadSpaceRange` -preSelectTweakDeadSpace `optionVar -q MT_tweakDeadSpaceRange` -preSelectBackfacing `optionVar -q selectPrefPreSelectBackfacing` -preSelectClosest `optionVar -q selectPrefPreSelectClosest` ; global string $gSelectPriorityMode; global int $gCustomSelPriority[]; global int $gCustomSelPriorityCount = 63; $gSelectPriorityMode = `optionVar -q selectPrefPriorityMode`; $gCustomSelPriority = `optionVar -q customSelectPriority`; selPriority $gSelectPriorityMode; // // Display // global int $gFastInteraction; $gFastInteraction = `optionVar -q fastInteraction`; displayLevelOfDetail -lod $gFastInteraction; displayPref -activeObjectPivots `optionVar -q activeObjectPivots`; displayPref -regionOfEffect `optionVar -q displayRegionOfEffect`; displayPref -shadeTemplates `optionVar -q shadeTemplates`; displayPref -displayGradient `optionVar -q "displayViewportGradient"`; if (`optionVar -exists ghostFrameStep`) { displayPref -ghostFrames `optionVar -q ghostFramesBefore` `optionVar -q ghostFramesAfter` `optionVar -q ghostFrameStep`; } if (`optionVar -exists maxTextureResolution`) { int $val = `optionVar -q maxTextureResolution`; displayPref -mtr $val; } if (`optionVar -exists lineWidth`) { float $val = `optionVar -q lineWidth`; displayPref -lineWidth $val; } int $state = `optionVar -q wireframeOnShadedActive`; if ( $state == 1 ) displayPref -wireframeOnShadedActive "full"; else if ( $state == 2 ) displayPref -wireframeOnShadedActive "reduced"; else if ( $state == 3 ) displayPref -wireframeOnShadedActive "none"; int $selectedMode = `optionVar -q materialLoadingMode`; if ( $selectedMode == 1 ) displayPref -materialLoadingMode "immediate"; else if ( $selectedMode == 2 ) displayPref -materialLoadingMode "deferred"; else if ( $selectedMode == 3 ) displayPref -materialLoadingMode "parallel"; $state = `optionVar -q enableSwatchRendering`; if (`optionVar -exists hypershadeSwatchPauseButtonState`) { $state = $state && `optionVar -q hypershadeSwatchPauseButtonState`; } renderThumbnailUpdate $state; source "generateUvTilePreview.mel"; scriptJob -permanent -event "PostSceneRead" "generateUvTilePreviewsPostSceneReadCB"; global string $gPreviousWorkingUnitLinear; global float $gGridSpacingDefault; global float $gGridDivisionsDefault; global float $gGridSizeDefault; optionVar -iv enableRealWorldSize (`getenv "MAYA_REAL_WORLD_SIZE"` != ""); if ( `optionVar -q enableRealWorldSize` ) { $gGridSpacingDefault = 100.0; $gGridDivisionsDefault = 5.0; $gGridSizeDefault = 500.0; } else { $gGridSpacingDefault = 5.0; $gGridDivisionsDefault = 5.0; $gGridSizeDefault = 12.0; } global int $gGridDisplayAxesDefault = true; global int $gGridDisplayGridLinesDefault = true; global int $gGridDisplayDivisionLinesDefault = true; global int $gGridDisplayGridPerspLabelsDefault = false; global int $gGridDisplayGridOrthoLabelsDefault = false; global int $gGridDisplayAxesAccentedDefault = true; global string $gGridDisplayPerspLabelPositionDefault = "axis"; global string $gGridDisplayOrthoLabelPositionDefault = "edge"; grid -default -spacing $gGridSpacingDefault -divisions $gGridDivisionsDefault -size $gGridSizeDefault -displayAxes $gGridDisplayAxesDefault -displayGridLines $gGridDisplayGridLinesDefault -displayDivisionLines $gGridDisplayDivisionLinesDefault -displayPerspectiveLabels $gGridDisplayGridPerspLabelsDefault -displayOrthographicLabels $gGridDisplayGridOrthoLabelsDefault -displayAxesBold $gGridDisplayAxesAccentedDefault -perspectiveLabelPosition $gGridDisplayPerspLabelPositionDefault -orthographicLabelPosition $gGridDisplayOrthoLabelPositionDefault ; if( !`optionVar -exists gridSpacing`) { // If there is no preference file: // // set to the linearUnit before start. // currentUnit -l $gPreviousWorkingUnitLinear; // get the spacing under the previous workingUnitLinear. // optionVar -floatValue gridSpacing $gGridSpacingDefault -floatValue gridDivisions $gGridDivisionsDefault -floatValue gridSize $gGridSizeDefault ; // reset the linearUnit. // currentUnit -l `optionVar -q workingUnitLinear`; } // New grid display option variables for Maya 4.0. Don't include them // with the default initialization of the previous grid variable like // size and division because they may exist in previous pref versions // but these new variables will not. // if (!`optionVar -exists displayGridAxes`) { optionVar -intValue displayGridAxes $gGridDisplayAxesDefault -intValue displayGridLines $gGridDisplayGridLinesDefault -intValue displayDivisionLines $gGridDisplayDivisionLinesDefault -intValue displayPerspGridLabels $gGridDisplayGridPerspLabelsDefault -intValue displayOrthoGridLabels $gGridDisplayGridOrthoLabelsDefault -intValue displayGridAxesAccented $gGridDisplayAxesAccentedDefault ; } if (!`optionVar -exists displayGridPerspLabelPosition`) { optionVar -stringValue displayGridPerspLabelPosition $gGridDisplayPerspLabelPositionDefault -stringValue displayGridOrthoLabelPosition $gGridDisplayOrthoLabelPositionDefault ; } // set the spacing under the current working unit linear // grid -toggle `optionVar -query showGrid` -spacing `optionVar -query gridSpacing` -divisions `optionVar -query gridDivisions` -size `optionVar -query gridSize` -displayAxes `optionVar -query displayGridAxes` -displayGridLines `optionVar -query displayGridLines` -displayDivisionLines `optionVar -query displayDivisionLines` -displayPerspectiveLabels `optionVar -query displayGridPerspLabels` -displayOrthographicLabels `optionVar -query displayGridOrthoLabels` -displayAxesBold `optionVar -query displayGridAxesAccented` -perspectiveLabelPosition `optionVar -query displayGridPerspLabelPosition` -orthographicLabelPosition `optionVar -query displayGridOrthoLabelPosition` ; toggle -nc -ep -state `optionVar -q newCurveDisplayEP`; toggle -nc -hull -state `optionVar -q newCurveDisplayHull`; toggle -nc -cv -state `optionVar -q newCurveDisplayCV`; toggle -ns -ep -state `optionVar -q newSurfaceDisplayEP`; toggle -ns -hull -state `optionVar -q newSurfaceDisplayHull`; toggle -ns -cv -state `optionVar -q newSurfaceDisplayCV`; toggle -hpn -state `optionVar -q highPrecisionNurbs`; displaySmoothness -dc -du `optionVar -q newNurbsIsoparms`; displaySmoothness -dc -pw `optionVar -q newNurbsPointsWire`; displaySmoothness -dc -ps `optionVar -q newNurbsPointsShaded`; if (`isTrue "PolygonsExists"`) { polyOptions -newPolymesh -vertexNormalMethod (`optionVar -q newPolyDefaultVertexNormalMethod`); polyOptions -np -dv `optionVar -q newPolyVtxDisp`; polyOptions -np -bcv `optionVar -q newPolyVtxBackCull`; if( `optionVar -q newPolyVertexNormals`) if(`optionVar -q newPolyFacetNormalDisp`) polyOptions -np -dn 1 -pf; else polyOptions -np -dn 1 -pt; else if(`optionVar -q newPolyFacetNormalDisp`) polyOptions -np -dn 1 -f; else polyOptions -np -dn 0 -f; $state = `optionVar -q newPolyEdgeDisp`; if( $state == 0 ) polyOptions -np -ae; else if( $state == 1 ) polyOptions -np -se; else if( $state == 2 ) polyOptions -np -he; polyOptions -np -sb `optionVar -q newPolyBorderEdgeSize`; polyOptions -np -db `optionVar -q newPolyBorderEdgeHilite`; polyOptions -np -dmb `optionVar -q newPolyBorderMapHilite`; polyOptions -np -dce `optionVar -q newPolyCreaseEdgeHilite`; polyOptions -np -dcv `optionVar -q newPolyCreaseVertexHilite`; polyOptions -np -sv `optionVar -q newPolyVertexSize`; polyOptions -np -sn `optionVar -q newPolyNormalSize`; polyOptions -np -suv `optionVar -q newPolyUVSize`; polyOptions -np -dc `optionVar -q newPolyFacetCentreDisp`; polyOptions -np -dt `optionVar -q newPolyFacetTrngleDisp`; polyOptions -np -dw `optionVar -q newPolyFacetWarpDisp`; polyOptions -np -dif `optionVar -q newPolyHoleFacesHilite`; polyOptions -np -din `optionVar -q newPolyNumVertexDisp` `optionVar -q newPolyNumEdgeDisp` `optionVar -q newPolyNumFacetDisp` `optionVar -q newPolyNumUvDisp`; $state = `optionVar -q newPolyBackFaceCull`; if( $state == 0 ) polyOptions -np -bc; else if( $state == 1 ) polyOptions -np -fb; else if( $state == 2 ) polyOptions -np -wbc; else if( $state == 3 ) polyOptions -np -hb; polyOptions -np -cs `optionVar -q newPolyColorShaded`; string $colorChannelStrings[] = {"none", "ambient", "ambientDiffuse", "diffuse", "specular", "emission"}; int $channel = `optionVar -q newPolyColorChannel`; if ($channel > 0 && $channel <= size($colorChannelStrings) ) polyOptions -np -cm $colorChannelStrings[$channel -1]; else polyOptions -np -cm "diffuse"; string $materialBlendStrings[] = {"overwrite", "add", "subtract", "multiply", "divide", "average", "modulate2x" }; int $blend = `optionVar -q newPolyMaterialBlend`; if ($blend > 0 && $blend <= size($materialBlendStrings) ) polyOptions -np -mb $materialBlendStrings[$blend -1]; else polyOptions -np -mb "overwrite"; } // Subdivs // subdDisplayMode -showComponentsAsNumerals `optionVar -q subdivComponentDisplayStyle`; // Fonts if( `optionVar -exists fontSetOpt` ) { displayPref -fm `optionVar -query fontSetOpt`; } else { optionVar -iv fontSetOpt `displayPref -q -fm`; } if( `optionVar -exists smallFontSize` ) { displayPref -sfs `optionVar -query smallFontSize`; } else { optionVar -iv smallFontSize `displayPref -q -sfs`; } if( `optionVar -exists defaultFontSize` ) { displayPref -dfs `optionVar -query defaultFontSize`; } else { optionVar -iv defaultFontSize `displayPref -q -dfs`; } // // Manipulators // global int $gRefreshMode; $gRefreshMode = `optionVar -q refreshMode`; manipOptions -refreshMode $gRefreshMode -scale `optionVar -q manipGlobalScale` -handleSize `optionVar -q manipHandleSize` -lineSize `optionVar -q manipLineSize` -linePick `optionVar -q manipLinePickSize` -pointSize `optionVar -q manipPreviousStateSize`; animDisplay -modelUpdate interactive; switch ($gRefreshMode) { case 0: // Normal animDisplay -modelUpdate interactive; break; case 1: // On Release animDisplay -modelUpdate delayed; break; case 2: // On Force animDisplay -modelUpdate none; break; } // Performance settings. // // Valid defaults are "0", "1", and "interactive". // string $kDefaultStitchSurfaces = "0"; string $kDefaultTrimDisplay = "0"; string $kDefaultLattices = "0"; string $kDefaultLatticeResolution = "0"; // // Valid defaults are 0.0, 0.01, 0.05, and 0.1. // See performanceSettingsWin.mel for more info. // float $kDefaultGlobalLatticeResolution = 0.01; // If the performance setting preference doesn't exist then // create it and set to the default values. // if (!`optionVar -exists performanceSettingStitchSurfaces`) { optionVar -stringValue performanceSettingStitchSurfaces $kDefaultStitchSurfaces; } performanceOptions -disableStitch `optionVar -query performanceSettingStitchSurfaces`; if (!`optionVar -exists performanceSettingTrimDisplay`) { optionVar -stringValue performanceSettingTrimDisplay $kDefaultTrimDisplay; } performanceOptions -disableTrimDisplay `optionVar -query performanceSettingTrimDisplay`; if (!`optionVar -exists performanceSettingLattices`) { optionVar -stringValue performanceSettingLattices $kDefaultLattices; } performanceOptions -passThroughLattice `optionVar -query performanceSettingLattices`; if (!`optionVar -exists performanceSettingLatticeResolution`) { optionVar -stringValue performanceSettingLatticeResolution $kDefaultLatticeResolution; } performanceOptions -useLatticeResolution `optionVar -query performanceSettingLatticeResolution`; if (!`optionVar -exists performanceSettingGlobalLatticeResolution`) { optionVar -floatValue performanceSettingGlobalLatticeResolution $kDefaultGlobalLatticeResolution; } performanceOptions -latticeResolution `optionVar -query performanceSettingGlobalLatticeResolution`; // More performance settings. Notice that these are only valid // in the Complete version of Maya. // if (`licenseCheck -mode "edit" -type "complete"`) { // Valid defaults are "0", "1", and "interactive". // string $kDefaultBlendShapes = "0"; string $kDefaultFlexors = "0"; string $kDefaultBindSkinAndFlexors = "0"; string $kDefaultSculpts = "0"; string $kDefaultWires = "0"; string $kDefaultClusters = "0"; string $kDefaultClusterResolution = "0"; // // Valid defaults are 0.0, 1.0, 5.0, or 10.0. // See performanceSettingsWin.mel for more info. // float $kDefaultGlobalClusterResolution = 5.0; // If the performance setting preference doesn't exist then // create it and set to the default values. // if (!`optionVar -exists performanceSettingBlendShapes`) { optionVar -stringValue performanceSettingBlendShapes $kDefaultBlendShapes; } performanceOptions -passThroughBlendShape `optionVar -query performanceSettingBlendShapes`; if (!`optionVar -exists performanceSettingFlexors`) { optionVar -stringValue performanceSettingFlexors $kDefaultFlexors; } performanceOptions -passThroughFlexors `optionVar -query performanceSettingFlexors`; if (!`optionVar -exists performanceSettingBindSkinAndFlexors`) { optionVar -stringValue performanceSettingBindSkinAndFlexors $kDefaultBindSkinAndFlexors; } performanceOptions -passThroughBindSkinAndFlexors `optionVar -query performanceSettingBindSkinAndFlexors`; if (!`optionVar -exists performanceSettingSculpts`) { optionVar -stringValue performanceSettingSculpts $kDefaultSculpts; } performanceOptions -passThroughSculpt `optionVar -query performanceSettingSculpts`; if (!`optionVar -exists performanceSettingWires`) { optionVar -stringValue performanceSettingWires $kDefaultWires; } performanceOptions -passThroughWire `optionVar -query performanceSettingWires`; if (!`optionVar -exists performanceSettingClusters`) { optionVar -stringValue performanceSettingClusters $kDefaultClusters; } performanceOptions -passThroughCluster `optionVar -query performanceSettingClusters`; if (!`optionVar -exists performanceSettingClusterResolution`) { optionVar -stringValue performanceSettingClusterResolution $kDefaultClusterResolution; } performanceOptions -useClusterResolution `optionVar -query performanceSettingClusterResolution`; if (!`optionVar -exists performanceSettingGlobalClusterResolution`) { optionVar -floatValue performanceSettingGlobalClusterResolution $kDefaultGlobalClusterResolution; } performanceOptions -clusterResolution `optionVar -query performanceSettingGlobalClusterResolution`; } // // Paint Effects // if(`isTrue MayaCreatorExists`) { string $kDefaultPaintEffects = "0"; if (!`optionVar -exists performanceSettingPaintEffects`) { optionVar -stringValue performanceSettingPaintEffects $kDefaultPaintEffects; } performanceOptions -passThroughPaintEffects `optionVar -query performanceSettingPaintEffects`; } // // Modelling // tolerance -l `optionVar -q positionalTolerance` -a `optionVar -q tangentialTolerance`; // This line is causing the preferences to not be shown // correctly in the pref window when the kin UI is not // loaded by default. See bug#81262 among others. // if (`isTrue "KinematicsUIExists"`) { jointDisplayScale `optionVar -q ikJointDisplayScale`; jointDisplayScale -ikfk `optionVar -q ikIkFkJointDisplayScale`; ikHandleDisplayScale `optionVar -q ikHandleDisplayScale`; ikfkDisplayMethod -display `optionVar -q ikIkFkDisplayMethod`; } // // Initialize the filter UI. // source filterUI.mel; // // Initialize the help. // source "initHelp.mel";