[Bf-blender-cvs] [0c64850e438] geometry-nodes-curve-support: Geometry Nodes Curves: Fix the curve to mesh node

Hans Goudey noreply at git.blender.org
Fri Apr 2 20:20:07 CEST 2021


Commit: 0c64850e4387455a846ca313ca7b5740a60f53c7
Author: Hans Goudey
Date:   Fri Apr 2 13:13:03 2021 -0500
Branches: geometry-nodes-curve-support
https://developer.blender.org/rB0c64850e4387455a846ca313ca7b5740a60f53c7

Geometry Nodes Curves: Fix the curve to mesh node

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

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

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

diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
index 4361d8f92c4..dd79a12fa01 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
@@ -37,7 +37,7 @@ static bNodeSocketTemplate geo_node_point_translate_out[] = {
 
 namespace blender::nodes {
 
-static Mesh *curve_to_mesh_calculate(DCurve &curve)
+static Mesh *curve_to_mesh_calculate(const DCurve &curve)
 {
   curve.ensure_evaluation_cache();
 
@@ -69,15 +69,14 @@ static Mesh *curve_to_mesh_calculate(DCurve &curve)
 
 static void geo_node_curve_to_mesh_exec(GeoNodeExecParams params)
 {
-  GeometrySet geometry_set_in = params.extract_input<GeometrySet>("Curve");
-  GeometrySet geometry_set_out;
+  GeometrySet set_in = params.extract_input<GeometrySet>("Curve");
 
-  if (geometry_set_in.has_curve()) {
-    Mesh *mesh = curve_to_mesh_calculate(*geometry_set_in.get_curve_for_write());
-    geometry_set_in.replace_mesh(mesh);
+  if (!set_in.has_curve()) {
+    params.set_output("Mesh", GeometrySet());
   }
 
-  params.set_output("Mesh", std::move(geometry_set_out));
+  Mesh *mesh = curve_to_mesh_calculate(*set_in.get_curve_for_read());
+  params.set_output("Mesh", GeometrySet::create_with_mesh(mesh));
 }
 
 }  // namespace blender::nodes



More information about the Bf-blender-cvs mailing list