[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54144] trunk/blender/release/scripts/ startup/bl_operators: use more conventional names in rigid body script.
Campbell Barton
ideasman42 at gmail.com
Mon Jan 28 13:15:56 CET 2013
Revision: 54144
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54144
Author: campbellbarton
Date: 2013-01-28 12:15:50 +0000 (Mon, 28 Jan 2013)
Log Message:
-----------
use more conventional names in rigid body script.
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_operators/object_align.py
trunk/blender/release/scripts/startup/bl_operators/rigidbody.py
Modified: trunk/blender/release/scripts/startup/bl_operators/object_align.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/object_align.py 2013-01-28 11:56:01 UTC (rev 54143)
+++ trunk/blender/release/scripts/startup/bl_operators/object_align.py 2013-01-28 12:15:50 UTC (rev 54144)
@@ -129,17 +129,17 @@
flag_first = True
- objs = []
+ objects = []
for obj in context.selected_objects:
matrix_world = obj.matrix_world.copy()
bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
- objs.append((obj, bb_world))
+ objects.append((obj, bb_world))
- if not objs:
+ if not objects:
return False
- for obj, bb_world in objs:
+ for obj, bb_world in objects:
if bb_quality and obj.type == 'MESH':
GBB = GlobalBB_HQ(obj)
@@ -201,7 +201,7 @@
# Main Loop
- for obj, bb_world in objs:
+ for obj, bb_world in objects:
matrix_world = obj.matrix_world.copy()
bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
Modified: trunk/blender/release/scripts/startup/bl_operators/rigidbody.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/rigidbody.py 2013-01-28 11:56:01 UTC (rev 54143)
+++ trunk/blender/release/scripts/startup/bl_operators/rigidbody.py 2013-01-28 12:15:50 UTC (rev 54144)
@@ -37,21 +37,21 @@
def execute(self, context):
obj = context.object
- scn = context.scene
+ scene = context.scene
# deselect all but mesh objects
for o in context.selected_objects:
if o.type != 'MESH':
o.select = False
- sel = context.selected_objects
- if sel:
+ objects = context.selected_objects
+ if objects:
# add selected objects to active one groups and recalculate
bpy.ops.group.objects_add_active()
- scn.frame_set(scn.frame_current)
+ scene.frame_set(scene.frame_current)
# copy settings
- for o in sel:
+ for o in objects:
if o.rigid_body is None:
continue
@@ -106,7 +106,7 @@
def execute(self, context):
bake = []
- objs = []
+ objects = []
scene = context.scene
frame_orig = scene.frame_current
frames = list(range(self.frame_start, self.frame_end + 1, self.step))
@@ -116,23 +116,23 @@
if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE':
obj.select = False
- objs = context.selected_objects
+ objects = context.selected_objects
- if objs:
+ if objects:
# store transformation data
for f in list(range(self.frame_start, self.frame_end + 1)):
scene.frame_set(f)
if f in frames:
mat = {}
- for i, obj in enumerate(objs):
+ 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):
scene.frame_set(f)
- obj_prev = objs[0]
- for j, obj in enumerate(objs):
+ obj_prev = objects[0]
+ for j, obj in enumerate(objects):
mat = bake[i][j]
obj.location = mat.to_translation()
@@ -156,7 +156,7 @@
bpy.ops.rigidbody.objects_remove()
# clean up keyframes
- for obj in objs:
+ for obj in objects:
action = obj.animation_data.action
for fcu in action.fcurves:
keyframe_points = fcu.keyframe_points
@@ -214,15 +214,15 @@
@classmethod
def poll(cls, context):
obj = context.object
- objs = context.selected_objects
- return (obj and obj.rigid_body and (len(objs) > 1))
+ objects = context.selected_objects
+ return (obj and obj.rigid_body and (len(objects) > 1))
def execute(self, context):
- objs = context.selected_objects
+ objects = context.selected_objects
obj_act = context.active_object
- for obj in objs:
+ for obj in objects:
if obj == obj_act:
continue
if self.pivot_type == 'ACTIVE':
More information about the Bf-blender-cvs
mailing list