0
$\begingroup$

I'd like to enable the rigid body settings for a set of objects, and I don't want to use bpy.ops.rigid_body.object_add(). I see that objects have the property object.rigid_body, which is read-only. So how do I create the rigid body settings, and assign them to object.rigid_body?

$\endgroup$
1
$\begingroup$

This question is related to How do I add a rigidbody to an object with python?.

In 2.8 you need to use collections, so if you want to add rigid body physics to object my_object for scene 'Scene':

bpy.data.scenes['Scene'].rigidbody_world.collection.objects.link(my_object)

and verify outcome with

my_object.rigid_body is not None
$\endgroup$
  • $\begingroup$ @batFINGER I updated the variable name to my_object. Thanks. $\endgroup$ – Dazotaro Apr 10 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.