Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_curve_subdivide.cc
| Show All 27 Lines | |||||
| using blender::fn::GVArray_For_GSpan; | using blender::fn::GVArray_For_GSpan; | ||||
| using blender::fn::GVArray_For_Span; | using blender::fn::GVArray_For_Span; | ||||
| using blender::fn::GVArray_Typed; | using blender::fn::GVArray_Typed; | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_curve_subdivide_declare(NodeDeclarationBuilder &b) | static void geo_node_curve_subdivide_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("Curve").supported_type(GEO_COMPONENT_TYPE_CURVE); | b.add_input<decl::Geometry>(N_("Curve")).supported_type(GEO_COMPONENT_TYPE_CURVE); | ||||
| b.add_input<decl::Int>("Cuts").default_value(1).min(0).max(1000).supports_field(); | b.add_input<decl::Int>(N_("Cuts")).default_value(1).min(0).max(1000).supports_field(); | ||||
| b.add_output<decl::Geometry>("Curve"); | b.add_output<decl::Geometry>(N_("Curve")); | ||||
| } | } | ||||
| static Array<int> get_subdivided_offsets(const Spline &spline, | static Array<int> get_subdivided_offsets(const Spline &spline, | ||||
| const VArray<int> &cuts, | const VArray<int> &cuts, | ||||
| const int spline_offset) | const int spline_offset) | ||||
| { | { | ||||
| Array<int> offsets(spline.segments_size() + 1); | Array<int> offsets(spline.segments_size() + 1); | ||||
| int offset = 0; | int offset = 0; | ||||
| ▲ Show 20 Lines • Show All 322 Lines • Show Last 20 Lines | |||||