Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/functions/FN_generic_virtual_list_list_ref.h12
-rw-r--r--source/blender/functions/FN_generic_virtual_list_ref.h16
-rw-r--r--source/blender/functions/intern/multi_functions/network.h21
3 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/functions/FN_generic_virtual_list_list_ref.h b/source/blender/functions/FN_generic_virtual_list_list_ref.h
index 7a309780bb7..9ccaef6b019 100644
--- a/source/blender/functions/FN_generic_virtual_list_list_ref.h
+++ b/source/blender/functions/FN_generic_virtual_list_list_ref.h
@@ -81,6 +81,18 @@ class GenericVirtualListListRef {
return *m_type;
}
+ bool is_single_list() const
+ {
+ switch (m_category) {
+ case Category::SingleArray:
+ return true;
+ case Category::FullArrayList:
+ return m_virtual_list_size == 1;
+ }
+ BLI_assert(false);
+ return false;
+ }
+
GenericVirtualListRef operator[](uint index) const
{
BLI_assert(index < m_virtual_list_size);
diff --git a/source/blender/functions/FN_generic_virtual_list_ref.h b/source/blender/functions/FN_generic_virtual_list_ref.h
index 7bb38edc992..0646a18a210 100644
--- a/source/blender/functions/FN_generic_virtual_list_ref.h
+++ b/source/blender/functions/FN_generic_virtual_list_ref.h
@@ -123,6 +123,22 @@ class GenericVirtualListRef {
}
}
+ bool is_single_element() const
+ {
+ switch (m_category) {
+ case Category::Single:
+ return true;
+ case Category::FullArray:
+ return m_virtual_size == 1;
+ case Category::FullPointerArray:
+ return m_virtual_size == 1;
+ case Category::RepeatedArray:
+ return m_data.repeated_array.real_size == 1;
+ }
+ BLI_assert(false);
+ return false;
+ }
+
uint size() const
{
return m_virtual_size;
diff --git a/source/blender/functions/intern/multi_functions/network.h b/source/blender/functions/intern/multi_functions/network.h
index 59bdea92dcd..628ea32373e 100644
--- a/source/blender/functions/intern/multi_functions/network.h
+++ b/source/blender/functions/intern/multi_functions/network.h
@@ -137,6 +137,27 @@ class MF_EvaluateNetwork final : public MultiFunction {
BLI_assert(false);
return false;
}
+
+ bool function_input_has_single_element(const MFInputSocket &socket) const
+ {
+ BLI_assert(socket.node().is_function());
+ MFParamType param_type = socket.param_type();
+ switch (param_type.type()) {
+ case MFParamType::SingleInput:
+ return m_virtual_list_for_inputs.lookup(socket.id()).is_single_element();
+ case MFParamType::VectorInput:
+ return m_virtual_list_list_for_inputs.lookup(socket.id()).is_single_list();
+ case MFParamType::MutableSingle:
+ return m_array_ref_for_inputs.lookup(socket.id()).size() == 1;
+ case MFParamType::MutableVector:
+ return m_vector_array_for_inputs.lookup(socket.id())->size() == 1;
+ case MFParamType::SingleOutput:
+ case MFParamType::VectorOutput:
+ break;
+ }
+ BLI_assert(false);
+ return false;
+ }
};
void call(MFMask mask, MFParams params, MFContext context) const override;