-
Notifications
You must be signed in to change notification settings - Fork 201
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
Conversation
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.
c3f3155
to
0cd3703
Compare
@@ -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; |
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.
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 |
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.
Doesn't the command above also handle the units?
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.
Ah yes, I will remove this comment in the next PR
Add UI for export units:
Scale during export:
Add unit tests.