FBX Import: Fix pre-, post- and geometric rotations #104561

Merged
Bastien Montagne merged 1 commits from Mysteryem/blender-addons:fbx_fix_pre_post_rotations_pr into main 2023-04-28 17:21:50 +02:00

1 Commits

Author SHA1 Message Date
Thomas Barlow f858f9528e FBX Import: Fix pre-, post- and geometric rotations
The pre-, post- and geometric rotations were using the rotation order of
the transform, but it's only the rotation that uses the rotation order
of the transform.

The post-rotation used in calculating the WorldTransform was being used
as-is, this seems to have been an error in the FBX 2011 documentation
because since FBX 2012, the documentation has specified that the inverse
of post-rotation is used and there is no mention of this change in the
FBX 2012 changes. Additionally, given files in FBX 2011 format, the
post-rotation works the same as in FBX 2012 and newer.

The pre-, post- and geometric rotations have been changed to always use
XYZ order.

The post-rotation is now inverted when calculating each WorldTransform.

Fixes the import of .fbx that have non-zero post-rotation.
Fixes the import of .fbx that have pre-/post-/geometric rotation and
have non-XYZ rotation order.

Cases where the "Use Pre/Post Rotation" option of the FBX Importer had
to be disabled to get a working import are likely to now work with the
option enabled.

Fixes #45176: Incorrect rotation of imported Cameras and Lights
2023-04-24 06:20:31 +01:00