From cf14a607fccc3d72568fa229c2cec2c7020d2e07 Mon Sep 17 00:00:00 2001 From: Sean Donnelly <23455376+seando-adsk@users.noreply.github.com> Date: Wed, 8 Apr 2020 16:34:41 -0400 Subject: [PATCH] MAYA-104219 - Change 'Create Stage from Existing Layer' to 'Create Stage from File' * Renamed menu/options/etc according to request from design. * Renamed everything else (runtimecommands/procs/file/etc) to be consistent. --- plugin/adsk/scripts/CMakeLists.txt | 2 +- plugin/adsk/scripts/mayaUsdMenu.mel | 24 +++--- ...er.mel => mayaUsd_createStageFromFile.mel} | 84 +++++++++---------- 3 files changed, 55 insertions(+), 55 deletions(-) rename plugin/adsk/scripts/{mayaUsd_createStagesFromExistingLayer.mel => mayaUsd_createStageFromFile.mel} (62%) diff --git a/plugin/adsk/scripts/CMakeLists.txt b/plugin/adsk/scripts/CMakeLists.txt index 2556b36a90..6ea3ee91eb 100644 --- a/plugin/adsk/scripts/CMakeLists.txt +++ b/plugin/adsk/scripts/CMakeLists.txt @@ -3,7 +3,7 @@ list(APPEND scripts_src mayaUsdTranslatorExport.mel AEmayaUsdProxyShapeTemplate.mel mayaUsdMenu.mel - mayaUsd_createStagesFromExistingLayer.mel + mayaUsd_createStageFromFile.mel ) install(FILES ${scripts_src} diff --git a/plugin/adsk/scripts/mayaUsdMenu.mel b/plugin/adsk/scripts/mayaUsdMenu.mel index a6feb01573..2bf2d7e7ca 100644 --- a/plugin/adsk/scripts/mayaUsdMenu.mel +++ b/plugin/adsk/scripts/mayaUsdMenu.mel @@ -58,24 +58,24 @@ proc removeMenuCallback(string $menuName, string $cmd) { // initRuntimeCommands // create all the runtime commands we'll use and the user can map to hotkeys proc initRuntimeCommands() { - if (!`runTimeCommand -exists mayaUsdCreateStageFromExistingLayer`) { + if (!`runTimeCommand -exists mayaUsdCreateStageFromFile`) { runTimeCommand -default true - -label "Stage From Existing Layer..." - -annotation "Create a USD Stage from an existing USD layer" + -label "Stage From File..." + -annotation "Create a USD Stage from an existing USD file" -category "Menu items.Maya USD" - -command "mayaUsd_createStagesFromExistingLayer" - mayaUsdCreateStageFromExistingLayer; + -command "mayaUsd_createStageFromFile" + mayaUsdCreateStageFromFile; } - if (!`runTimeCommand -exists mayaUsdCreateStageFromExistingLayerOptions`) { + if (!`runTimeCommand -exists mayaUsdCreateStageFromFileOptions`) { runTimeCommand -default true - -annotation "Create a USD Stage from an existing USD layer options" + -annotation "Create a USD Stage from an existing USD file options" -category "Menu items.Maya USD" - -command "mayaUsd_createStagesFromExistingLayerOptions" - mayaUsdCreateStageFromExistingLayerOptions; + -command "mayaUsd_createStageFromFileOptions" + mayaUsdCreateStageFromFileOptions; } - source "mayaUsd_createStagesFromExistingLayer.mel"; + source "mayaUsd_createStageFromFile.mel"; } /////////////////////////////////////////////////////////////////////////////// @@ -103,8 +103,8 @@ global proc mayaUsdMenu_createMenuCallback() { -label "Universal Scene Description (USD)" -annotation "Create a USD stage" -version $mayaVersion`; - menuItem -runTimeCommand mayaUsdCreateStageFromExistingLayer; - menuItem -runTimeCommand mayaUsdCreateStageFromExistingLayerOptions -optionBox true; + menuItem -runTimeCommand mayaUsdCreateStageFromFile; + menuItem -runTimeCommand mayaUsdCreateStageFromFileOptions -optionBox true; } else { error "Could not create mayaUSD create menu"; } diff --git a/plugin/adsk/scripts/mayaUsd_createStagesFromExistingLayer.mel b/plugin/adsk/scripts/mayaUsd_createStageFromFile.mel similarity index 62% rename from plugin/adsk/scripts/mayaUsd_createStagesFromExistingLayer.mel rename to plugin/adsk/scripts/mayaUsd_createStageFromFile.mel index 2ee988586d..ef82acab01 100644 --- a/plugin/adsk/scripts/mayaUsd_createStagesFromExistingLayer.mel +++ b/plugin/adsk/scripts/mayaUsd_createStageFromFile.mel @@ -13,28 +13,28 @@ // limitations under the License. // -proc setOptionVars (int $forceFactorySettings) +proc setOptionVars(int $forceFactorySettings) { - if ($forceFactorySettings || !`optionVar -exists stageFromExistingLayer_primPath`) { - optionVar -stringValue stageFromExistingLayer_primPath ""; + if ($forceFactorySettings || !`optionVar -exists stageFromFile_primPath`) { + optionVar -stringValue stageFromFile_primPath ""; } - if ($forceFactorySettings || !`optionVar -exists stageFromExistingLayer_excludePrimPath`) { - optionVar -stringValue stageFromExistingLayer_excludePrimPath ""; + if ($forceFactorySettings || !`optionVar -exists stageFromFile_excludePrimPath`) { + optionVar -stringValue stageFromFile_excludePrimPath ""; } - if ($forceFactorySettings || !`optionVar -exists stageFromExistingLayer_loadPayloads`) { - optionVar -intValue stageFromExistingLayer_loadPayloads 1; + if ($forceFactorySettings || !`optionVar -exists stageFromFile_loadPayloads`) { + optionVar -intValue stageFromFile_loadPayloads 1; } } -// stageFromExistingLayer_UISetup -// creates the options of the stageFromExistingLayer dialog -global proc string stageFromExistingLayer_UISetup(string $parent) { +// stageFromFile_UISetup +// creates the options of the stageFromFile dialog +global proc string stageFromFile_UISetup(string $parent) { setParent $parent; string $layout = `scrollLayout -childResizable true`; - frameLayout -label "USD Layer Options" -collapsable false; + frameLayout -label "USD File Options" -collapsable false; textFieldGrp -l "Prim Path:" -ann "Loads the specified prim path. If a matching prim path is not found, all prims in the file are loaded." -sbm "Loads the specified prim path" @@ -51,14 +51,14 @@ global proc string stageFromExistingLayer_UISetup(string $parent) { return $layout; } -// stageFromExistingLayer_UIInit -// init defaults values for the options of the stageFromExistingLayer dialog -global proc stageFromExistingLayer_UIInit(string $parent, string $filterType) { +// stageFromFile_UIInit +// init defaults values for the options of the stageFromFile dialog +global proc stageFromFile_UIInit(string $parent, string $filterType) { setOptionVars(false); - string $ppath = `optionVar -q stageFromExistingLayer_primPath`; - string $exppath = `optionVar -q stageFromExistingLayer_excludePrimPath`; - int $loadp = `optionVar -q stageFromExistingLayer_loadPayloads`; + string $ppath = `optionVar -q stageFromFile_primPath`; + string $exppath = `optionVar -q stageFromFile_excludePrimPath`; + int $loadp = `optionVar -q stageFromFile_loadPayloads`; setParent $parent; textFieldGrp -e -text $ppath primPathField; @@ -66,15 +66,15 @@ global proc stageFromExistingLayer_UIInit(string $parent, string $filterType) { checkBoxGrp -e -value1 $loadp loadPayloadsCheckBox; } -global proc stageFromExistingLayer_UICommit(string $parent) { +global proc stageFromFile_UICommit(string $parent) { setParent $parent; // fetch values - optionVar -stringValue stageFromExistingLayer_primPath + optionVar -stringValue stageFromFile_primPath (`textFieldGrp -q -text primPathField`); - optionVar -stringValue stageFromExistingLayer_excludePrimPath + optionVar -stringValue stageFromFile_excludePrimPath (`textFieldGrp -q -text excludePrimPathField`); - optionVar -intValue stageFromExistingLayer_loadPayloads + optionVar -intValue stageFromFile_loadPayloads (`checkBoxGrp -q -value1 loadPayloadsCheckBox`); } @@ -86,9 +86,9 @@ proc doCreateStage(string $fileName) { else $baseName = "UsdStage"; - string $ppath = `optionVar -q stageFromExistingLayer_primPath`; - string $exppath = `optionVar -q stageFromExistingLayer_excludePrimPath`; - int $loadp = `optionVar -q stageFromExistingLayer_loadPayloads`; + string $ppath = `optionVar -q stageFromFile_primPath`; + string $exppath = `optionVar -q stageFromFile_excludePrimPath`; + int $loadp = `optionVar -q stageFromFile_loadPayloads`; string $shapeNode = `createNode "mayaUsdProxyShape" -skipSelect -name ($baseName+"Shape")`; setAttr -type "string" ($shapeNode+".filePath") $fileName; @@ -99,31 +99,31 @@ proc doCreateStage(string $fileName) { select -r $shapeNode; } -global proc createStagesFromExistingCallback(string $parent, int $doIt) +global proc createStageFromExistingCallback(string $parent, int $doIt) { - stageFromExistingLayer_UICommit($parent); + stageFromFile_UICommit($parent); if ($doIt) { - mayaUsd_createStagesFromExistingLayer; - addToRecentCommandQueue "mayaUsd_createStagesFromExistingLayer" - "mayaUsdCreateStageFromExistingLayer"; + mayaUsd_createStageFromFile; + addToRecentCommandQueue "mayaUsd_createStageFromFile" + "mayaUsdCreateStageFromFile"; } } -global proc createStagesFromExistingSetup(string $parent, int $forceFactorySettings) +global proc createStageFromExistingSetup(string $parent, int $forceFactorySettings) { setOptionVars($forceFactorySettings); - stageFromExistingLayer_UIInit($parent, ""); + stageFromFile_UIInit($parent, ""); } -global proc mayaUsd_createStagesFromExistingLayerOptions() +global proc mayaUsd_createStageFromFileOptions() { global int $gOptionBoxTemplateFrameSpacing; setOptionVars(false); - string $commandName = "createStagesFromExisting"; + string $commandName = "createStageFromExisting"; string $callback = ($commandName + "Callback"); string $setup = ($commandName + "Setup"); @@ -134,9 +134,9 @@ global proc mayaUsd_createStagesFromExistingLayerOptions() setUITemplate -pushTemplate DefaultTemplate; - string $parent = `formLayout createStagesFromExistingOptions`; + string $parent = `formLayout createStageFromExistingOptions`; - string $settingsFrame = stageFromExistingLayer_UISetup($parent); + string $settingsFrame = stageFromFile_UISetup($parent); formLayout -e -af $settingsFrame "top" $gOptionBoxTemplateFrameSpacing @@ -146,7 +146,7 @@ global proc mayaUsd_createStagesFromExistingLayerOptions() $parent; string $applyCloseBtn = getOptionBoxApplyAndCloseBtn(); - button -edit -label "Create Stages" + button -edit -label "Create Stage" -command ($callback + " " + $parent + " " + 1 + "; hideOptionBox;") $applyCloseBtn; @@ -170,7 +170,7 @@ global proc mayaUsd_createStagesFromExistingLayerOptions() -command ($callback + " " + $parent + " " + 0) $saveBtn; - setOptionBoxTitle("Create USD Stage Options"); + setOptionBoxTitle("Create USD Stage from File Options"); setOptionBoxHelpTag( "" ); @@ -179,15 +179,15 @@ global proc mayaUsd_createStagesFromExistingLayerOptions() showOptionBox(); } -global proc mayaUsd_createStagesFromExistingLayer() { +global proc mayaUsd_createStageFromFile() { string $result[] = `fileDialog2 -fileMode 1 - -caption "Create USD Stage From Existing Layer" + -caption "Create USD Stage from File" -fileFilter "All USD Files (*.usd *.usda *.usdc *.usdz);;*.usd;;*.usda;;*.usdc;;*.usdz" -okCaption "Create" - -optionsUICreate "stageFromExistingLayer_UISetup" - -optionsUIInit "stageFromExistingLayer_UIInit" - -optionsUICommit "stageFromExistingLayer_UICommit"`; + -optionsUICreate "stageFromFile_UISetup" + -optionsUIInit "stageFromFile_UIInit" + -optionsUICommit "stageFromFile_UICommit"`; if (size($result) > 0) { doCreateStage($result[0]);