Rigidbody Physics Refactor #100442
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#100442
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
The goal is to simplify the rigidbody physics code.
This ticket is being raised after discussions with @ZedDB about this issue https://developer.blender.org/T91369 and the related tickets regarding rigidbody physics crashes. I attempted to resolve those crashes on their own, but really struggled to find a sensible way to resolve some of the memory management issues that were occuring. @ZedDB mentioned that this was an area of the code in need of a redesign for some time, and with comments like below predicting this could be an issue, we decided it could be a good time to start tackling it.
Approach
I want to start with some smaller low hanging fruit, that wouldn't change any logic but will improve the readability of the code.
There is some dead code that can be removed
BKE_rigidbody_calc_center_of_mass
- probably worth keeping the logic but hiding with a#if 0
BKE_rigidbody_world_groups_relink
is only used byBKE_scene_groups_relink
which doesn't seem to be used anywhere else.It would make things much easier to follow by separating the simulation logic from the rididbody creation/deletion logic, into a separate
rigidbody_simulation.c
file.There is a lot of general tidy-up that would make the code more readable and easier to understand.
Once these tasks are completed we can start thinking about any larger design issues that need to be addressed - like with the memory management of the constraints. With more readable code, and a better understanding of the logic from the refactoring process, it should be a more solvable problem.
Added subscribers: @ZedDB, @SonnyCampbell_Unity
Just to have it in writing here:
I'm fine with these steps. I don't think any of the other developers will have any issues with these either.
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @mod_moder
Added subscriber: @PratikPB2123
Added subscriber: @vinegarshots
Glad to see this here. I'm working on a project that requires a rigid body chain with a bunch of rigid body constraints, and it's almost impossible to complete due to the nonstop crashing :(
Added subscriber: @lichtwerk