-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[maya] added euler filter for imports #450
[maya] added euler filter for imports #450
Conversation
Filed as internal issue #159381. |
So, just as a note on what's going on here: part of the problem here is that your input xform stack is not identified as a maya compatible stack. In order to be judged maya-compatible, it must consist of these ops, or some subset:
The stack you have is:
The two stacks are close, but with a few differences... some of the names are different (rotatePivotTranslate vs rotatePivotOffset), the order of rotate/rotateAxis is different than the order of rotateOffset/rotate, and the maya stack has no "scaleOffset" slot. So, since it couldn't conform the input stack to be maya compatible, it simply converts to a matrix, then decomposes... which explains the flips. Having said that... it's not unreasonable to expect to be able to export a usd xform from one app, with it's own xform stack, then be able to import that xform stack into maya, and not have euler flips, even though the xform stacks are different. So I can still see the utility of this PR. Just wanted to offer an explanation of why it was happening... |
yValue[previousRotationIndex], | ||
zValue[previousRotationIndex], MrotOrder); | ||
eulerRot.setToClosestSolution(previousRotation); | ||
} |
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.
These changes won't actually do anything, because rotateAxis is internally stored as a quaternion, so 360 flips change nothing. ie, try this in a python prompt:
cmds.setAttr('persp.rotateAxis', 720, 0, 0)
print cmds.getAttr('persp.rotateAxis')
A note: given that the changes in _pushUSDXformOpToMayaXform actually do nothing (see my note), the only changes are to _pushUSDXformToMayaXform... which should only get invoked for xform stacks that aren't compatible with the maya xform stack. So the behavior currently is that if eulerFilter is on, then non-compatible xforms will be filtered, and compatible ones won't be. This is actually the behavior I would want by default, but might be somewhat confusing... there might be situations where someone passes in a compatible xform stack (ie, nothing but a rotate X of [350, 360, 10], and might actually want euler filtering on. Currently, they won't get it. I think the ideal behavior would be to make the option a tri-mode: on: always filter, for both compatible and incompatible xform stacks |
Thanks @elrond79 for your notes and for posting the explanation why we need the Euler filter. |
Closing this PR as it is replaced by #506 |
Description of Change(s)
Added Euler filter to Maya import to fix potential Euler flips for animated rotations.
The filter is using Maya's
MEulerRotation::setToClosestSolution()
.Added useEulerFilter option to toggle the filter.
This helps with #410 but obviously only on the Maya side.