diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-22 17:17:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-22 17:24:06 +0300 |
commit | 8d4bad39c1490cd1defdc4956cf445173c64b9b6 (patch) | |
tree | 4e2a18618462dfa13c0d943c3c38ab56838f2b86 /source/blender/depsgraph/intern/depsgraph_physics.cc | |
parent | 102631486b480d98c2d9b921a95472688bba8416 (diff) |
Fix T60742, T55974: crash using mesh/curve surface force fields.
Missing dependency graph relations caused race conditions.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_physics.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_physics.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc index 88d4c25f726..8d1b923f834 100644 --- a/source/blender/depsgraph/intern/depsgraph_physics.cc +++ b/source/blender/depsgraph/intern/depsgraph_physics.cc @@ -148,14 +148,22 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, if (relation->pd->forcefield == skip_forcefield) { continue; } + + /* Relation to forcefield object, optionally including geometry. + * Use special point cache relations for automatic cache clearing. */ DEG_add_object_pointcache_relation( handle, relation->ob, DEG_OB_COMP_TRANSFORM, name); - if (relation->psys) { + + if (relation->psys || + ELEM(relation->pd->shape, PFIELD_SHAPE_SURFACE, PFIELD_SHAPE_POINTS)) + { /* TODO(sergey): Consider going more granular with more dedicated * particle system operation. */ DEG_add_object_pointcache_relation( handle, relation->ob, DEG_OB_COMP_GEOMETRY, name); } + + /* Smoke flow relations. */ if (relation->pd->forcefield == PFIELD_SMOKEFLOW && relation->pd->f_source != NULL) { @@ -168,6 +176,8 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, DEG_OB_COMP_GEOMETRY, "Smoke Force Domain"); } + + /* Absorption forces need collision relation. */ if (add_absorption && (relation->pd->flag & PFIELD_VISIBILITY)) { DEG_add_collision_relations(handle, object, |