Importing binary FBX with skeleton and animation, animation is not the same as exported #69358

Closed
opened 2019-08-31 14:53:48 +02:00 by Yannick · 5 comments

System Information
Operating system: Windows 7
Graphics card: nVidia GeForce GTX 1660 Ti

Blender Version
Broken: 2.80

Short description of error
After importing the FBX, the animation on the skeleton includes a 360 turn between frames 37 and 49 that wasn't present when exporting, and isn't present when importing in other software.
This is because import has set neighbour key rotation values to (0.210, 0.075, -0.963, -0.153) and (0.132, 0.016, 0.956, 0.263). Second value should be multiplied by -1 (-0.132, -0.016, -0.956, -0.263) for interpolation to occur correctly.

bug_blender_1_1.fbx

Exact steps for others to reproduce the error
Import FBX file above (with Automatic Bone Orientation enabled).
Look at animation between frames 37 and 49.

Fix suggestion
I have modified blen_read_animations_action_item function in file "io_scene_fbx/import_fbx.py" to correct the issue. Every time a new key is added, the new code computes dot product with previous key, and if the result is negative, replaces q with -q.

Modified version of blen_read_animations_action_item (search for lastRot to find changes) :

blen_read_animations_action_item.txt

**System Information** Operating system: Windows 7 Graphics card: nVidia GeForce GTX 1660 Ti **Blender Version** Broken: 2.80 **Short description of error** After importing the FBX, the animation on the skeleton includes a 360 turn between frames 37 and 49 that wasn't present when exporting, and isn't present when importing in other software. This is because import has set neighbour key rotation values to (0.210, 0.075, -0.963, -0.153) and (0.132, 0.016, 0.956, 0.263). Second value should be multiplied by -1 (-0.132, -0.016, -0.956, -0.263) for interpolation to occur correctly. [bug_blender_1_1.fbx](https://archive.blender.org/developer/F7711915/bug_blender_1_1.fbx) **Exact steps for others to reproduce the error** Import FBX file above (with Automatic Bone Orientation enabled). Look at animation between frames 37 and 49. **Fix suggestion** I have modified blen_read_animations_action_item function in file "io_scene_fbx/import_fbx.py" to correct the issue. Every time a new key is added, the new code computes dot product with previous key, and if the result is negative, replaces q with -q. Modified version of blen_read_animations_action_item (search for lastRot to find changes) : [blen_read_animations_action_item.txt](https://archive.blender.org/developer/F7711921/blen_read_animations_action_item.txt)
Author

Added subscriber: @kschoice

Added subscriber: @kschoice

Added subscriber: @mont29

Added subscriber: @mont29
Bastien Montagne self-assigned this 2019-09-02 11:14:52 +02:00

Thanks, indeed looks like we also need some kind of 'compat' rotation for quaternions as well... And I though those were interpolation-bullet-proof! xD

Thanks, indeed looks like we also need some kind of 'compat' rotation for quaternions as well... And I though those were interpolation-bullet-proof! xD

This issue was referenced by f412871175

This issue was referenced by f4128711758e92a755001e51a88d3d4f67100974

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#69358
No description provided.