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-121625: cache to USD: take out 'Parent Scope' from options #2122

Merged

Conversation

seando-adsk
Copy link
Collaborator

MAYA-121625: cache to USD: take out 'Parent Scope' from options

  • Used patter for sub-option to remove the Parent Scope field from the Cache To Usd.

* Used patter for sub-option to remove the Parent Scope field
  from the Cache To Usd.
@seando-adsk seando-adsk requested a review from ppt-adsk February 18, 2022 16:16
ppt-adsk
ppt-adsk previously approved these changes Feb 18, 2022
@@ -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()))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Used constant so we have same string for both post and query.

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

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"

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

Choose a reason for hiding this comment

The 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).

Comment on lines +165 to +167
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");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed typo in name

Comment on lines +539 to +544
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;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added ability to not add this parent scope field.

@seando-adsk seando-adsk added the workflows Related to in-context workflows label Feb 18, 2022
@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 22, 2022
@seando-adsk seando-adsk merged commit 7873446 into dev Feb 22, 2022
@seando-adsk seando-adsk deleted the donnels/MAYA-121625/remove_parent_scope_from_cachetousd branch February 22, 2022 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants