Convex decomposition physics cannot be disabled
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 518
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the issue
When convex decomposition parts are built for an object, disabling the rigid body does not properly work anymore. This appears to be due to the created parts objects not being removed or their rigid bodies being disabled.
This prevents the physics simulation from terminating once objects stop moving and can significantly impact performance.
### Minimal code example
```python
import blenderproc as bproc
bproc.init()
obj = bproc.object.create_primitive('MONKEY')
print("=== Testing convex hull rigid body ===")
obj.enable_rigidbody(active=True)
obj.disable_rigidbody()
bproc.object.simulate_physics_and_fix_final_poses()
print("=== Testing compound rigid body ===")
obj.enable_rigidbody(active=True, collision_shape='COMPOUND')
obj.build_convex_decomposition_collision_shape(".blenderproc")
obj.disable_rigidbody()
bproc.object.simulate_physics_and_fix_final_poses()
```
### Files required to run the code
_No response_
### Expected behavior
The rigid body parts should either be completely removed (would require rebuilding them if needed again later) or their rigid bodies should be disabled and potentially reenabled later.
### BlenderProc version
2.7.1
Contributor guide
Research direction
Start by reproducing the supplied Python example and trace enable_rigidbody, build_convex_decomposition_collision_shape, disable_rigidbody, and simulate_physics_and_fix_final_poses. Check how compound collision parts are created and tracked; done means disabling the original rigid body also stops the generated parts so the physics simulation terminates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blender, python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100