Fix T86193: Bake Action, wrong rotation order for bones
authordreamertooth <dreamertooth>
Thu, 20 May 2021 10:53:14 +0000 (12:53 +0200)
committerSybren A. Stüvel <sybren@blender.org>
Thu, 20 May 2021 10:57:05 +0000 (12:57 +0200)
Use bone rotation order to compute the baked rotation. This fixes a bug
introduced in rB0e85d701c654, where the object rotation order was
applied to the bone.

Maniphest Tasks: T88359, T86193

Reviewed By: sybren, GuiltyGhost, #animation_rigging

Differential Revision: https://developer.blender.org/D11282

release/scripts/modules/bpy_extras/anim_utils.py

index 269592b3bb1d032de6cf4fcfb68e130aac61fe4a..0868b772a2be3041359ed48548e5c798aa73c5fd 100644 (file)
@@ -296,7 +296,7 @@ def bake_action_iter(
                     pbone.keyframe_insert("rotation_axis_angle", index=-1, frame=f, group=name)
                 else:  # euler, XYZ, ZXY etc
                     if euler_prev is not None:
-                        euler = pbone.matrix_basis.to_euler(obj.rotation_mode, euler_prev)
+                        euler = pbone.matrix_basis.to_euler(pbone.rotation_mode, euler_prev)
                         pbone.rotation_euler = euler
                         del euler
                     euler_prev = pbone.rotation_euler.copy()