diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-01-17 16:38:20 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-01-17 16:38:40 +0400 |
commit | 4c89a658be3c2ec581c78d44561a1f5865066a8d (patch) | |
tree | 0d2d7ada36197cec47c23aab73565af162a26acf /release | |
parent | 929fb8324bcc6c7090ef898c5092363daee46d97 (diff) |
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.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/rigidbody.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py index 979cc01c0ad..b151efb45ee 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) |