From cc388651eb48e73470c53c185840f74d950cb38d Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 24 Oct 2021 17:53:19 +0200 Subject: Fix T92327: use default value when field is passed into data socket Previously, the computed value passed into the data socket could depend on the actual field a bit. However, given that the link is marked as invalid in the ui, the user should not depend on this behavior. Using a default value is consistent with other cases when there are invalid links. --- source/blender/functions/intern/field.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender') diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc index c6125b65c5e..5c13db9ec17 100644 --- a/source/blender/functions/intern/field.cc +++ b/source/blender/functions/intern/field.cc @@ -477,6 +477,12 @@ Vector evaluate_fields(ResourceScope &scope, void evaluate_constant_field(const GField &field, void *r_value) { + if (field.node().depends_on_input()) { + const CPPType &type = field.cpp_type(); + type.copy_construct(type.default_value(), r_value); + return; + } + ResourceScope scope; FieldContext context; Vector varrays = evaluate_fields(scope, {field}, IndexRange(1), context); -- cgit v1.2.3