[Bf-blender-cvs] [02d61faab06] geometry-nodes: Geometry Nodes: disable random attribute node when name is empty

Jacques Lucke noreply at git.blender.org
Mon Nov 23 19:13:33 CET 2020


Commit: 02d61faab0668cb58104a937d4658eeba405681c
Author: Jacques Lucke
Date:   Mon Nov 23 19:02:44 2020 +0100
Branches: geometry-nodes
https://developer.blender.org/rB02d61faab0668cb58104a937d4658eeba405681c

Geometry Nodes: disable random attribute node when name is empty

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

M	source/blender/nodes/geometry/nodes/node_geo_random_attribute.cc

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_random_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_random_attribute.cc
index a65e254cf29..0eea9c221e4 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_random_attribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_random_attribute.cc
@@ -92,6 +92,9 @@ static void randomize_attribute(GeometryComponent &component,
   const CustomDataType data_type = static_cast<CustomDataType>(node.custom1);
   const AttributeDomain domain = static_cast<AttributeDomain>(node.custom2);
   const std::string attribute_name = params.get_input<std::string>("Attribute");
+  if (attribute_name.empty()) {
+    return;
+  }
 
   WriteAttributePtr attribute = component.attribute_try_ensure_for_write(
       attribute_name, domain, data_type);



More information about the Bf-blender-cvs mailing list