ribidbody: Fix setting "Bake to Keyframes" start frame above 2
authorSergej Reich <sergej.reich@googlemail.com>
Sun, 17 Feb 2013 18:13:22 +0000 (18:13 +0000)
committerSergej Reich <sergej.reich@googlemail.com>
Sun, 17 Feb 2013 18:13:22 +0000 (18:13 +0000)
Simulation needs to run from the beginning to work properly.

release/scripts/startup/bl_operators/rigidbody.py

index bb3a9a6..652ad4b 100644 (file)
@@ -120,7 +120,8 @@ class BakeToKeyframes(Operator):
 
         if objects:
             # store transformation data
-            for f in list(range(self.frame_start, self.frame_end + 1)):
+            # need to start at scene start frame so simulation is run from the beginning
+            for f in list(range(scene.frame_start, self.frame_end + 1)):
                 scene.frame_set(f)
                 if f in frames:
                     mat = {}