// =========================================================================== // 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: March 10, 1999 // // // Description: // Converts version 1.91 preferences to version 1.92. // - check for old Set Editor and replace with Relationship Editor. // // - add new Hypershade and Visor panel configurations if they are not // already present. // // { string $panelConfig, $panelConfigs[] = `getPanel -allConfigs`; int $panelIndex; int $found = false; // // Check for Hypershade panel configs. Due to a previous error there may // be multiple copies. Remove all copies and then add in properly. // for ($panelConfig in $panelConfigs) { string $configLabel = `panelConfiguration -q -l $panelConfig`; if ("" != `match "Hypershade" $configLabel`) { deleteUI -panelConfig $panelConfig; } } // // Add new panel configs. // panelConfiguration //UI strings for versions of Maya earlier than 8.5 should remain unlocalized. -label "Persp/Hypershade/Render" -sc false -configString "global string $gMainPane;paneLayout -e -cn \"bottom3\" -ps 1 100 55 -ps 2 50 45 -ps 3 50 45 $gMainPane;" -ap true "Persp View" "modelPanel" ("{global int $gUseMenusInPanels;\ modelPanel -mbv $gUseMenusInPanels\ -unParent -l \"Persp View\" -cam `findStartUpCamera persp`;}" ) "modelPanel -edit -l \"Persp View\" -cam `findStartUpCamera persp` $panelName" -ap false "Hypershade" "scriptedPanel" ("{global int $gUseMenusInPanels;\ scriptedPanel -mbv $gUseMenusInPanels -type hyperShadePanel\ -unParent -l \"Hypershade\";}" ) "scriptedPanel -edit -l \"Hypershade\" $panelName" -ap false "Render View" "scriptedPanel" ("{global int $gUseMenusInPanels;\ scriptedPanel -mbv $gUseMenusInPanels -type renderWindowPanel\ -unParent -l \"Render View\";}" ) "scriptedPanel -edit -l \"Render View\" $panelName" panelConfiguration7_1; panelConfiguration -label "Persp/Hypershade/Outliner" -sc false -configString "global string $gMainPane;paneLayout -e -cn \"bottom3\" -ps 1 100 55 -ps 2 50 45 -ps 3 50 45 $gMainPane;" -ap true "Persp View" "modelPanel" ("{global int $gUseMenusInPanels;\ modelPanel -mbv $gUseMenusInPanels\ -unParent -l \"Persp View\" -cam `findStartUpCamera persp`;}" ) "modelPanel -edit -l \"Persp View\" -cam `findStartUpCamera persp` $panelName" -ap false "Hypershade" "scriptedPanel" ("{global int $gUseMenusInPanels;\ scriptedPanel -mbv $gUseMenusInPanels -type hyperShadePanel\ -unParent -l \"Hypershade\";}" ) "scriptedPanel -edit -l \"Hypershade\" $panelName" -ap false "Outliner" "outlinerPanel" ("{global int $gUseMenusInPanels;\ $panelName = `outlinerPanel -mbv $gUseMenusInPanels -unParent -l \"Outliner\"`;\ outlinerEditor -e -highlightActive true $panelName;}") "outlinerPanel -edit -l \"Outliner\" $panelName" panelConfiguration7_2; panelConfiguration -label "Persp/Hypershade" -sc false -configString "global string $gMainPane;paneLayout -e -cn \"vertical2\" -ps 1 39 100 -ps 2 61 100 $gMainPane;" -ap false "Hypershade" "scriptedPanel" ("{global int $gUseMenusInPanels;\ scriptedPanel -mbv $gUseMenusInPanels -type hyperShadePanel\ -unParent -l \"Hypershade\";}" ) "scriptedPanel -edit -l \"Hypershade\" $panelName" -ap true "Persp View" "modelPanel" ("{global int $gUseMenusInPanels;\ modelPanel -mbv $gUseMenusInPanels\ -unParent -l \"Persp View\" -cam `findStartUpCamera persp`;}" ) "modelPanel -edit -l \"Persp View\" -cam `findStartUpCamera persp` $panelName" panelConfiguration7_3; // // Check all the panel configurations for Set Editors and Shading Group // Editors. These editors don't exist in Maya 2.0. The following code // will replace them with the new Relationship Editor. // $panelConfigs = `getPanel -allConfigs`; for ($panelConfig in $panelConfigs) { // // Replace Set Editor with a Relationship Editor. // $panelIndex = findPanelInConfiguration($panelConfig, "setEditor"); if (0 <= $panelIndex) { warning ("The panel configuration '" + `panelConfiguration -query -label $panelConfig` + "' has a Set Editor in it. This editor is replaced by " + "the Relationship Editor in Maya 2.0."); panelConfiguration -edit -replacePanel ($panelIndex + 1) false "Relationship Editor" "scriptedPanel" "{global int $gUseMenusInPanels;\ scriptedPanel -mbv $gUseMenusInPanels -type relationshipPanel\ -unParent -l \"Relationship Editor\";}" "scriptedPanel -edit -l \"Relationship Editor\" $panelName" $panelConfig; } // // Replace Shading Group Editor with a Relationship Editor. // $panelIndex = findPanelInConfiguration($panelConfig, "shadingGroupEditor"); if (0 <= $panelIndex) { warning ("The panel configuration '" + `panelConfiguration -query -label $panelConfig` + "' has a Shading Group Editor in it. This editor is " + "replaced by the Relationship Editor in Maya 2.0."); panelConfiguration -edit -replacePanel ($panelIndex + 1) false "Relationship Editor" "scriptedPanel" "{global int $gUseMenusInPanels;\ scriptedPanel -mbv $gUseMenusInPanels -type relationshipPanel\ -unParent -l \"Relationship Editor\";}" "scriptedPanel -edit -l \"Relationship Editor\" $panelName" $panelConfig; } } // // Replace old icon names with new icon names. // string $contexts[] = {"setEditPaintContext", "attrPaintContext", "skinPaintContext", "polyClrVertPaintContext" }; string $oldIcons[] = {"wtPaint.png", "userPaint.png", "userPaint.png", "userPaint.png" }; string $newIcons[] = {"paintSetMembership.png", "attrPaint.png", "paintSkinWeights.png", "paintVertexColour.png" }; string $optionStr, $newOptionStr; int $i,$nArr = size ($contexts); for ($i = 0; $i < $nArr; $i++) { if (`optionVar -exists $contexts[$i]`) { $optionStr = `optionVar -q $contexts[$i]`; $newOptionStr = `substitute $oldIcons[$i] $optionStr $newIcons[$i]`; optionVar -sv $contexts[$i] $newOptionStr; } } }