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-948 scale export to USD according to units #3937

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

Add UI for export units:

  • Add a new -unit (-unt) flag to the export command.
  • Change the existing -exportDistanceUnit default to be false, to avoid clashing with the new -unit option.
  • Document it.
  • Add corresponding unit tokens and value in the job arguments.
  • Expose it to Python.
  • Add UI to control the flag in the export dialog.

Scale during export:

  • Use the same method as for up-axis: modify root node before export and undo after export.
  • That is group all root nodes and scale them, export to USD, then ungroup.
  • Re-use the same group as for up-axis and same undo, for efficiency.
  • Correctly handle the difference between Maya UI units and Maya internal data units.

Add unit tests.

@pierrebai-adsk pierrebai-adsk self-assigned this Sep 30, 2024
@pierrebai-adsk pierrebai-adsk added the import-export Related to Import and/or Export label Sep 30, 2024
@pierrebai-adsk pierrebai-adsk removed their assignment Sep 30, 2024
Add UI for export units:
- Add a new -unit (-unt) flag to the export command.
- Change the existing -exportDistanceUnit default to be false, to avoid
  clashing witth the new -unit option.
- Document it.
- Add corresponding unit tokens and value in the job arguments.
- Expose it to Python.
- Add UI to control the flag in the export dialog.

Scale during export:
- Use the same method as for up-axis: modify root node before export and
  undo after export.
- That is group all root nodes and scale them, export to USD, then
  ungroup.
- Re-use the same group as for up-axis and same undo, for efficiency.
- Correctly handle the difference between Maya UI units and Maya
  internal data units.

Add unit tests.
@@ -1111,7 +1127,7 @@ const VtDictionary& UsdMayaJobExportArgs::GetDefaultDictionary()
d[UsdMayaJobExportArgsTokens->exportAssignedMaterials] = true;
d[UsdMayaJobExportArgsTokens->legacyMaterialScope] = false;
d[UsdMayaJobExportArgsTokens->exportDisplayColor] = false;
d[UsdMayaJobExportArgsTokens->exportDistanceUnit] = true;
d[UsdMayaJobExportArgsTokens->exportDistanceUnit] = 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.

Since the default for the new unit option is "Maya Prefs", we are better off with exportDistanceUnit being off by deault, otherwise it would overwrite what the unit option would try to do.

_autoAxisAndUnitsChanger = std::make_unique<AutoUpAxisAndUnitsChanger>(
mJobCtx.mStage, mJobCtx.mArgs.upAxis, mJobCtx.mArgs.unit);

// TODO: handle mJobCtx.mArgs.unit
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't the command above also handle the units?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah yes, I will remove this comment in the next PR

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 1, 2024
@seando-adsk seando-adsk merged commit 78890d7 into dev Oct 1, 2024
12 of 13 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-948/export-usd-units branch October 1, 2024 20:11
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