Skip to content

Conversation

@pierrebai-adsk
Copy link
Collaborator

  • Add -upAxis (-upa) and -axisAndUnitMethod (-aum) flags to the base import command.
  • Document the new flags in the import command read-me file.
  • Add upAxis and axisAndUnitMethod tokens to the import job args tokens.
  • Add the rotateScale, addTransform and overwritePrefs tokens to the import job args token.
  • Add the upAxis and axisAndUnitMethod data to the UsdMayaJobImportArgs structure.
  • Handle parsing the new user args to build the UsdMayaJobImportArgs.
  • Expose the upAxis and axisAndUnitMethod data to Python.
  • Add the new UI related to upAxis and axisAndUnitMethod in the import UI.
  • Add documentation about how to add a new import or export option.

Implement import rotation

  • Add axis conversion helper to the UsdMaya_ReadJob class.
  • Determine the Maya up-axis and USD up-axis.
  • Do nothing if they match.
  • Do nothing if the user requested to leave things as-is.
  • Otherwise either change the Maya prefs or rotate the root imported objects.
  • When rotating objects, group them under a group and rotate the group.
  • The ungroup them if the user did not want to keep the group.
  • Add original up axis attribute to the root nodes.
  • Report success or failure of axis conversion.

Cleanup import code by refactoring into smaller functions to avoid code duplication.

Add unit tests for all three methods.

@pierrebai-adsk pierrebai-adsk self-assigned this Sep 20, 2024
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-946/axis-in-import branch from 1153d34 to ae19651 Compare September 20, 2024 20:15
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-946/axis-in-import branch from ae19651 to 47d7df5 Compare September 23, 2024 13:32
- Add -upAxis (-upa) and -axisAndUnitMethod (-aum) flags to the base import command.
- Document the new flags in the import command read-me file.
- Add upAxis and axisAndUnitMethod tokens to the import job args tokens.
- Add the rotateScale, addTransform and overwritePrefs tokens to the import job args token.
- Add the upAxis and axisAndUnitMethod data to the UsdMayaJobImportArgs structure.
- Handle parsing the new user args to build the UsdMayaJobImportArgs.
- Expose the upAxis and axisAndUnitMethod data to Python.
- Add the new UI related to upAxis and axisAndUnitMethod in the import UI.
- Add documentation about how to add a new import or export option.

Implement import rotation
- Add axis conversion helper to the UsdMaya_ReadJob class.
- Determine the Maya up-axis and USD up-axis.
- Do nothing if they match.
- Do nothing if the user requested to leave things as-is.
- Otherwise either change the Maya prefs or rotate the root imported objects.
- When rotating objects, group them under a group and rotate the group.
- The ungroup them if the user did not want to keep the group.
- Add original up axis attribute to the root nodes.
- Report success or failure of axis conversion.

Cleanup import code by refactoring into smaller functions to avoid code duplication.

Add unit tests for all three methods.
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-946/axis-in-import branch from 47d7df5 to d16663f Compare September 23, 2024 14:37
@pierrebai-adsk pierrebai-adsk self-assigned this Sep 23, 2024
_DoImportPrimIt(primIt, usdRootPrim, readCtx, primReaderMap);
}
}
_ImportPrimRange(range, usdRootPrim);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

While in import, I refactor some code that was duplicated and moved the instance prototype cleanup to its own function for clarity.

}
}

bool UsdMaya_ReadJob::_CleanupPrototypes(const UsdPrim& usdRootPrim)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ignore whitespace difference will simplify the diff here. Most code is the same, just with one level less of indentation.

@pierrebai-adsk pierrebai-adsk added ready-for-merge Development process is finished, PR is ready for merge import-export Related to Import and/or Export labels Sep 24, 2024
@seando-adsk
Copy link
Collaborator

Nice work, thanks for adding the readme.

@seando-adsk seando-adsk merged commit 75f3bf1 into dev Sep 30, 2024
11 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-946/axis-in-import branch September 30, 2024 13:07
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.

4 participants