Fix T56766: Bake Action Visual Keying Not Working.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 12 Sep 2018 09:50:35 +0000 (11:50 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 12 Sep 2018 09:52:06 +0000 (11:52 +0200)
Consequences of new requirement to use named keywords parameters for our
RNA API... Hopefully fixed all other cases in that file as well, but
guess we'll find more of those in comming weeks. :|

release/scripts/modules/bpy_extras/anim_utils.py

index 7216add2c2c2a5d79006752268fdec612d6455c4..c545d2373298bca812e95b39319ae1d3c8cc13b7 100644 (file)
@@ -168,7 +168,8 @@ def bake_action_iter(
         for name, pbone in obj.pose.bones.items():
             if do_visual_keying:
                 # Get the final transform of the bone in its own local space...
-                matrix[name] = obj.convert_space(pbone, pbone.matrix, 'POSE', 'LOCAL')
+                matrix[name] = obj.convert_space(pose_bone=pbone, matrix=pbone.matrix,
+                                                 from_space='POSE', to_space='LOCAL')
             else:
                 matrix[name] = pbone.matrix_basis.copy()
 
@@ -272,13 +273,13 @@ def bake_action_iter(
             for (f, matrix, bbones) in pose_info:
                 pbone.matrix_basis = matrix[name].copy()
 
-                pbone.keyframe_insert("location", -1, f, name, options)
+                pbone.keyframe_insert("location", index=-1, frame=f, group=name, options=options)
 
                 rotation_mode = pbone.rotation_mode
                 if rotation_mode == 'QUATERNION':
-                    pbone.keyframe_insert("rotation_quaternion", -1, f, name, options)
+                    pbone.keyframe_insert("rotation_quaternion", index=-1, frame=f, group=name, options=options)
                 elif rotation_mode == 'AXIS_ANGLE':
-                    pbone.keyframe_insert("rotation_axis_angle", -1, f, name, options)
+                    pbone.keyframe_insert("rotation_axis_angle", index=-1, frame=f, group=name, options=options)
                 else:  # euler, XYZ, ZXY etc
                     if euler_prev is not None:
                         euler = pbone.rotation_euler.copy()
@@ -288,9 +289,9 @@ def bake_action_iter(
                         del euler
                     else:
                         euler_prev = pbone.rotation_euler.copy()
-                    pbone.keyframe_insert("rotation_euler", -1, f, name, options)
+                    pbone.keyframe_insert("rotation_euler", index=-1, frame=f, group=name, options=options)
 
-                pbone.keyframe_insert("scale", -1, f, name, options)
+                pbone.keyframe_insert("scale", index=-1, frame=f, group=name, options=options)
 
                 # Bendy Bones
                 if pbone.bone.bbone_segments > 1:
@@ -298,7 +299,7 @@ def bake_action_iter(
                     for bb_prop in BBONE_PROPS:
                         # update this property with value from bbone_shape, then key it
                         setattr(pbone, bb_prop, bbone_shape[bb_prop])
-                        pbone.keyframe_insert(bb_prop, -1, f, name, options)
+                        pbone.keyframe_insert(bb_prop, index=-1, frame=f, group=name, options=options)
 
     # object. TODO. multiple objects
     if do_object:
@@ -313,13 +314,13 @@ def bake_action_iter(
             name = "Action Bake"  # XXX: placeholder
             obj.matrix_basis = matrix
 
-            obj.keyframe_insert("location", -1, f, name, options)
+            obj.keyframe_insert("location", index=-1, frame=f, group=name, options=options)
 
             rotation_mode = obj.rotation_mode
             if rotation_mode == 'QUATERNION':
-                obj.keyframe_insert("rotation_quaternion", -1, f, name, options)
+                obj.keyframe_insert("rotation_quaternion", index=-1, frame=f, group=name, options=options)
             elif rotation_mode == 'AXIS_ANGLE':
-                obj.keyframe_insert("rotation_axis_angle", -1, f, name, options)
+                obj.keyframe_insert("rotation_axis_angle", index=-1, frame=f, group=name, options=options)
             else:  # euler, XYZ, ZXY etc
                 if euler_prev is not None:
                     euler = obj.rotation_euler.copy()
@@ -329,9 +330,9 @@ def bake_action_iter(
                     del euler
                 else:
                     euler_prev = obj.rotation_euler.copy()
-                obj.keyframe_insert("rotation_euler", -1, f, name, options)
+                obj.keyframe_insert("rotation_euler", index=-1, frame=f, group=name, options=options)
 
-            obj.keyframe_insert("scale", -1, f, name, options)
+            obj.keyframe_insert("scale", index=-1, frame=f, group=name, options=options)
 
         if do_parents_clear:
             obj.parent = None