add_rigid_body_constraint
Connect two rigid bodies with fixed, hinge, slider, piston, spring, or motor constraints to create joints, doors, and breakable assemblies in Blender.
Instructions
Join two rigid bodies with a physics constraint (glue, hinge, slider, spring, motor).
Both objects need add_rigid_body first. The constraint lives on a new empty, placed at the midpoint unless location is given; HINGE turns around the empty's Z axis, SLIDER and PISTON move along its X.
Args: object1: First rigid body. object2: Second rigid body. type: FIXED (glued), POINT (ball joint), HINGE, SLIDER, PISTON, GENERIC (per-axis limits), GENERIC_SPRING, MOTOR. empty_name: Name of the new empty that holds the constraint. location: World position of the joint, [x, y, z]. rotation: Joint orientation in radians, [x, y, z]; aims the hinge axis. breaking_threshold: Impulse that snaps the joint; omit for unbreakable. Good for destruction: glue pieces with FIXED and a threshold. disable_collisions: Stop the two bodies colliding with each other. settings: The constraint's own settings, e.g. {"use_limit_ang_z": true, "limit_ang_z_lower": -1.57, "limit_ang_z_upper": 0} for a door, spring_stiffness_x, motor_ang_target_velocity, use_motor_ang.
Returns: Dict with the empty, the type and the two objects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | FIXED | |
| object1 | Yes | ||
| object2 | Yes | ||
| location | No | ||
| rotation | No | ||
| settings | No | ||
| empty_name | No | Constraint | |
| breaking_threshold | No | ||
| disable_collisions | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||