diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-22 18:04:18 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-22 20:16:33 +0300 |
commit | e0400d0a1c76d019dc52efe96e869948464aff61 (patch) | |
tree | a5e8feeb50c5d7c13ea189c5470bff5b0804c73c /source/blender/simulation/intern/simulation_collect_influences.cc | |
parent | 0a5ef40c2cd77a5c8dfdbcc888759fb0dab9e184 (diff) |
Simulation: move responsibility of updating persistent data handles
This solver should not be responsible for updating the handles.
Diffstat (limited to 'source/blender/simulation/intern/simulation_collect_influences.cc')
-rw-r--r-- | source/blender/simulation/intern/simulation_collect_influences.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/simulation/intern/simulation_collect_influences.cc b/source/blender/simulation/intern/simulation_collect_influences.cc index 764e587d157..bbc28077dff 100644 --- a/source/blender/simulation/intern/simulation_collect_influences.cc +++ b/source/blender/simulation/intern/simulation_collect_influences.cc @@ -23,6 +23,8 @@ #include "NOD_node_tree_multi_function.hh" +#include "DEG_depsgraph_query.h" + #include "BLI_rand.hh" namespace blender::sim { @@ -434,8 +436,8 @@ static void prepare_particle_attribute_builders(nodes::MFNetworkTreeMap &network } } -static void find_used_data_blocks(const nodes::DerivedNodeTree &tree, - SimulationInfluences &r_influences) +static void find_used_persistent_data(const nodes::DerivedNodeTree &tree, + UsedPersistentData &r_used_persistent_data) { const bNodeSocketType *socktype = nodeSocketTypeFind("NodeSocketObject"); BLI_assert(socktype != nullptr); @@ -443,9 +445,9 @@ static void find_used_data_blocks(const nodes::DerivedNodeTree &tree, for (const nodes::DInputSocket *dsocket : tree.input_sockets()) { const bNodeSocket *bsocket = dsocket->bsocket(); if (bsocket->typeinfo == socktype) { - Object *value = ((const bNodeSocketValueObject *)bsocket->default_value)->value; - if (value != nullptr) { - r_influences.used_data_blocks.add(&value->id); + Object *object = ((const bNodeSocketValueObject *)bsocket->default_value)->value; + if (object != nullptr) { + r_used_persistent_data.add(DEG_get_original_id(&object->id)); } } } @@ -454,7 +456,8 @@ static void find_used_data_blocks(const nodes::DerivedNodeTree &tree, void collect_simulation_influences(Simulation &simulation, ResourceCollector &resources, SimulationInfluences &r_influences, - RequiredStates &r_required_states) + RequiredStates &r_required_states, + UsedPersistentData &r_used_persistent_data) { nodes::NodeTreeRefMap tree_refs; const nodes::DerivedNodeTree tree{simulation.nodetree, tree_refs}; @@ -479,7 +482,7 @@ void collect_simulation_influences(Simulation &simulation, r_required_states.add(dnode_to_path(*dnode), SIM_TYPE_NAME_PARTICLE_SIMULATION); } - find_used_data_blocks(tree, r_influences); + find_used_persistent_data(tree, r_used_persistent_data); } } // namespace blender::sim |