// =========================================================================== // 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. // =========================================================================== // // Description: // // This script, when sourced, converts version 5.01 prefs to // version 2016 prefs. { // In 2016 the syntax of the font name name in the textCurvesFont // optionVar changed, making the old names meaningless. So if that // optionVar exists, delete it. It will be reset to the appropriate // default the next time Maya needs it. // if (`optionVar -ex textCurvesFont`) { optionVar -rm textCurvesFont; } // In 2016, UV Texture Editor was renamed as UV Editor. // We need to rename a panel configs and update the // pref newScenePaneConfiguration if it was set to Persp/UV Texture Editor string $panelConfigArray[] = `getPanel -allConfigs`; int $i; for ($i = 0; $i < size($panelConfigArray); $i++) { string $configLabel = `panelConfiguration -query -label $panelConfigArray[$i]`; if ($configLabel == "Persp/UV Texture Editor") { // Rename the layout // panelConfiguration -edit //UI strings for versions of Maya earlier than 8.5 should remain unlocalized. -label "Persp/UV Editor" $panelConfigArray[$i]; } string $panelLabels[] = `panelConfiguration -query -labelStrings $panelConfigArray[$i]`; int $panel; for ($panel = 0; $panel < size($panelLabels); $panel++) { if ($panelLabels[$panel] == "UV Texture Editor") { panelConfiguration -edit -replaceLabel $panel "UV Editor" $panelConfigArray[$i]; } } } // we also need to change one perf - newScenePanelConfiguration // if this pref is set to "Persp/UV Texture Editor" in pre-2015, it will fail to load // we need to handle this case // if(`optionVar -q "newScenePanelConfiguration"` == "Persp/UV Texture Editor") { optionVar -sv "newScenePanelConfiguration" "Persp/UV Editor"; } }