diff options
author | Jacques Lucke <jacques@blender.org> | 2021-10-24 18:53:19 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-10-24 18:53:19 +0300 |
commit | cc388651eb48e73470c53c185840f74d950cb38d (patch) | |
tree | b56ef4e9bf62b9e96876ebd18093e713b3c449a2 | |
parent | 6ce383a9dfba5c49a48676c3a651804fde3dfe34 (diff) |
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.
-rw-r--r-- | source/blender/functions/intern/field.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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<const GVArray *> 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<const GVArray *> varrays = evaluate_fields(scope, {field}, IndexRange(1), context); |