How do you copy things like rigidbody constraints and force fields to other objects?
I made a cell fracture and I would like to give each cell the same constraints and force fields.
Thanks in advance
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.
Sign up to join this communityHow do you copy things like rigidbody constraints and force fields to other objects?
I made a cell fracture and I would like to give each cell the same constraints and force fields.
Thanks in advance
to add force field to all selected objects :
import bpy
for ob in bpy.context.selected_objects :
bpy.context.scene.objects.active = ob
bpy.ops.object.forcefield_toggle()
to run the script copy it and paste in the text editor and cick Run Script
to copy rigid body constraints select the objects while the active object is the one with constraints and run this script :
import bpy
Type = bpy.context.active_object.rigid_body_constraint.type
obj1 = bpy.context.active_object.rigid_body_constraint.object1
obj2 = bpy.context.active_object.rigid_body_constraint.object2
use_br = bpy.context.active_object.rigid_body_constraint.use_breaking
over_itr = bpy.context.active_object.rigid_body_constraint.use_override_solver_iterations
for ob in bpy.context.selected_objects :
bpy.context.scene.objects.active = ob
bpy.ops.rigidbody.constraint_add(type = Type)
bpy.context.active_object.rigid_body_constraint.object1 = obj1
bpy.context.active_object.rigid_body_constraint.object2 = obj2
bpy.context.active_object.rigid_body_constraint.use_breaking = use_br
bpy.context.active_object.rigid_body_constraint.use_override_solver_iterations = over_itr