Rigid Body Physics forces no longer restricted to specific layers/collections #87458

Open
opened 2021-04-13 10:16:21 +02:00 by Rich Sedman · 8 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Intel(R) Iris(R) Plus Graphics Intel 4.5.0 - Build 26.20.100.7641

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-24 17:47, hash: 9ac7946dd0
Worked: (newest version of Blender that worked as expected)

Short description of error
Prior to Blender version 2.8, forces would only affect rigid body objects within the same layers. With later versions the scene is managed via Collections but despite forces being able to be placed in any number of collections, all forces seem to affect rigid bodies in all collections.

Note that saving a file with mulitple forces in different layers in Blender version 2.79b and loading into 2.93 Alpha does seem to retain the layer structure by creating an additional collection for the objects in different layers but the forces no longer work the same.

Exact steps for others to reproduce the error
Add Rigid Body Physics to the default cube and duplicate it to a second cube. Move the second cube into a different collection. Switch off Scene Gravity. Create two forces that would affect the two cubes in different ways (eg, place one above one cube and the other below the other cube) and move the forces to the respective collection relating to its associated cube. This should result in each force affecting only one of the cubes (since they are in different collections). However, running the simulation results in both cubes being affected by both forces - rather than just the force in its own collection.

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: Intel(R) Iris(R) Plus Graphics Intel 4.5.0 - Build 26.20.100.7641 **Blender Version** Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-24 17:47, hash: `9ac7946dd0` Worked: (newest version of Blender that worked as expected) **Short description of error** Prior to Blender version 2.8, forces would only affect rigid body objects within the same layers. With later versions the scene is managed via Collections but despite forces being able to be placed in any number of collections, all forces seem to affect rigid bodies in all collections. Note that saving a file with mulitple forces in different layers in Blender version 2.79b and loading into 2.93 Alpha does seem to retain the layer structure by creating an additional collection for the objects in different layers but the forces no longer work the same. **Exact steps for others to reproduce the error** Add Rigid Body Physics to the default cube and duplicate it to a second cube. Move the second cube into a different collection. Switch off Scene Gravity. Create two forces that would affect the two cubes in different ways (eg, place one above one cube and the other below the other cube) and move the forces to the respective collection relating to its associated cube. This should result in each force affecting only one of the cubes (since they are in different collections). However, running the simulation results in both cubes being affected by both forces - rather than just the force in its own collection.
Author

Added subscriber: @BaldingWizard

Added subscriber: @BaldingWizard
Author

Blender 2.79b physics force multi-layer test.blend

Loading the above file in Blender 2.79b produces the expected result (where one cube is accelerated upwards and the other down). Opening in 2.93Alpha produces unexpected results (with both cubes being affected by both forces - despite the file being loaded with the different forces and cubes being in different collections (so the loading of the layers works into separate collections but those collections aren't being interpreted in the same way as previously).

At 2.79b :
good physics.gif

At 2.93Alpha (same file) :
bad physics.gif

[Blender 2.79b physics force multi-layer test.blend](https://archive.blender.org/developer/F9931529/Blender_2.79b_physics_force_multi-layer_test.blend) Loading the above file in Blender 2.79b produces the expected result (where one cube is accelerated upwards and the other down). Opening in 2.93Alpha produces unexpected results (with both cubes being affected by both forces - despite the file being loaded with the different forces and cubes being in different collections (so the loading of the layers works into separate collections but those collections aren't being interpreted in the same way as previously). At 2.79b : ![good physics.gif](https://archive.blender.org/developer/F9931536/good_physics.gif) At 2.93Alpha (same file) : ![bad physics.gif](https://archive.blender.org/developer/F9931538/bad_physics.gif)
Member

Added subscribers: @JacquesLucke, @ZedDB, @brecht, @lichtwerk

Added subscribers: @JacquesLucke, @ZedDB, @brecht, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I am a bit on shaky ground, but it indeed looks like this has changed to the worse here.

Documentation is not very clear here as well:
https://docs.blender.org/manual/en/dev/physics/rigid_body/world.html

You can create several Rigid Body World Collections and allocate the rigid body objects with the Collections panel.
Rigid body objects and constraints are only taken into account by the simulation if they are in the collection specified in the Collection field of the Rigid Body World panel in the Scene tab.

But it is unclear how you would actually have multiple collections in parallel.
And while the "old-style" layers for collisions was kept, this was not done for forces.

Afaict, you can still split this up in view layers / renderlayers like so:
Blender 2.93 physics force multi-layer test_viewlayers.blend
(but that comes with its own set of restrictions -- you then have to deal with comping these layers back together).

Summoning insights from (module) devs here on how the current design is supposed to work for rigid bodies and forces (but will confirm for now).
CC @JacquesLucke
CC @brecht
CC @ZedDB

I am a bit on shaky ground, but it indeed looks like this has changed to the worse here. Documentation is not very clear here as well: https://docs.blender.org/manual/en/dev/physics/rigid_body/world.html > You can create several Rigid Body World Collections and allocate the rigid body objects with the Collections panel. > Rigid body objects and constraints are only taken into account by the simulation if they are in the collection specified in the Collection field of the Rigid Body World panel in the Scene tab. But it is unclear how you would actually have multiple collections in parallel. And while the "old-style" layers for **collisions** was kept, this was not done for forces. Afaict, you can still split this up in `view layers` / `renderlayers` like so: [Blender 2.93 physics force multi-layer test_viewlayers.blend](https://archive.blender.org/developer/F9931561/Blender_2.93_physics_force_multi-layer_test_viewlayers.blend) (but that comes with its own set of restrictions -- you then have to deal with comping these layers back together). Summoning insights from (module) devs here on how the current design is supposed to work for rigid bodies and forces (but will confirm for now). CC @JacquesLucke CC @brecht CC @ZedDB

I think this is something that was lost when we removed the viewport layers/groups.

As Philipp pointed out, you can no longer separate the forces because of this.

However most of the rigid body code should probably be rewritten as there are many quirks and bugs that happens because of the current state of it.

I think this particular issue could be solved by copying the "collision collection" methodology from the cloth sim.
IE you can specify a collection that has effectors that should exert forces on the rigid body in question.
If no collection is specified, all effectors in the scene will exert forces on it.

However I'm currently working on fixing and adding feature for the animation system.
So I don't know when I will have time allocated to work on this.

Therefore, I will mark this as a known issue.

If someone wants to work on this, they can ping me and I'll try to provide guidance.

I think this is something that was lost when we removed the viewport layers/groups. As Philipp pointed out, you can no longer separate the forces because of this. However most of the rigid body code should probably be rewritten as there are many quirks and bugs that happens because of the current state of it. I think this particular issue could be solved by copying the "collision collection" methodology from the cloth sim. IE you can specify a collection that has effectors that should exert forces on the rigid body in question. If no collection is specified, all effectors in the scene will exert forces on it. However I'm currently working on fixing and adding feature for the animation system. So I don't know when I will have time allocated to work on this. Therefore, I will mark this as a known issue. If someone wants to work on this, they can ping me and I'll try to provide guidance.

Added subscriber: @jamestomk

Added subscriber: @jamestomk
Contributor

Added subscriber: @p2or

Added subscriber: @p2or
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:44:52 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87458
No description provided.