maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

Support the meteresPerUnit flag for usd skeleton exports

Open paulgolter opened this issue 6 months ago • 5 comments

Support the meteresPerUnit flag for usd skeleton exports
When exporting from Maya to USD using the metersPerUnit flag, the scale factor is only applied to meshes and transforms. Skeletons (joint hierarchies, skin bindings, etc.) are not affected by this flag, which results in mismatched scales when importing into other DCCs such as Houdini.

Proposed feature
Extend the metersPerUnit export flag to also apply to skeleton data. All joint positions, rest transforms, and related skeleton attributes should be scaled consistently with meshes and transforms.

Describe alternatives you've considered
Manually scaling skeletons before export or applying post-export USD scale adjustments, both of which are error-prone and break consistency with other scene data. Exporting meshes instead of skeletons, which result in longer export times and requires considerably more disk space.

paulgolter avatar Oct 16 '25 10:10 paulgolter

Thank you for reporting. We will look into this.

wallworm avatar Oct 16 '25 16:10 wallworm

Hi @paulgolter, Thanks again for leaving a comment. While we take a look at this issue. Could you try using the -unit exporter flag instead of -metersPerUnit? It can be used with specific units:

cmds.mayaUSDExport(file=usdFile, unit='km')

Or you can use the current maya preference

cmds.mayaUSDExport(file=usdFile, unit='mayaPrefs')

barbalt avatar Oct 16 '25 17:10 barbalt

The full list of supported units can be found here: https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/fileio/jobs/jobArgs.cpp#L783-L795

{ UsdMayaJobExportArgsTokens->none,
            UsdMayaJobExportArgsTokens->nm,
            UsdMayaJobExportArgsTokens->um,
            UsdMayaJobExportArgsTokens->mm,
            UsdMayaJobExportArgsTokens->cm,
            UsdMayaJobExportArgsTokens->dm,
            UsdMayaJobExportArgsTokens->m,
            UsdMayaJobExportArgsTokens->km,
            UsdMayaJobExportArgsTokens->lightyear,
            UsdMayaJobExportArgsTokens->inch,
            UsdMayaJobExportArgsTokens->foot,
            UsdMayaJobExportArgsTokens->yard,
            UsdMayaJobExportArgsTokens->mile }

barbalt avatar Oct 16 '25 17:10 barbalt

Hey @barbalt

Thanks for pointing this flag out! I never noticed it. May I ask in what release this flag was introduced?

We were running maya 2025.3 vanilla with the maya-usd 0.30.0 and this flag did not exist yet. After updating to maya-usd 0.33.0 and adding the flag

unit="m"

it worked flawlessy! That's awesome.

paulgolter avatar Oct 17 '25 10:10 paulgolter

@paulgolter it was introduced on version 0.31: https://github.com/Autodesk/maya-usd/releases/tag/v0.31.0

barbalt avatar Oct 21 '25 14:10 barbalt