diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-21 21:12:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-21 21:12:08 +0400 |
commit | 6869ea8e7ee409d86528c656c30eed1a38835e59 (patch) | |
tree | 66f967dde04f03abf4cd4c661292c986784f0b8b /release/scripts/startup/bl_operators/rigidbody.py | |
parent | 13670e1e06f969b39589607e117133ea81c83096 (diff) |
code cleanup: no need to use list(range()), just use range()
Diffstat (limited to 'release/scripts/startup/bl_operators/rigidbody.py')
-rw-r--r-- | release/scripts/startup/bl_operators/rigidbody.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py index 652ad4bf784..420e7661789 100644 --- a/release/scripts/startup/bl_operators/rigidbody.py +++ b/release/scripts/startup/bl_operators/rigidbody.py @@ -109,7 +109,8 @@ class BakeToKeyframes(Operator): objects = [] scene = context.scene frame_orig = scene.frame_current - frames = list(range(self.frame_start, self.frame_end + 1, self.step)) + frames_step = range(self.frame_start, self.frame_end + 1, self.step) + frames_full = range(self.frame_start, self.frame_end + 1) # filter objects selection for obj in context.selected_objects: @@ -121,16 +122,16 @@ class BakeToKeyframes(Operator): if objects: # store transformation data # 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)): + for f in frames_full: scene.frame_set(f) - if f in frames: + if f in frames_step: mat = {} for i, obj in enumerate(objects): mat[i] = obj.matrix_world.copy() bake.append(mat) # apply transformations as keyframes - for i, f in enumerate(frames): + for i, f in enumerate(frames_step): scene.frame_set(f) obj_prev = objects[0] for j, obj in enumerate(objects): |