From 626a8e0f10ef90415c3811567b789168484c0b88 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 25 Feb 2021 08:20:02 -0600 Subject: 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. --- source/blender/nodes/intern/node_geometry_exec.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/nodes/intern') 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 + "'."); } -- cgit v1.2.3