[Bf-blender-cvs] [48384363875] temp-geometry-nodes-fields-prototype: fix extrude node

Jacques Lucke noreply at git.blender.org
Fri Aug 20 12:47:45 CEST 2021


Commit: 48384363875dead78d63db69e8e82f91f3cb1361
Author: Jacques Lucke
Date:   Fri Aug 20 12:42:07 2021 +0200
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rB48384363875dead78d63db69e8e82f91f3cb1361

fix extrude node

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

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

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_extrude.cc b/source/blender/nodes/geometry/nodes/node_geo_extrude.cc
index 4df79b7846d..f8047627ff1 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_extrude.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_extrude.cc
@@ -30,10 +30,10 @@
 
 static bNodeSocketTemplate geo_node_extrude_in[] = {
     {SOCK_GEOMETRY, N_("Geometry")},
-    {SOCK_FLOAT, N_("Distance"), 0.0f, 0, 0, 0, FLT_MIN, FLT_MAX, PROP_DISTANCE},
-    {SOCK_FLOAT, N_("Inset"), 0.0f, 0, 0, 0, FLT_MIN, FLT_MAX, PROP_DISTANCE},
+    {SOCK_FLOAT, N_("Distance"), 0.0f, 0, 0, 0, FLT_MIN, FLT_MAX, PROP_DISTANCE, SOCK_FIELD},
+    {SOCK_FLOAT, N_("Inset"), 0.0f, 0, 0, 0, FLT_MIN, FLT_MAX, PROP_DISTANCE, SOCK_FIELD},
     {SOCK_BOOLEAN, N_("Individual")},
-    {SOCK_BOOLEAN, N_("Selection"), 1, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE},
+    {SOCK_BOOLEAN, N_("Selection"), 1, 0, 0, 0, 0, 0, PROP_NONE, SOCK_HIDE_VALUE | SOCK_FIELD},
     {-1, ""},
 };
 
@@ -130,7 +130,7 @@ static void geo_node_extrude_exec(GeoNodeExecParams params)
   geometry_set = bke::geometry_set_realize_instances(geometry_set);
 
   MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>();
-  if (mesh_component.has_mesh()) {
+  if (mesh_component.has_mesh() && mesh_component.get_for_read()->totpoly > 0) {
     const Mesh *input_mesh = mesh_component.get_for_read();
 
     bke::FieldRef<bool> field = params.get_input_field<bool>("Selection");



More information about the Bf-blender-cvs mailing list