Baking euler rotation to quaternions error #71924

Closed
opened 2019-11-26 11:53:33 +01:00 by Maciej Szcześnik · 4 comments

System Information
Operating system: Windows 10 64 bit
Graphics card: nVidia 970 GTX

Blender Version
Broken: 2.81, master,

Short description of error
When one bakes an object with Euler rotations to an object with quaternion rotations, the baked quaternions are "mirrored", meaning that every time the rotation exceeds 360 degrees, the quaternion W and respective rotation axis will be inverted. It produces the same visual result but introduces a lot of problems (with smoothing for instance).

You can find the original Euler rotation below (720 degrees along the Z-axis):

{F8168303,size=full}

And here is the baked quaternion rotation (the same 720 degrees along the Z-axis, baked from the cube using Euler rotations):

{F8168330, size=full}

And here is how the properly baked quaternion rotations should look like - these are adjusted by hand (with such curves there would be no problems with smoothing, etc.):

{F8168341, size=full}

Why this is important? If one works with FBX rigs, imports and exports FBX animations it becomes very problematic very soon. FBX rigs contain only Euler animations and importing an FBX rig to Blender bakes the animations onto an armature with quaternion rotations. This "inverted" curves problem appears for every bone that rotates more than 360 degrees. It is possible to go an fix the errors one by one manually, but I guess it could be fixed by the baker automatically, making the life of a game animator a lot easier :).

Exact steps for others to reproduce the error
Blender bake error.blend

  1. Please open the attached file.
  2. You will find 3 cubes - the blue one uses Euler animation and rotates 720 degrees in the Z-axis. The green one copies the rotations with a constraint but uses quaternion rotations. The red one is the same as the green one but has the animation already baked and constraints removed for your convenience.
  3. You can select the green cube, press F3, type Bake.
  4. Choose Bake Action.
  5. Set the Start Frame to 1 and the End Frame to 100.
  6. Check the Visual Keying and the Clear Constraints options.
  7. Make sure to check the Object Bake Data.
  8. Hit OK.
  9. Navigate to the Graph Editor and observe the baked curve.

Please consider addressing this bug as it will make Blender more industry-standard in terms of animations - especially when working with FBX data.

Have a nice day,
Maciej

**System Information** Operating system: Windows 10 64 bit Graphics card: nVidia 970 GTX **Blender Version** Broken: 2.81, master, **Short description of error** When one bakes an object with Euler rotations to an object with quaternion rotations, the baked quaternions are "mirrored", meaning that every time the rotation exceeds 360 degrees, the quaternion W and respective rotation axis will be inverted. It produces the same visual result but introduces a lot of problems (with smoothing for instance). You can find the original Euler rotation below (720 degrees along the Z-axis): {[F8168303](https://archive.blender.org/developer/F8168303/image.png),size=full} And here is the baked quaternion rotation (the same 720 degrees along the Z-axis, baked from the cube using Euler rotations): {[F8168330](https://archive.blender.org/developer/F8168330/image.png), size=full} And here is how the properly baked quaternion rotations should look like - these are adjusted by hand (with such curves there would be no problems with smoothing, etc.): {[F8168341](https://archive.blender.org/developer/F8168341/image.png), size=full} Why this is important? If one works with FBX rigs, imports and exports FBX animations it becomes very problematic very soon. FBX rigs contain only Euler animations and importing an FBX rig to Blender bakes the animations onto an armature with quaternion rotations. This "inverted" curves problem appears for every bone that rotates more than 360 degrees. It is possible to go an fix the errors one by one manually, but I guess it could be fixed by the baker automatically, making the life of a game animator a lot easier :). **Exact steps for others to reproduce the error** [Blender bake error.blend](https://archive.blender.org/developer/F8168280/Blender_bake_error.blend) 1. Please open the attached file. 2. You will find 3 cubes - the blue one uses Euler animation and rotates 720 degrees in the Z-axis. The green one copies the rotations with a constraint but uses quaternion rotations. The red one is the same as the green one but has the animation already baked and constraints removed for your convenience. 3. You can select the green cube, press F3, type Bake. 4. Choose Bake Action. 5. Set the Start Frame to 1 and the End Frame to 100. 6. Check the Visual Keying and the Clear Constraints options. 7. Make sure to check the Object Bake Data. 8. Hit OK. 9. Navigate to the Graph Editor and observe the baked curve. Please consider addressing this bug as it will make Blender more industry-standard in terms of animations - especially when working with FBX data. Have a nice day, Maciej

Added subscriber: @MaciejSzczesnik

Added subscriber: @MaciejSzczesnik

This issue was referenced by 9467c0dcf9

This issue was referenced by 9467c0dcf9bd0d91d40a63e885a565274323daef

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2019-11-26 16:01:39 +01:00

Thanks! Works great!

Thanks! Works great!
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
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#71924
No description provided.