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

EMSUSD-1196 material scope as default prim #3801

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

Add the material scope name to the default-prim drop-down when meshes are off and materials are on.

Bug fixes and improvements:

  • Prune empty group at the start of the finish step of export to avoid using a prim that will be deleted as a root prim.
  • Don't add the default prim name as a parent of the material scope when the material scope is the default prim.
  • Add a Python helper to retrieve the default material scope name.
  • Remove unused default prim data member from UsdMayaPrimWriterArgs.
  • Refactor the parsing of encoded arguments to have the same behavior for import and export.
  • We now allow for empty argument values.

Change how no-default-prim is expressed

  • At the command level, passing "None" as the default prim flag now means no default prim.
  • OTOH, not passing the default prim flag or an empty string means to use the first root prim as the default prim.
  • When exporting, if the default prim is "None", then no default prim metadata is authored.
  • Make sure to also handle "None" for the name of the material scope.

Add unit tests.

Add the material scope name to the default-prim drop-down when meshes
are off and materials are on.

Bug fixes and improvements:
- Prune empty group at the start of the finish step of export to avoid
  using a prim that will be deleted as a root prim.
- Don't add the default prim name as a parent of the material scope when
  the material scope *is* the default prim.
- Add a Python helper to retrieve the default material scope name.
- Remove unused default prim data member from UsdMayaPrimWriterArgs.
- Refactor the parsing of encoded arguments to have the same behavior
  for import and export.
- We now allow for empty argument values.

Change how no-default-prim is expressed
- At the command level, passing "None" as the default prim flag now
  means no default prim.
- OTOH, not passing the default prim flag or an empty string means to
  use the first root prim as the default prim.
- When exporting, if the default prim is "None", then no default prim
  metadata is authored.
- Make sure to also handle "None" for the name of the material scope.

Add unit tests.
@@ -32,7 +32,6 @@ Each base command class is documented in the following sections.
| `-apiSchema` | `-api` | string (multi) | none | Imports the given API schemas' attributes as Maya custom attributes. This only recognizes API schemas that have been applied to prims on the stage. The attributes will properly round-trip if you re-export back to USD. |
| `-chaser` | `-chr` | string(multi) | none | Specify the import chasers to execute as part of the import. See "Import Chasers" below. |
| `-chaserArgs` | `-cha` | string[3] multi| none | Pass argument names and values to import chasers. Each argument to `-chaserArgs` should be a triple of the form: (`<chaser name>`, `<argument name>`, `<argument value>`). See "Import Chasers" below. |
| `-defaultPrim` | `-dp` | string | none | Set the default prim on export. |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The doc was in the import section instead of the export section.

@@ -41,8 +41,7 @@ class UsdMayaPrimWriterArgs
UsdMayaPrimWriterArgs(
const MDagPath& dagPath,
const bool exportRefsAsInstanceable,
const TfToken::Set& excludeExportTypes,
const std::string& defaultPrim);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The default prim was not used anywhere so I removed it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also checked and the _defaultPrim is private and isn't being used from anywhere. Good catch!

@@ -562,6 +562,18 @@ bool _MergeJobContexts(bool isExport, const VtDictionary& userArgs, VtDictionary
return canMergeContexts;
}

bool _GetEncodedArg(const MString& option, std::string& argName, MString& argValue)
{
Copy link
Collaborator Author

@pierrebai-adsk pierrebai-adsk Jun 3, 2024

Choose a reason for hiding this comment

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

Refactored common code shared between import and export job args.

@pierrebai-adsk pierrebai-adsk requested review from samuelliu-adsk and AramAzhari-adsk and removed request for samuelliu-adsk June 3, 2024 17:26
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 4, 2024
@seando-adsk seando-adsk added the import-export Related to Import and/or Export label Jun 4, 2024
@seando-adsk seando-adsk merged commit 5c9f571 into dev Jun 4, 2024
12 of 13 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-1196/material-scope-as-default-prim branch June 4, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants