# How do you copy things like rigidbody constraints and force fields to other objects?

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

• there is a copy physics settings in the physics tab "on the left" and you can copy constraints "type in space bar copy constraints" and if you enable "copy attribute menu" addon use Ctrl+C – Chebhou Feb 14 '15 at 8:14
• @Chebhou yeah it works to search in space bar for it – Chickenator Feb 14 '15 at 8:16
• does that solve the problem ? – Chebhou Feb 14 '15 at 8:18
• @Chebhou it doesn't work. It changes the settings to existing rigid body constraints but it doesn't add new ones. I need it to copy the setting but also add new ones to where there isn't rigidbody constraint – Chickenator Feb 14 '15 at 8:21

## 1 Answer

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 constraints from one object to others :

• 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

• sorry I don't understand how python works or how to add a script. And how would it work to add constraints to every object? – Chickenator Feb 14 '15 at 8:39
• you can add constraints with the copy option that i gave you in the comment, this answer is to add forcefield only – Chebhou Feb 14 '15 at 8:43
• i will edit to include the constraints – Chebhou Feb 14 '15 at 8:44
• It's not working. I have the active object as the one with constraints but it still doesn't add constraints to the other object. It just only has the rigidbody setting in the physics tab and no rigid body constraint – Chickenator Feb 14 '15 at 8:53
• ok , i'll edit to include the physics constraints – Chebhou Feb 14 '15 at 8:57