[Bf-blender-cvs] [522868001c5] master: Functions: simplify adding a single input to a multi-function

Jacques Lucke noreply at git.blender.org
Thu May 13 13:39:41 CEST 2021


Commit: 522868001c5bc1f6f4a8dc214202896224f2fc70
Author: Jacques Lucke
Date:   Thu May 13 13:23:53 2021 +0200
Branches: master
https://developer.blender.org/rB522868001c5bc1f6f4a8dc214202896224f2fc70

Functions: simplify adding a single input to a multi-function

This is used by the upcoming new geometry nodes evaluator.

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

M	source/blender/functions/FN_multi_function_params.hh

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

diff --git a/source/blender/functions/FN_multi_function_params.hh b/source/blender/functions/FN_multi_function_params.hh
index 3b15f0278f3..e292d11def7 100644
--- a/source/blender/functions/FN_multi_function_params.hh
+++ b/source/blender/functions/FN_multi_function_params.hh
@@ -27,6 +27,7 @@
 
 #include "BLI_resource_scope.hh"
 
+#include "FN_generic_pointer.hh"
 #include "FN_generic_vector_array.hh"
 #include "FN_generic_virtual_vector_array.hh"
 #include "FN_multi_function_signature.hh"
@@ -64,6 +65,12 @@ class MFParamsBuilder {
     this->add_readonly_single_input(scope_.construct<GVArray_For_GSpan>(__func__, span),
                                     expected_name);
   }
+  void add_readonly_single_input(GPointer value, StringRef expected_name = "")
+  {
+    this->add_readonly_single_input(scope_.construct<GVArray_For_SingleValueRef>(
+                                        __func__, *value.type(), min_array_size_, value.get()),
+                                    expected_name);
+  }
   void add_readonly_single_input(const GVArray &ref, StringRef expected_name = "")
   {
     this->assert_current_param_type(MFParamType::ForSingleInput(ref.type()), expected_name);



More information about the Bf-blender-cvs mailing list