[Bf-blender-cvs] [626a8e0f10e] master: Fix T85979: Attribute missing warning with empty geometry

Hans Goudey noreply at git.blender.org
Thu Feb 25 15:20:09 CET 2021


Commit: 626a8e0f10ef90415c3811567b789168484c0b88
Author: Hans Goudey
Date:   Thu Feb 25 08:20:02 2021 -0600
Branches: master
https://developer.blender.org/rB626a8e0f10ef90415c3811567b789168484c0b88

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.

===================================================================

M	source/blender/nodes/intern/node_geometry_exec.cc

===================================================================

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 + "'.");
     }



More information about the Bf-blender-cvs mailing list