Blender Git Loki

Git Commits -> Revision ac290bf

Revision ac290bf by Alexander Gavrilov (master)
January 11, 2021, 16:34 (GMT)
Collision: allow disabling collision without removing the modifier.

The `object.collision.use` flag was treated as a redundant marker
of the existence of the modifier, going as far as adding/removing
it when the value was changed, which is not actually very useful.
Removing the modifier loses its position in the stack, and requires
a dependency graph rebuild. It feels it may be a legacy flag?

What would be useful however is the ability to toggle collisions
dynamically without removing the modifier. This patch adjusts the
code to keep the modifier when the flag is disabled, and add it
if it doesn't exist when the flag is enabled. The modifier now
checks the flag at the start and quickly exits after cleaning
up stale data. The redesigned setting is exposed in the UI.

Collisions can't be disabled by simply using the modifier enable
flags because the modifier merely saves a snapshot of the mesh at
a certain point of the modifier stack for other objects to use,
and thus has to be able to clear the stale data.

Differential Revision: https://developer.blender.org/D10064

Commit Details:

Full Hash: ac290bfbe434df43fea19f7130313a1769aefdad
Parent Commit: b271475
Lines Changed: +23, -18

5 Modified Paths:

/release/scripts/startup/bl_ui/properties_physics_common.py (+5, -1) (Diff)
/source/blender/blenkernel/intern/collision.c (+5, -6) (Diff)
/source/blender/makesrna/intern/rna_object_force.c (+2, -4) (Diff)
/source/blender/modifiers/intern/MOD_collision.c (+10, -5) (Diff)
/source/blender/modifiers/intern/MOD_ui_common.c (+1, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021