diff options
author | Hans Goudey <h.goudey@me.com> | 2021-02-25 17:20:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-02-25 17:20:02 +0300 |
commit | 626a8e0f10ef90415c3811567b789168484c0b88 (patch) | |
tree | d3e2e1d7ef85fdb35e84a7aad0acd01278455a2a | |
parent | bcd369c3c12e48dd2be544fbd3ebed2ce8b4c1fb (diff) |
Fix T85979: Attribute missing warning with empty geometry
An error doesn't make sense in these situations because we don't expect
to find attributes on empty geometry, and an empty geometry set is a
valid situation.
Note that we can't use `component.is_empty` here, because often the
component is visually "empty" but still has a point cloud with no
points or a mesh with no vertices.
-rw-r--r-- | source/blender/nodes/intern/node_geometry_exec.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc index 532f9955a62..a2e0a4dd6a4 100644 --- a/source/blender/nodes/intern/node_geometry_exec.cc +++ b/source/blender/nodes/intern/node_geometry_exec.cc @@ -75,8 +75,9 @@ ReadAttributePtr GeoNodeExecParams::get_input_attribute(const StringRef name, } /* If the attribute doesn't exist, use the default value and output an error message - * (except when the field is empty, to avoid spamming error messages). */ - if (!name.empty()) { + * (except when the field is empty, to avoid spamming error messages, and not when + * the domain is empty and we don't expect an attribute anyway). */ + if (!name.empty() && component.attribute_domain_size(domain) != 0) { this->error_message_add(NodeWarningType::Error, std::string("No attribute with name '") + name + "'."); } |