-
Notifications
You must be signed in to change notification settings - Fork 203
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-103673 update Create USD Stage menu #317
MAYA-103673 update Create USD Stage menu #317
Conversation
Adding optionVars to store Create USD Stage options Adding a proper Option Box menu item.
-category "Menu items.Maya USD" | ||
-command "mayaUsd_createStagesFromExistingLayerOptions" | ||
mayaUsdCreateStageFromExistingLayerOptions; | ||
} |
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.
Creating a runtime command + menu to open the Option Box .
global string $stageFromExistingLayer_primPath = ""; | ||
global string $stageFromExistingLayer_excludePrimPath = ""; | ||
global int $stageFromExistingLayer_loadPayloads = 1; | ||
proc setOptionVars (int $forceFactorySettings) |
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.
Changing all of the global variables to optionVar's so they persist.
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.
This proc can be called either to init the variables or reset them depending on the forceFactorySettings param.
setParent $parent; | ||
$parent = `scrollLayout -childResizable true`; | ||
string $layout = `scrollLayout -childResizable true`; | ||
|
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.
Just changing the name of the variable instead of overwriting the one that is passed in because it looks a little cleaner.
|
||
frameLayout -label "USD Layer Options"; | ||
frameLayout -label "USD Layer Options" -collapsable false; | ||
textFieldGrp -l "Prim Path:" |
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.
Options are minimal right now and having it be collapsible looks weird for now.
@@ -36,31 +47,35 @@ global proc stageFromExistingLayer_UISetup(string $parent) { | |||
-ann "When on, loads all prims marked as payloads. When off, all prims marked as payloads and their children are not loaded." | |||
-sbm "Loads prims marked as payloads" | |||
loadPayloadsCheckBox; | |||
|
|||
return $layout; |
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 the proc to return the layout it's creating so that the option box can attach it correctly. When this same proc is called from the File Dialog UI it's handled a bit differently and doesn't need it.
connectAttr time1.outTime ($shapeNode+".time"); | ||
select -r $shapeNode; | ||
} | ||
|
||
global proc createUSdStagesFromExistingCallback(string $parent, int $doIt) | ||
{ |
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.
This is standard option box code... Maya can call this proc to just store the current settings (Save and Close), or store it and execute the operation.
@@ -92,14 +187,10 @@ global proc mayaUsd_createStagesFromExistingLayer() { | |||
-okCaption "Create" | |||
-optionsUICreate "stageFromExistingLayer_UISetup" | |||
-optionsUIInit "stageFromExistingLayer_UIInit" | |||
-optionsUICommit2 "stageFromExistingLayer_UICommit"`; | |||
-optionsUICommit "stageFromExistingLayer_UICommit"`; |
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.
We didn't need the "2" version of this flag since that's the one you use when you need the selected file. We don't actually use this yet, and some of the code was going to be calling it with bogus empty strings, so I changed back to the flag that matches the behaviour for now since it's a bit more clear.
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.
Looks good to me! Just some tiny cosmetic notes.
global int $gOptionBoxTemplateFrameSpacing; | ||
|
||
setOptionVars(false); | ||
|
||
string $commandName = "createUSdStagesFromExisting"; | ||
string $callback = ($commandName + "Callback"); |
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.
Looks like some inconsistent whitespacing through here.
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.
Yeah, looks like I bounced between editors that had different settings for tabs/spaces. I'll clean it up.
connectAttr time1.outTime ($shapeNode+".time"); | ||
select -r $shapeNode; | ||
} | ||
|
||
global proc createUSdStagesFromExistingCallback(string $parent, int $doIt) |
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.
The USd
in the function name looks a little odd here and in the function below, and seems a little inconsistent with other functions in this file that just say createStage...
or whatever. Maybe just drop the "USd"?
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.
This is what happens when you type something by hand and then copy/paste it around. Also like removing the "USD" entirely to match other functions.
I cleaned up the white-space and got rid of the "USd" in those optionVar's. |
Adding optionVars to store Create USD Stage options
Adding a proper Option Box menu item.