Fix T84369: Fluid: Missing cache invalidation when properties on non-domain objects change
The `DEG_OB_COMP_TRANSFORM` and `DEG_OB_COMP_GEOMETRY` relations between the **Domain** object and the **Flow**, **Effector** and **Force Field** objects are added in the `updateDepsgraph` callback of the Fluid modifier, more specifically in `DEG_add_collision_relations`. The node linked to these components is the `POINT_CACHE` whose assigned function is `BKE_ptcache_object_reset`. So include the `eModifierType_Fluid` modifier in outdated cache checks. Reviewed By: sergey, zeddb Maniphest Tasks: T84369 Differential Revision: https://developer.blender.org/D15210
This commit is contained in:
committed by
Germano Cavalcante
parent
a571c74e10
commit
67e23b4b29
@@ -3761,16 +3761,16 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
|
|||||||
MEM_freeN(objs);
|
MEM_freeN(objs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO(sebbas): Cache reset for when flow / effector object need update flag is set. */
|
/* If 'outdated', reset the cache here. */
|
||||||
# if 0
|
if (is_startframe && mode == FLUID_DOMAIN_CACHE_REPLAY) {
|
||||||
/* If the just updated flags now carry the 'outdated' flag, reset the cache here!
|
PTCacheID pid;
|
||||||
* Plus sanity check: Do not clear cache on file load. */
|
BKE_ptcache_id_from_smoke(&pid, ob, fmd);
|
||||||
if (fds->cache_flag & FLUID_DOMAIN_OUTDATED_DATA &&
|
if (pid.cache->flag & PTCACHE_OUTDATED) {
|
||||||
((fds->flags & FLUID_DOMAIN_FILE_LOAD) == 0)) {
|
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
|
||||||
BKE_fluid_cache_free_all(fds, ob);
|
BKE_fluid_cache_free_all(fds, ob);
|
||||||
BKE_fluid_modifier_reset_ex(fmd, false);
|
BKE_fluid_modifier_reset_ex(fmd, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Fluid domain init must not fail in order to continue modifier evaluation. */
|
/* Fluid domain init must not fail in order to continue modifier evaluation. */
|
||||||
if (!fds->fluid && !BKE_fluid_modifier_init(fmd, depsgraph, ob, scene, me)) {
|
if (!fds->fluid && !BKE_fluid_modifier_init(fmd, depsgraph, ob, scene, me)) {
|
||||||
|
|||||||
@@ -2980,6 +2980,15 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (md->type == eModifierType_Fluid) {
|
||||||
|
FluidModifierData *fmd = (FluidModifierData *)md;
|
||||||
|
FluidDomainSettings *fds = fmd->domain;
|
||||||
|
if ((fmd->type & MOD_FLUID_TYPE_DOMAIN) && fds &&
|
||||||
|
fds->cache_type == FLUID_DOMAIN_CACHE_REPLAY) {
|
||||||
|
BKE_ptcache_id_from_smoke(&pid, ob, fmd);
|
||||||
|
reset |= BKE_ptcache_id_reset(scene, &pid, mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scene->rigidbody_world && (ob->rigidbody_object || ob->rigidbody_constraint)) {
|
if (scene->rigidbody_world && (ob->rigidbody_object || ob->rigidbody_constraint)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user