2
$\begingroup$

I would like to animate 500 or so shards to be "animated" rigid body at frame zero and "dynamic" at frame 550. Do I really have to set a keyframe for each individual object or is there a way to animate that rigid body property as a group? The shards are in a group, but it appears that the rigid body for a group of objects can only be set, not animated. I've tried using an empty parent object to no avail.

$\endgroup$
3
$\begingroup$

[Select the rigid body object and copy their properties (except for animated).]

  1. Select all rigid body object to be modified.
  2. Alt click on the Animated property. This will change the property for all the selected object to the same value. Now all object have animated enabled.
  3. Use this script to key the property on all of them.
import bpy
sel = bpy.context.selected_objects
for ob in sel:
    ob.rigid_body.keyframe_insert(data_path="enabled") 
    ob.rigid_body.keyframe_insert(data_path="kinematic")

Now all objects are keyed.

To remove all Animated keys on a frame, execute the script but replace keyframe_insert with keyframe_delete.

$\endgroup$
  • $\begingroup$ Thank you so much, Leander. Please add the following line to your script, and then I will mark your answer as 100% helpful by clicking the checkmark: ob.rigid_body.keyframe_insert(data_path="enabled") $\endgroup$ – silvermanj7 May 3 '18 at 15:42
  • 1
    $\begingroup$ @silvermanj7 You're welcome, I have edited the line, feel free to edit it yourself, if I misunderstood $\endgroup$ – Leander May 3 '18 at 15:44
  • $\begingroup$ oh i didn't realize i had the power. thanks again. :)) $\endgroup$ – silvermanj7 May 3 '18 at 16:10

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.