diff options
author | Jacques Lucke <jacques@blender.org> | 2020-05-13 13:39:17 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-05-13 13:39:17 +0300 |
commit | b55c78a289c600696282f97191d6e800a1c1ac34 (patch) | |
tree | a17132a55b05b0e90e5a1ed4ada7d153b9d4e116 /source/blender/depsgraph/intern/depsgraph_build.cc | |
parent | 23fd95458c264dc53f5ce94cd2c65404a69d0f6f (diff) |
Simulation: Add modifier to access simulation data
For now the "Simulation" modifier only exists for point cloud objects, because
we need this for the particle system. Right now, the modifier is doing nothing.
There is a new `DEG_add_simulation_relation` function that is used
by the modifier to make sure that the simulation is evaluated before
the modifier is executed.
Reviewers: brecht, sergey
Differential Revision: https://developer.blender.org/D7549
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_build.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 9e12d00b42f..9e50bd87d6c 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -34,6 +34,7 @@ #include "DNA_cachefile_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_simulation_types.h" #include "BKE_main.h" #include "BKE_scene.h" @@ -103,6 +104,16 @@ void DEG_add_object_relation(DepsNodeHandle *node_handle, deg_node_handle->builder->add_node_handle_relation(comp_key, deg_node_handle, description); } +void DEG_add_simulation_relation(DepsNodeHandle *node_handle, + Simulation *simulation, + const char *description) +{ + DEG::OperationKey operation_key( + &simulation->id, DEG::NodeType::SIMULATION, DEG::OperationCode::SIMULATION_EVAL); + DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); + deg_node_handle->builder->add_node_handle_relation(operation_key, deg_node_handle, description); +} + void DEG_add_object_cache_relation(DepsNodeHandle *node_handle, CacheFile *cache_file, eDepsObjectComponentType component, |