Bake of animation keyframes are fail when object is quaternion define but bones is Eular define #88359

Closed
opened 2021-05-17 22:54:40 +02:00 by dreamertooth · 9 comments

System Information
Operating system: Win10 64 Bit
Graphics card: 2x RTX 3090 (no SLI)

Blender Version
Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 02948a2cab, type: Release
Worked: no

Exact steps for others to reproduce the error
When have armature with bone rotate define in Euler, but object is define in Quaternion, baking animate in mode of POSE will cause fail with stack trace this:

RuntimeError: Error: Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\startup\bl_operators\anim.py", line 290, in execute
    do_clean=self.clean_curves,
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 80, in bake_action_objects
    return iter.send(None)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 111, in bake_action_objects_iter
    yield tuple(iter.send(None) for iter in iter_all)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 111, in <genexpr>
    yield tuple(iter.send(None) for iter in iter_all)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 299, in bake_action_iter
    euler = pbone.matrix_basis.to_euler(obj.rotation_mode, euler_prev)
ValueError: Matrix.to_euler(): invalid euler order 'QUATERNION'

this do because line 299 of bake_action_iter euler = pbone.matrix_basis.to_euler(obj.rotation_mode, euler_prev) is copy of line 346 of bake_action_iter , but 'obj' forget change to 'pbone'. Line 299 is execute because mode is 'POSE', so matrix basis should BONE use for determine rotation mode. Instead, is use object contain bone which have matrix order that CAN (but no SHOULD) have the different to actual bone.

sorry bad english

#88359.blend

**System Information** Operating system: Win10 64 Bit Graphics card: 2x RTX 3090 (**no** SLI) **Blender Version** Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 02948a2cab44, type: Release Worked: no **Exact steps for others to reproduce the error** When have armature with *bone* rotate define in Euler, but *object* is define in Quaternion, baking animate in mode of POSE will cause fail with stack trace this: ``` RuntimeError: Error: Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\startup\bl_operators\anim.py", line 290, in execute do_clean=self.clean_curves, File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 80, in bake_action_objects return iter.send(None) File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 111, in bake_action_objects_iter yield tuple(iter.send(None) for iter in iter_all) File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 111, in <genexpr> yield tuple(iter.send(None) for iter in iter_all) File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\bpy_extras\anim_utils.py", line 299, in bake_action_iter euler = pbone.matrix_basis.to_euler(obj.rotation_mode, euler_prev) ValueError: Matrix.to_euler(): invalid euler order 'QUATERNION' ``` this do because line 299 of bake_action_iter `euler = pbone.matrix_basis.to_euler(obj.rotation_mode, euler_prev)` is copy of line 346 of bake_action_iter , but 'obj' forget change to 'pbone'. Line 299 is execute because mode is 'POSE', so matrix basis should BONE use for determine rotation mode. Instead, is use *object contain bone* which have matrix order that CAN (but no SHOULD) have the different to actual bone. sorry bad english [#88359.blend](https://archive.blender.org/developer/F10122123/T88359.blend)
Author

Added subscriber: @DreamertTooth

Added subscriber: @DreamertTooth
Author

this fix for me, but also consider, am potato. maybe big incorrect. if wrong do, please tell! Big thank ^^

this fix for me, but also consider, am potato. maybe big incorrect. if wrong do, please tell! Big thank ^^
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm.

Can confirm.

This issue was referenced by a1954e3807

This issue was referenced by a1954e380730ae9d116245343d9296d587907673

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sybren A. Stüvel self-assigned this 2021-05-20 13:00:55 +02:00

Thanks for the fix @DreamertTooth !

Thanks for the fix @DreamertTooth !
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#88359
No description provided.