1

I cant get the mesh to not wig out after it falls.

I'm guessing I need the bones to fall with the mesh so the mesh deforms relative to the bones. I can't figure out how to do this and nothing I've googled has helped.

Any help would be greatly appreciated!

enter image description here

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187

1 Answers1

2

You can't. Armature are not supported in context with the rigid body sytem. The behaviour occurs, since the Armature is evaluated after the rigid body simulation. You can't change the order of evaluation (as in Maya e.g.).

Shapekey however, get evaluated before rigid bodies.

Use this hacky script to transfer your animation into shapekeys. (Refine it first, then use it!)
To make this script work, the active object:

  • has to be selected
  • has to have an Armature modifier name "Armature"
  • has to have no Armature modifier name "Armature.001"
  • has to have a "Basis" Shapekey

import bpy

scn = bpy.context.scene

frame_range = [1, 200]
for i in range(frame_range[0], frame_range[1] + 1):
    scn.frame_set(i)
    bpy.ops.object.modifier_copy(modifier="Armature")
    bpy.ops.object.modifier_apply(apply_as='SHAPE', modifier='Armature.001')
    bpy.data.shape_keys["Key"].key_blocks["Armature.001"].name = str(i).zfill(3)


key = bpy.context.selected_objects[0].data.shape_keys.key_blocks


for i in range(frame_range[0], frame_range[1] + 1):
    key[str(i).zfill(3)].value = 0
    key[str(i).zfill(3)].keyframe_insert(data_path="value", frame=(i+1))
    key[str(i).zfill(3)].keyframe_insert(data_path="value", frame=(i-1))
    key[str(i).zfill(3)].value = 1
    key[str(i).zfill(3)].keyframe_insert(data_path="value", frame=i)

  1. Disable the rigid body, by checking its animated property.
  2. Create the Basis Shapekey.
  3. Execute the script.
  4. Hide the Armature modifier.

enter image description here

The animation is now transfered to shapekeys.

Disable the animated property again to simulate.

If you wish to change the animation, delete all shapekeys and enable the armature modifier again.

Leander
  • 26,725
  • 2
  • 44
  • 105