-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAYA-104219 - Rename 'Create Stage from Existing Layer' #413
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change from design |
||
-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"; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change from design |
||
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,30 +51,30 @@ 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; | ||
textFieldGrp -e -text $exppath excludePrimPathField; | ||
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change from design |
||
-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"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change from design |
||
|
||
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change from design |
||
-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]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change from design