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-104219 - Rename 'Create Stage from Existing Layer' #413

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/adsk/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ list(APPEND scripts_src
mayaUsdTranslatorExport.mel
AEmayaUsdProxyShapeTemplate.mel
mayaUsdMenu.mel
mayaUsd_createStagesFromExistingLayer.mel
mayaUsd_createStageFromFile.mel
)

install(FILES ${scripts_src}
Expand Down
24 changes: 12 additions & 12 deletions plugin/adsk/scripts/mayaUsdMenu.mel
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from design

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

Choose a reason for hiding this comment

The 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";
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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"
Expand All @@ -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`);
}

Expand All @@ -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;
Expand All @@ -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");

Expand All @@ -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
Expand All @@ -146,7 +146,7 @@ global proc mayaUsd_createStagesFromExistingLayerOptions()
$parent;

string $applyCloseBtn = getOptionBoxApplyAndCloseBtn();
button -edit -label "Create Stages"
button -edit -label "Create Stage"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from design

-command ($callback + " " + $parent + " " + 1 + "; hideOptionBox;")
$applyCloseBtn;

Expand All @@ -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");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from design


setOptionBoxHelpTag( "" );

Expand All @@ -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"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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]);
Expand Down