[Bf-blender-cvs] [4c89a65] master: Fix T38157: Rigid body, crazy f-curves after bake to keyframes

Joshua Leung noreply at git.blender.org
Fri Jan 17 13:39:39 CET 2014


Commit: 4c89a658be3c2ec581c78d44561a1f5865066a8d
Author: Joshua Leung
Date:   Sat Jan 18 01:38:20 2014 +1300
https://developer.blender.org/rB4c89a658be3c2ec581c78d44561a1f5865066a8d

Fix T38157: Rigid body, crazy f-curves after bake to keyframes

A logic error meant that the wrong "previous rotation" values were being used
when decomposing the rigidbody results back to transform channels. Instead of
using the previous values for the object in question, it was actually using
the rotation value of the previous object that was evaluated.

===================================================================

M	release/scripts/startup/bl_operators/rigidbody.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py
index 979cc01..b151efb 100644
--- a/release/scripts/startup/bl_operators/rigidbody.py
+++ b/release/scripts/startup/bl_operators/rigidbody.py
@@ -138,7 +138,6 @@ class BakeToKeyframes(Operator):
             # apply transformations as keyframes
             for i, f in enumerate(frames_step):
                 scene.frame_set(f)
-                obj_prev = objects[0]
                 for j, obj in enumerate(objects):
                     mat = bake[i][j]
 
@@ -153,9 +152,8 @@ class BakeToKeyframes(Operator):
                         obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
                     else:  # euler
                         # make sure euler rotation is compatible to previous frame
-                        obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
-
-                    obj_prev = obj
+						# NOTE: assume that on first frame, the starting rotation is appropriate
+                        obj.rotation_euler = mat.to_euler(rot_mode, obj.rotation_euler)
 
                 bpy.ops.anim.keyframe_insert(type='BUILTIN_KSI_LocRot', confirm_success=False)




More information about the Bf-blender-cvs mailing list