// =========================================================================== // 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: December 6/2000 // // Description: // // This script, when sourced, converts version 2.83 or 3.00 prefs to // version 3.80 prefs. Primarily this involves making changes to any // saved panel configuration which contains a Hypershade. The conversion // is necessary because the Hypershade has been revised for Maya 4.0 and // the saved layouts which previously contained Hypershade panels are // no longer appropriate given that the Hypershade is now much more // vertical in aspect. // // In addition to changing panel configurations which contain a // Hypershade, we delete panel configurations which contain a Multilister // because we are trying to discourage people from using the Multilister // as we progress towards removing it from the product entirely. // { string $panelConfigArray[] = `getPanel -allConfigs`; string $currentLayout = `getPanel -configWithLabel "Current Layout"`; int $currentLayoutDeleted = false; int $i; for ($i = 0; $i < size($panelConfigArray); $i++) { string $label = `panelConfiguration -query -label $panelConfigArray[$i]`; string $createStringArray[] = `panelConfiguration -query -createStrings $panelConfigArray[$i]`; for ($j = 0; $j < size($createStringArray); $j++) { if (`gmatch $createStringArray[$j] "*hyperShadePanel*"`) { // This is a panel configuration which contains a // hyperShadePanel. We will modify the create string to get rid // of a lot of extra baggage which is no longer necessary. // string $createString = ("scriptedPanel -unParent -type \"hyperShadePanel\" " + "-l \"Hypershade\" -mbv $menusOkayInPanels;"); string $editString = ("scriptedPanel -edit -l \"Hypershade\" " + "-mbv $menusOkayInPanels $panelName;"); panelConfiguration -edit -replaceCreateString ($j + 1) $createString -replaceEditString ($j + 1) $editString $panelConfigArray[$i]; } } if ($label == "Hypershade/Render/Persp") { // Modify the arrangement and dimensions of the layout to suit the // new format of the hypershade. // panelConfiguration -edit -configString ("paneLayout -e -cn \"right3\" " + "-ps 1 50 100 " + "-ps 2 50 50 " + "-ps 3 50 50 $gMainPane;") $panelConfigArray[$i]; } else if ($label == "Hypershade/Outliner/Persp") { // Modify the arrangement and dimensions of the layout to suit the // new format of the hypershade. // panelConfiguration -edit -configString ("paneLayout -e -cn \"right3\" " + "-ps 1 55 100 " + "-ps 2 45 50 " + "-ps 3 45 50 $gMainPane;") $panelConfigArray[$i]; } else if ($label == "Hypershade/Persp") { // Modify the arrangement and dimensions of the layout to suit the // new format of the hypershade. // panelConfiguration -edit -configString ("paneLayout -e -cn \"vertical2\" " + "-ps 1 50 100 " + "-ps 2 50 100 $gMainPane;") $panelConfigArray[$i]; } else if ( ($label == "Persp/Multi/Render") || ($label == "Persp/Multi/Outliner") || ($label == "Persp/Multi")) { // The panel configuration is one of the A|W defined Multilister // configurations. We will delete the configuration because we are // trying to discourage people from using the Multilister so that // it may eventually be phased out entirely. // We do not delete user-defined layouts containing the // Multilister, however, as that might constitute data loss for the // customer. // if ($panelConfigArray[$i] == $currentLayout) { $currentLayoutDeleted = true; } deleteUI -panelConfig $panelConfigArray[$i]; } } if ($currentLayoutDeleted) { // What was previously the current layout has now been deleted. // We need to make a new current layout (which will be a single // perspective view). // panelConfiguration -l "Current Layout" -sc false -cfs "paneLayout -e -cn \"single\" $gMainPane" -ap false "Persp View" "modelPanel" ("{global int $gUseMenusInPanels;" + "modelPanel -mbv $gUseMenusInPanels " + "-unParent -l \"Perspective\" " + "-cam `findStartUpCamera persp`;}" ) ("modelPanel -e -l \"Perspective\" " + "-cam `findStartUpCamera persp` $panelName"); } }