diff options
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc index 38d7fb99e87..f0babfa07ad 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc @@ -26,7 +26,7 @@ #include "node_geometry_util.hh" -namespace blender::nodes { +namespace blender::nodes::curve_to_points_node { static void geo_node_curve_to_points_declare(NodeDeclarationBuilder &b) { @@ -289,18 +289,6 @@ static void copy_spline_domain_attributes(const CurveEval &curve, ATTR_DOMAIN_CURVE); } -void curve_create_default_rotation_attribute(Span<float3> tangents, - Span<float3> normals, - MutableSpan<float3> rotations) -{ - threading::parallel_for(IndexRange(rotations.size()), 512, [&](IndexRange range) { - for (const int i : range) { - rotations[i] = - float4x4::from_normalized_axis_data({0, 0, 0}, normals[i], tangents[i]).to_euler(); - } - }); -} - static void geo_node_curve_to_points_exec(GeoNodeExecParams params) { NodeGeometryCurveToPoints &node_storage = *(NodeGeometryCurveToPoints *)params.node().storage; @@ -374,6 +362,20 @@ static void geo_node_curve_to_points_exec(GeoNodeExecParams params) } } +} // namespace blender::nodes::curve_to_points_node + +namespace blender::nodes { +void curve_create_default_rotation_attribute(Span<float3> tangents, + Span<float3> normals, + MutableSpan<float3> rotations) +{ + threading::parallel_for(IndexRange(rotations.size()), 512, [&](IndexRange range) { + for (const int i : range) { + rotations[i] = + float4x4::from_normalized_axis_data({0, 0, 0}, normals[i], tangents[i]).to_euler(); + } + }); +} } // namespace blender::nodes void register_node_type_geo_curve_to_points() @@ -381,13 +383,14 @@ void register_node_type_geo_curve_to_points() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_CURVE_TO_POINTS, "Curve to Points", NODE_CLASS_GEOMETRY, 0); - ntype.declare = blender::nodes::geo_node_curve_to_points_declare; - ntype.geometry_node_execute = blender::nodes::geo_node_curve_to_points_exec; - ntype.draw_buttons = blender::nodes::geo_node_curve_to_points_layout; + ntype.declare = blender::nodes::curve_to_points_node::geo_node_curve_to_points_declare; + ntype.geometry_node_execute = + blender::nodes::curve_to_points_node::geo_node_curve_to_points_exec; + ntype.draw_buttons = blender::nodes::curve_to_points_node::geo_node_curve_to_points_layout; node_type_storage( &ntype, "NodeGeometryCurveToPoints", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, blender::nodes::geo_node_curve_to_points_init); - node_type_update(&ntype, blender::nodes::geo_node_curve_to_points_update); + node_type_init(&ntype, blender::nodes::curve_to_points_node::geo_node_curve_to_points_init); + node_type_update(&ntype, blender::nodes::curve_to_points_node::geo_node_curve_to_points_update); nodeRegisterType(&ntype); } |