Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
766 stars 201 forks source link

🐛 Making sure usdExport works with scalePivot and rotatePivot #463

Closed DanEnglesson closed 2 years ago

DanEnglesson commented 4 years ago

Describe the bug rotatePivot and scalePivot did not properly get applied during export. In this case it just wrote out the rotatePivot and gave an xformOp with (0,3,1) (incorrectly too) which made it not be in the place it should be.

image

With this fix it does check the XformType, name and inverse to make sure we haven't added it yet. This fixes the problem and it is now exported correctly with inversed ops for the scale and rotatePivot.

So the cube in this case is in origo and has scale and rotatePivot applied. Looks good in maya like this: image but after export it looks like this in usdview: image And you can see the xformOp is just one rotatePivot and also gets incorrect values on the rotate, that is the scale values. With this fix it looks like this: image Now the xformops matches what is in Maya and is correctly transformed.

Steps to reproduce

  1. Export a cube with scale and rotatePivot applied
  2. look at it in usdview, it get incorrect values applied for the xformops

Expected behavior The inverse of the rotatePivot and scalePivot should be in the xformOpOrder list Able to fix it by making sure we check for xforms not just by type but by name and if it is Inverse or not. Here's a working fix, which I can send as a pull request if you want :) https://github.com/goodbyekansas/maya-usd/pull/7

Cheers, Dan

kxl-adsk commented 4 years ago

@DanEnglesson Thank you for reporting and proposing a change to fix it. I will let QA reproduce the issue. Once done, feel free to open a PR and we will discuss it.

DanEnglesson commented 4 years ago

Great, thanks.

santosg87 commented 2 years ago

@DanEnglesson was this ever merged? I am trying to reproduce this on 0.13.0 and it seems to be working correctly for me.

DanEnglesson commented 2 years ago

Hi @santosg87, I think it was fixed but not from our pull request. We never heard back from QA on this topic so not sure where it ended up. A pull request from us was never created for this at least.

santosg87 commented 2 years ago

thanks for the confirmation. I was trying to reproduce without any luck. I will mark this as closed for now, but feel free to re-open if this is still an issue!

thank you!