[Bf-blender-cvs] [764857eb370] functions: fix: find IDs used by output sockets as well

Jacques Lucke noreply at git.blender.org
Fri Dec 13 19:42:54 CET 2019


Commit: 764857eb370c4910902c80d157ada6c4e00ebaa4
Author: Jacques Lucke
Date:   Fri Dec 13 19:42:49 2019 +0100
Branches: functions
https://developer.blender.org/rB764857eb370c4910902c80d157ada6c4e00ebaa4

fix: find IDs used by output sockets as well

===================================================================

M	source/blender/functions/FN_multi_function_dependencies.h
M	source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
M	source/blender/modifiers/intern/MOD_functionpoints_cxx.cc
M	source/blender/simulations/bparticles/node_frontend.cpp

===================================================================

diff --git a/source/blender/functions/FN_multi_function_dependencies.h b/source/blender/functions/FN_multi_function_dependencies.h
index af4a7b308b3..2086e33bdc5 100644
--- a/source/blender/functions/FN_multi_function_dependencies.h
+++ b/source/blender/functions/FN_multi_function_dependencies.h
@@ -15,10 +15,10 @@ using BKE::XGroupInput;
 using BKE::XInputSocket;
 using BLI::Set;
 
-inline Set<Object *> get_objects_used_by_inputs(const InlinedNodeTree &inlined_tree)
+inline Set<Object *> get_objects_used_by_sockets(const InlinedNodeTree &inlined_tree)
 {
   Set<Object *> objects;
-  for (const XInputSocket *xsocket : inlined_tree.all_input_sockets()) {
+  for (const XSocket *xsocket : inlined_tree.all_sockets()) {
     if (xsocket->idname() == "fn_ObjectSocket") {
       Object *object = (Object *)RNA_pointer_get(xsocket->rna(), "value").data;
       if (object != nullptr) {
@@ -37,10 +37,10 @@ inline Set<Object *> get_objects_used_by_inputs(const InlinedNodeTree &inlined_t
   return objects;
 }
 
-inline Set<Image *> get_images_used_by_inputs(const InlinedNodeTree &inlined_tree)
+inline Set<Image *> get_images_used_by_sockets(const InlinedNodeTree &inlined_tree)
 {
   Set<Image *> images;
-  for (const XInputSocket *xsocket : inlined_tree.all_input_sockets()) {
+  for (const XSocket *xsocket : inlined_tree.all_sockets()) {
     if (xsocket->idname() == "fn_ImageSocket") {
       Image *image = (Image *)RNA_pointer_get(xsocket->rna(), "value").data;
       if (image != nullptr) {
@@ -59,13 +59,13 @@ inline Set<Image *> get_images_used_by_inputs(const InlinedNodeTree &inlined_tre
   return images;
 }
 
-inline void add_ids_used_by_inputs(IDHandleLookup &id_handle_lookup,
-                                   const InlinedNodeTree &inlined_tree)
+inline void add_ids_used_by_nodes(IDHandleLookup &id_handle_lookup,
+                                  const InlinedNodeTree &inlined_tree)
 {
-  for (Object *object : get_objects_used_by_inputs(inlined_tree)) {
+  for (Object *object : get_objects_used_by_sockets(inlined_tree)) {
     id_handle_lookup.add(object->id);
   }
-  for (Image *image : get_images_used_by_inputs(inlined_tree)) {
+  for (Image *image : get_images_used_by_sockets(inlined_tree)) {
     id_handle_lookup.add(image->id);
   }
 }
diff --git a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
index 8c48ecff1cb..77cc00d17af 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
+++ b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
@@ -67,7 +67,7 @@ void MOD_functiondeform_do(FunctionDeformModifierData *fdmd,
   vertex_positions_context.positions = ArrayRef<float3>((float3 *)vertexCos, numVerts);
 
   BKE::IDHandleLookup id_handle_lookup;
-  FN::add_ids_used_by_inputs(id_handle_lookup, inlined_tree);
+  FN::add_ids_used_by_nodes(id_handle_lookup, inlined_tree);
 
   MFContextBuilder context_builder;
   context_builder.add_global_context(id_handle_lookup);
diff --git a/source/blender/modifiers/intern/MOD_functionpoints_cxx.cc b/source/blender/modifiers/intern/MOD_functionpoints_cxx.cc
index c6f0a8e2630..d0d59628b8a 100644
--- a/source/blender/modifiers/intern/MOD_functionpoints_cxx.cc
+++ b/source/blender/modifiers/intern/MOD_functionpoints_cxx.cc
@@ -58,7 +58,7 @@ Mesh *MOD_functionpoints_do(FunctionPointsModifierData *fpmd,
   time_context.time = DEG_get_ctime(ctx->depsgraph);
 
   BKE::IDHandleLookup id_handle_lookup;
-  FN::add_ids_used_by_inputs(id_handle_lookup, inlined_tree);
+  FN::add_ids_used_by_nodes(id_handle_lookup, inlined_tree);
 
   FN::MFContextBuilder context_builder;
   context_builder.add_global_context(id_handle_lookup);
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp b/source/blender/simulations/bparticles/node_frontend.cpp
index 047e1b48ebf..3d6593de83f 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -78,7 +78,7 @@ class InlinedTreeData {
   InlinedTreeData(InlinedTreeMFNetwork &inlined_tree_data)
       : m_inlined_tree_data_graph(inlined_tree_data)
   {
-    FN::add_ids_used_by_inputs(m_id_handle_lookup, inlined_tree_data.inlined_tree());
+    FN::add_ids_used_by_nodes(m_id_handle_lookup, inlined_tree_data.inlined_tree());
   }
 
   const InlinedNodeTree &inlined_tree()



More information about the Bf-blender-cvs mailing list