-
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-121625: cache to USD: take out 'Parent Scope' from options #2122
Changes from 1 commit
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 |
---|---|---|
|
@@ -34,6 +34,9 @@ | |
# Cache options in string format, for MEL mayaUsdTranslatorExport() consumption. | ||
_cacheExportOptions = None | ||
|
||
# The options string that we pass to mayaUsdTranslatorExport. | ||
kTranslatorExportOptions = 'all;!output-parentscope;!animation-data' | ||
|
||
# Dag path corresponding to pulled prim. This is a Maya transform node that is | ||
# not in the Maya reference itself, but is its parent. | ||
_mayaRefDagPath = None | ||
|
@@ -181,7 +184,7 @@ def fileOptionsTabPage(tabLayout): | |
# USD file option controls will be parented under this layout. | ||
# resultCallback not called on "post", is therefore an empty string. | ||
fileOptionsScroll = cmds.columnLayout('fileOptionsScroll') | ||
mel.eval('mayaUsdTranslatorExport("fileOptionsScroll", "post=all;!animation-data", "' + getCacheExportOptions() + '", "")') | ||
mel.eval('mayaUsdTranslatorExport("fileOptionsScroll", "post={exportOpts}", "{cacheOpts}", "")'.format(exportOpts=kTranslatorExportOptions, cacheOpts=getCacheExportOptions())) | ||
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. Used constant so we have same string for both post and query. |
||
|
||
cacheFileUsdHierarchyOptions(topForm) | ||
|
||
|
@@ -241,7 +244,7 @@ def cacheCommitUi(parent, selectedFile): | |
|
||
# The following call will set _cacheExportOptions. Initial settings not | ||
# accessed on "query", is therefore an empty string. | ||
mel.eval('mayaUsdTranslatorExport("fileOptionsScroll", "query", "", "mayaUsdCacheMayaReference_setCacheOptions")') | ||
mel.eval('mayaUsdTranslatorExport("fileOptionsScroll", "query={exportOpts}", "", "mayaUsdCacheMayaReference_setCacheOptions")'.format(exportOpts=kTranslatorExportOptions)) | ||
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. Need the same option string for the query so you don't get back those options (like parent scope). |
||
|
||
primName = cmds.textFieldGrp('primNameText', query=True, text=True) | ||
payloadOrReference = cmds.optionMenuGrp('compositionArcTypeMenu', query=True, value=True) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,9 +162,9 @@ global proc mayaUSDRegisterStrings() | |
register("kExportMergeShapesLbl", "Merge Transform and\nShape Nodes:"); | ||
register("kExportNamespacesAnn", "By default, namespaces are exported to the USD file in the following format: nameSpaceExample_pPlatonic1"); | ||
register("kExportNamespacesLbl", "Include Namespaces:"); | ||
register("kExportParentScopAnn", "Name of the USD scope that is the parent of the exported data."); | ||
register("kExportParentScopLbl", "Create USD Parent Scope:"); | ||
register("kExportParentScopPht", "USD Prim Name"); | ||
register("kExportParentScopeAnn", "Name of the USD scope that is the parent of the exported data."); | ||
register("kExportParentScopeLbl", "Create USD Parent Scope:"); | ||
register("kExportParentScopePht", "USD Prim Name"); | ||
Comment on lines
+165
to
+167
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. Fixed typo in name |
||
register("kExportSkelsAnn", "Exports Maya joints as part of a USD skeleton."); | ||
register("kExportSkelsLbl", "Skeletons:"); | ||
register("kExportSkelsNoneLbl", "None"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,7 +310,9 @@ global proc mayaUsdTranslatorExport_EnableAllControls() { | |
|
||
if (stringArrayContains("output", $sectionNames)) { | ||
optionMenuGrp -e -en 1 defaultUSDFormatPopup; | ||
textFieldGrp -e -en 1 parentScopeField; | ||
if (stringArrayContains("output-parentscope", $sectionNames)) { | ||
textFieldGrp -e -en 1 parentScopeField; | ||
} | ||
} | ||
|
||
if (stringArrayContains("materials", $sectionNames)) { | ||
|
@@ -424,7 +426,7 @@ proc string[] parseActionSectionNames(string $sections) | |
{ | ||
global string $mayaUsdTranslatorExport_SectionNames[]; | ||
|
||
string $allSections[] = { "context", "output", "geometry", "materials", "animation", "animation-data", "advanced" }; | ||
string $allSections[] = { "context", "output", "output-parentscope", "geometry", "materials", "animation", "animation-data", "advanced" }; | ||
|
||
string $sectionList[]; | ||
tokenize($sections, ";", $sectionList); | ||
|
@@ -472,7 +474,7 @@ global proc int mayaUsdTranslatorExport (string $parent, | |
// | ||
// In addition to the action, the list of UI sections that are desired can be added | ||
// with the syntax "action=section1;section2;..." where the section names can be: | ||
// context, output, geometry, materials, animation, animation-data, advanced | ||
// context, output, output-parentscope, geometry, materials, animation, animation-data, advanced | ||
// | ||
// The section name can also be "all", "none" or prefixed with "!": | ||
// - When "all" is used, all sections are included. | ||
|
@@ -534,10 +536,12 @@ global proc int mayaUsdTranslatorExport (string $parent, | |
menuItem -l `getMayaUsdString("kExportDefaultFormatBinLbl")` -ann "usdc"; | ||
menuItem -l `getMayaUsdString("kExportDefaultFormatAscLbl")` -ann "usda"; | ||
|
||
separator -style "none"; | ||
if (stringArrayContains("output-parentscope", $sectionNames)) { | ||
separator -style "none"; | ||
|
||
textFieldGrp -l `getMayaUsdString("kExportParentScopLbl")` -placeholderText `getMayaUsdString("kExportParentScopPht")` | ||
-annotation `getMayaUsdString("kExportParentScopAnn")` parentScopeField; | ||
textFieldGrp -l `getMayaUsdString("kExportParentScopeLbl")` -placeholderText `getMayaUsdString("kExportParentScopePht")` | ||
-annotation `getMayaUsdString("kExportParentScopeAnn")` parentScopeField; | ||
} | ||
Comment on lines
+540
to
+545
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. Added ability to not add this parent scope field. |
||
|
||
separator -style "none"; | ||
setParent ..; | ||
|
@@ -681,7 +685,9 @@ global proc int mayaUsdTranslatorExport (string $parent, | |
|
||
if (stringArrayContains("output", $sectionNames)) { | ||
$currentOptions = mayaUsdTranslatorExport_AppendFromPopup($currentOptions, "defaultUSDFormat", "defaultUSDFormatPopup"); | ||
$currentOptions = mayaUsdTranslatorExport_AppendFromTextField($currentOptions, "parentScope", "parentScopeField"); | ||
if (stringArrayContains("output-parentscope", $sectionNames)) { | ||
$currentOptions = mayaUsdTranslatorExport_AppendFromTextField($currentOptions, "parentScope", "parentScopeField"); | ||
} | ||
} | ||
|
||
if (stringArrayContains("materials", $sectionNames)) { | ||
|
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.
Created constant for this string (used in 2 places) and added new string "output-parentscope"