Merged changes in the trunk up to revision 54594.
This commit is contained in:
@@ -54,7 +54,7 @@ class CopyRigidbodySettings(Operator):
|
||||
for o in objects:
|
||||
if o.rigid_body is None:
|
||||
continue
|
||||
|
||||
|
||||
o.rigid_body.type = obj.rigid_body.type
|
||||
o.rigid_body.kinematic = obj.rigid_body.kinematic
|
||||
o.rigid_body.mass = obj.rigid_body.mass
|
||||
@@ -144,7 +144,7 @@ class BakeToKeyframes(Operator):
|
||||
# this is a little roundabout but there's no better way right now
|
||||
aa = mat.to_quaternion().to_axis_angle()
|
||||
obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
|
||||
else: # euler
|
||||
else: # euler
|
||||
# make sure euler rotation is compatible to previous frame
|
||||
obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
|
||||
|
||||
@@ -190,7 +190,8 @@ class BakeToKeyframes(Operator):
|
||||
|
||||
|
||||
class ConnectRigidBodies(Operator):
|
||||
'''Create rigid body constraints between selected and active rigid bodies'''
|
||||
"""Create rigid body constraints between """ \
|
||||
"""selected and active rigid bodies"""
|
||||
bl_idname = "rigidbody.connect"
|
||||
bl_label = "Connect Rigid Bodies"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@@ -232,7 +233,11 @@ class ConnectRigidBodies(Operator):
|
||||
loc = obj.location
|
||||
else:
|
||||
loc = (obj_act.location + obj.location) / 2.0
|
||||
bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=loc)
|
||||
# TODO: use bpy.data.objects.new(...)
|
||||
bpy.ops.object.add(type='EMPTY',
|
||||
view_align=False,
|
||||
enter_editmode=False,
|
||||
location=loc)
|
||||
bpy.ops.rigidbody.constraint_add()
|
||||
con_obj = context.active_object
|
||||
con_obj.empty_draw_type = 'ARROWS'
|
||||
@@ -241,12 +246,12 @@ class ConnectRigidBodies(Operator):
|
||||
con.object1 = obj_act
|
||||
con.object2 = obj
|
||||
change = True
|
||||
|
||||
|
||||
if change:
|
||||
# restore selection
|
||||
bpy.ops.object.select_all(action='DESELECT')
|
||||
for obj in objects:
|
||||
obj.select = True;
|
||||
obj.select = True
|
||||
scene.objects.active = obj_act
|
||||
return {'FINISHED'}
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user