diff options
4 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 7de3c169737..db1e8aeb9bd 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -90,6 +90,7 @@ extern "C" { #include "BKE_node.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BKE_rigidbody.h" #include "BKE_sound.h" #include "BKE_tracking.h" @@ -905,6 +906,13 @@ void DepsgraphNodeBuilder::build_particles(Object *object) } /* TODO(sergey): Do we need a point cache operations here? */ + add_operation_node(&object->id, + DEG_NODE_TYPE_CACHE, + function_bind(BKE_ptcache_object_reset, + scene_cow, + ob_cow, + PTCACHE_RESET_DEPSGRAPH), + DEG_OPCODE_POINT_CACHE_RESET); } void DepsgraphNodeBuilder::build_particle_settings(ParticleSettings *part) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 9733fbcb123..31c85a40f0e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1532,7 +1532,11 @@ void DepsgraphRelationBuilder::build_particles(Object *object) ComponentKey transform_key(&object->id, DEG_NODE_TYPE_TRANSFORM); add_relation(transform_key, obdata_ubereval_key, "Partcile Eval"); - /* TODO(sergey): Do we need a point cache operations here? */ + OperationKey point_cache_reset_key(&object->id, + DEG_NODE_TYPE_CACHE, + DEG_OPCODE_POINT_CACHE_RESET); + add_relation(transform_key, point_cache_reset_key, "Object Transform -> Point Cache Reset"); + add_relation(point_cache_reset_key, obdata_ubereval_key, "Point Cache Reset -> UberEval"); } void DepsgraphRelationBuilder::build_particle_settings(ParticleSettings *part) diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cc b/source/blender/depsgraph/intern/depsgraph_type_defines.cc index 22df3161428..886601225c7 100644 --- a/source/blender/depsgraph/intern/depsgraph_type_defines.cc +++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cc @@ -119,6 +119,8 @@ static const char *stringify_opcode(eDepsOperation_Code opcode) STRINGIFY_OPCODE(PARTICLE_SYSTEM_EVAL); STRINGIFY_OPCODE(PARTICLE_SETTINGS_EVAL); STRINGIFY_OPCODE(PARTICLE_SETTINGS_RECALC_CLEAR); + /* Point Cache. */ + STRINGIFY_OPCODE(POINT_CACHE_RESET); /* Batch cache. */ STRINGIFY_OPCODE(GEOMETRY_SELECT_UPDATE); /* Masks. */ diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index d091f42bf80..3f4df21b8d6 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -240,6 +240,9 @@ typedef enum eDepsOperation_Code { DEG_OPCODE_PARTICLE_SETTINGS_EVAL, DEG_OPCODE_PARTICLE_SETTINGS_RECALC_CLEAR, + /* Point Cache. ------------------------------------- */ + DEG_OPCODE_POINT_CACHE_RESET, + /* Collections. ------------------------------------- */ DEG_OPCODE_VIEW_LAYER_INIT, DEG_OPCODE_VIEW_LAYER_EVAL, |