[Bf-blender-cvs] [568315b0b81] functions-experimental-refactor: make Get List Element node work again

Jacques Lucke noreply at git.blender.org
Wed Oct 30 17:36:14 CET 2019


Commit: 568315b0b814cddd19e65bf0bf5ba849f88c55a9
Author: Jacques Lucke
Date:   Wed Oct 30 16:39:33 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB568315b0b814cddd19e65bf0bf5ba849f88c55a9

make Get List Element node work again

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

M	source/blender/modifiers/intern/MOD_functiondeform_cxx.cc

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

diff --git a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
index 6de8c723255..e4af0fa7eff 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
+++ b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
@@ -410,6 +410,20 @@ static void INSERT_list_length(VTreeMFNetworkBuilder &builder,
   resources.add(std::move(function), "list length function");
 }
 
+static void INSERT_get_list_element(VTreeMFNetworkBuilder &builder,
+                                    OwnedResources &resources,
+                                    const VirtualNode &vnode)
+{
+  PointerRNA rna = vnode.rna();
+  char *type_name = RNA_string_get_alloc(&rna, "active_type", nullptr, 0);
+  const CPPType &type = get_cpp_type_by_name(type_name);
+  MEM_freeN(type_name);
+
+  auto function = BLI::make_unique<BKE::MultiFunction_GetListElement>(type);
+  builder.add_function(*function, {0, 1, 2}, {3}, vnode);
+  resources.add(std::move(function), "get list element");
+}
+
 static MFBuilderOutputSocket &build_pack_list_node(VTreeMFNetworkBuilder &builder,
                                                    OwnedResources &resources,
                                                    const VirtualNode &vnode,
@@ -474,6 +488,7 @@ static StringMap<InsertVNodeFunction> get_node_inserters()
   inserters.add_new("fn_SeparateVectorNode", INSERT_separate_vector);
   inserters.add_new("fn_ListLengthNode", INSERT_list_length);
   inserters.add_new("fn_PackListNode", INSERT_pack_list);
+  inserters.add_new("fn_GetListElementNode", INSERT_get_list_element);
   return inserters;
 }



More information about the Bf-blender-cvs mailing list