Baked object rotation has discontinuities #83351

Closed
opened 2020-12-03 08:49:59 +01:00 by Max Konischev · 16 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 452.06

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
Worked: Never (2.80+)

Short description of error
I have a problem with animation curves after animation baking and after animation export. So you can see before/after.
It's rotation data. They're rotates on 180 degrees in X and Z-axis, and Y got to be symmetrical. It's happening after animation baking and animation export. What should i do to stay them as Before? Thank's!

Exact steps for others to reproduce the error
Note: (@iss) script in text editor is pretty much copied from bake action operator, so I assume current behavior is bug, even though I havent found exactly what causes it.

#83351.blend

  • Open file
  • Run script in text editor - Works as expected
  • Undo
  • Run Bake Action operator - Bake action operator result looks like this:
    WQpeE.png
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 452.06 **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` Worked: Never (2.80+) **Short description of error** I have a problem with animation curves after animation baking and after animation export. So you can see before/after. It's rotation data. They're rotates on 180 degrees in X and Z-axis, and Y got to be symmetrical. It's happening after animation baking and animation export. What should i do to stay them as Before? Thank's! **Exact steps for others to reproduce the error** Note: (@iss) script in text editor is pretty much copied from bake action operator, so I assume current behavior is bug, even though I havent found exactly what causes it. [#83351.blend](https://archive.blender.org/developer/F9499704/T83351.blend) - Open file - Run script in text editor - Works as expected - Undo - Run Bake Action operator - Bake action operator result looks like this: ![WQpeE.png](https://archive.blender.org/developer/F9429110/WQpeE.png)
Author

Added subscriber: @KoniFilms

Added subscriber: @KoniFilms

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

For help using Blender, please try one of the community websites: https://www.blender.org/community/

If you think this is bug, please clarify how exactly did you expor/import data.

For help using Blender, please try one of the community websites: https://www.blender.org/community/ If you think this is bug, please clarify how exactly did you expor/import data.
Author

In #83351#1071659, @iss wrote:
For help using Blender, please try one of the community websites: https://www.blender.org/community/

If you think this is bug, please clarify how exactly did you expor/import data.

I've opened the case in stackexchange, but got just one recommendation: to send it to you as the bug.
Just open my bug.blend file and do "baking animation" for the camera, you'll see changes in rotation data. If you'll do export in fbx you'll see it too.

> In #83351#1071659, @iss wrote: > For help using Blender, please try one of the community websites: https://www.blender.org/community/ > > If you think this is bug, please clarify how exactly did you expor/import data. I've opened the case in stackexchange, but got just one recommendation: to send it to you as the bug. Just open my bug.blend file and do "baking animation" for the camera, you'll see changes in rotation data. If you'll do export in fbx you'll see it too.
Richard Antalik changed title from Problems with rotation animation keys baking to Baked object rotation animation is offset 2020-12-10 09:52:39 +01:00

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Sybren A. Stüvel changed title from Baked object rotation animation is offset to Baked object rotation has discontinuities 2020-12-18 12:18:36 +01:00

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Sybren A. Stüvel self-assigned this 2020-12-18 12:34:33 +01:00

The difference between your script and the Bake Action code is that your script doesn't do the conversions loc/rot/scale → matrix → loc/rot/scale. It's this conversion that causes the observed problems. The Bake Action operator is a bit limited in this sense.

You can select the rotation channels and then choose Key > Discontinuity (Euler) Filter in the graph editor menu. This will fix it right up.

Technical info: the Bake Action operator uses euler.make_compatible(euler_prev) to try and prevent discontinuities. This is not sufficient. The matrix → euler conversion has already picked one of the two possible rotations; see the mat3_normalized_to_compatible_eul() function in math_rotation.c for a proper implementation.

The difference between your script and the Bake Action code is that your script doesn't do the conversions loc/rot/scale → matrix → loc/rot/scale. It's this conversion that causes the observed problems. The Bake Action operator is a bit limited in this sense. You can select the rotation channels and then choose Key > Discontinuity (Euler) Filter in the graph editor menu. This will fix it right up. Technical info: the Bake Action operator uses `euler.make_compatible(euler_prev)` to try and prevent discontinuities. This is not sufficient. The matrix → euler conversion has already picked one of the two possible rotations; see the `mat3_normalized_to_compatible_eul()` function in `math_rotation.c` for a proper implementation.

This issue was referenced by e5528904f1

This issue was referenced by e5528904f12104ee31e7b67b54f2a4b3f14cec1e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

The fix was too simple to not just immediately do :)

The fix was too simple to not just immediately do :)
Author

Changed status from 'Resolved' to: 'Archived'

Changed status from 'Resolved' to: 'Archived'
Author

I don't know what have you fixed. But i still have this problem with "Key > Discontinuity (Euler) Filter in the graph editor menu" before or after BakeAction. I need rotations value to be the same as before BakeAction or FBX-export. How could i fix it? What should i do?

I don't know what have you fixed. But i still have this problem with "Key > Discontinuity (Euler) Filter in the graph editor menu" before or after BakeAction. I need rotations value to be the same as before BakeAction or FBX-export. How could i fix it? What should i do?

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'

@KoniFilms please don't adjust the report status yourself, leave that to the developers working on it.

The image you see in the release notes is actually the file you attached here to this report. Which version of Blender are you testing with?

@KoniFilms please don't adjust the report status yourself, leave that to the developers working on it. The image you see in the [release notes](https://wiki.blender.org/wiki/Reference/Release_Notes/2.92/Animation-Rigging#Bake_Action) is actually the file you attached here to this report. Which version of Blender are you testing with?
Author

I tested 2.92 and looks like the problem is gone. Thank you so much guys! You're amazing!

I tested 2.92 and looks like the problem is gone. Thank you so much guys! You're amazing!
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
4 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#83351
No description provided.