Untill the blender 4.0, due to the blender rigid body crash bug and uncontroable, this code will not ensure anything. Do not use this in your product environment.
Blender rigid body simulation is unstable, it will crash in an indeterminate way when undo(ctrl+z) or animation playback(shift+space), please save the file before doing these two operations
this script is written and tested in blender 4.0.2(should be compatible with 3.x)
- Got a armature with bone which you want to add physics, the physics bone should connected by parent relationship to become chains, and the root of the chain should be child of a controller or character torso。
- enter armature pose mode
- select the bone chains you want to add physics
- click "Generate Rigid Body"
the rigid body object and joint object is available in "rigid&joint" collection
DEMO VIDEO:https://www.bilibili.com/video/BV1yN4y1h7R3