Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-03-08 04:06:40 +0300
committerHans Goudey <h.goudey@me.com>2022-03-08 04:06:40 +0300
commit901a03725ed58166e5b2401dfadd7c1cb7e490a2 (patch)
treeace4bc1b2a7dd9135aa5b0291d3d1bda2a46e1b7 /source/blender/nodes
parentc238728105272b0f11ff5b03a701cc180bf68bb8 (diff)
Curves: Port mesh to curve node to new data-block
The main improvement is a code simplification, because attributes don't have to be transferred separately for each curve, and all attributes can be handled generically. Performance improves significantly when the output contains many curves. Basic testing with a 2 million curve output shows an approximate 10x performance improvement.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_mesh_to_curve.cc6
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc3
2 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_mesh_to_curve.cc b/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_mesh_to_curve.cc
index 8991261a21a..72cb540df4a 100644
--- a/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_mesh_to_curve.cc
+++ b/source/blender/nodes/geometry/nodes/legacy/node_geo_legacy_mesh_to_curve.cc
@@ -45,10 +45,8 @@ static void node_geo_exec(GeoNodeExecParams params)
return;
}
- std::unique_ptr<CurveEval> curve = geometry::mesh_to_curve_convert(
- component, IndexMask(selected_edge_indices));
-
- params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
+ Curves *curves = geometry::mesh_to_curve_convert(component, IndexMask(selected_edge_indices));
+ params.set_output("Curve", GeometrySet::create_with_curves(curves));
}
} // namespace blender::nodes::node_geo_legacy_mesh_to_curve_cc
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
index d2b824141d7..f6ee3d00dee 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
@@ -34,8 +34,7 @@ static void node_geo_exec(GeoNodeExecParams params)
return;
}
- std::unique_ptr<CurveEval> curve = geometry::mesh_to_curve_convert(component, selection);
- geometry_set.replace_curves(curve_eval_to_curves(*curve));
+ geometry_set.replace_curves(geometry::mesh_to_curve_convert(component, selection));
geometry_set.keep_only({GEO_COMPONENT_TYPE_CURVE, GEO_COMPONENT_TYPE_INSTANCES});
});