Skip to content
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

Merged

Conversation

fowlertADSK
Copy link
Contributor

Adding optionVars to store Create USD Stage options
Adding a proper Option Box menu item.

Adding optionVars to store Create USD Stage options
Adding a proper Option Box menu item.
-category "Menu items.Maya USD"
-command "mayaUsd_createStagesFromExistingLayerOptions"
mayaUsdCreateStageFromExistingLayerOptions;
}
Copy link
Contributor Author

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)
Copy link
Contributor Author

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.

Copy link
Contributor Author

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`;

Copy link
Contributor Author

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:"
Copy link
Contributor Author

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;
Copy link
Contributor Author

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)
{
Copy link
Contributor Author

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"`;
Copy link
Contributor Author

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.

Copy link
Contributor

@mattyjams mattyjams left a 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.

Comment on lines 122 to 127
global int $gOptionBoxTemplateFrameSpacing;

setOptionVars(false);

string $commandName = "createUSdStagesFromExisting";
string $callback = ($commandName + "Callback");
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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"?

Copy link
Contributor Author

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.

@kxl-adsk kxl-adsk added the do-not-merge-yet Development is not finished, PR not ready for merge label Feb 28, 2020
@fowlertADSK fowlertADSK removed the do-not-merge-yet Development is not finished, PR not ready for merge label Mar 2, 2020
@fowlertADSK
Copy link
Contributor Author

I cleaned up the white-space and got rid of the "USd" in those optionVar's.

@kxl-adsk kxl-adsk merged commit 0b42ea2 into dev Mar 2, 2020
@kxl-adsk kxl-adsk deleted the fowlert/MAYA-103673/update_create_stage_menu_and_options branch March 2, 2020 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants