27 N_(
"Output the input spline's evaluated points, based on the resolution attribute for NURBS "
28 "and Bézier splines. Poly splines are unchanged")},
33 N_(
"Sample the specified number of points along each spline")},
38 N_(
"Calculate the number of samples by splitting each spline into segments with the "
41 {0,
nullptr, 0,
nullptr,
nullptr},
46 b.use_custom_socket_order();
47 b.allow_any_socket_order();
49 .supported_type({GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil})
50 .description(
"Curves to resample");
51 b.add_output<
decl::Geometry>(
"Curve").propagate_all().align_with_previous();
56 .description(
"How to specify the amount of samples");
79 data->keep_last_segment =
true;
102 src_curves, field_context, selection,
count);
105 geometry.replace_curves(dst_curves_id);
109 for (
const int layer_index : grease_pencil->layers().index_range()) {
110 Drawing *drawing = grease_pencil->get_eval_drawing(grease_pencil->layer(layer_index));
112 if (drawing ==
nullptr) {
119 src_curves, field_context, selection,
count);
134 src_curves, field_context, selection,
length, {}, storage.keep_last_segment);
137 geometry.replace_curves(dst_curves_id);
141 for (
const int layer_index : grease_pencil->layers().index_range()) {
142 Drawing *drawing = grease_pencil->get_eval_drawing(grease_pencil->layer(layer_index));
143 if (drawing ==
nullptr) {
150 src_curves, field_context, selection,
length, {}, storage.keep_last_segment);
164 src_curves, field_context, selection);
167 geometry.replace_curves(dst_curves_id);
171 for (
const int layer_index : grease_pencil->layers().index_range()) {
172 Drawing *drawing = grease_pencil->get_eval_drawing(grease_pencil->layer(layer_index));
173 if (drawing ==
nullptr) {
180 src_curves, field_context, selection);
189 params.set_output(
"Curve", std::move(geometry_set));
197 "Do not collapse curves to single points if they are shorter than the "
198 "given length. The collapsing behavior exists for compatibility reasons.",
207 ntype.
ui_name =
"Resample Curve";
208 ntype.
ui_description =
"Generate a poly spline for each input spline";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_RESAMPLE_CURVE
GeometryNodeCurveResampleMode
@ GEO_NODE_CURVE_RESAMPLE_LENGTH
@ GEO_NODE_CURVE_RESAMPLE_EVALUATED
@ GEO_NODE_CURVE_RESAMPLE_COUNT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_boolean_accessors(member, flag)
BMesh const char void * data
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
void tag_topology_changed()
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
float length(VecOp< float, D >) RET
void * MEM_callocN(size_t len, const char *str)
void curves_copy_parameters(const Curves &src, Curves &dst)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
Curves * curves_new_nomain(int points_num, int curves_num)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
CurvesGeometry resample_to_count(const CurvesGeometry &src_curves, const IndexMask &selection, const VArray< int > &counts, const ResampleCurvesOutputAttributeIDs &output_ids={})
CurvesGeometry resample_to_evaluated(const CurvesGeometry &src_curves, const IndexMask &selection, const ResampleCurvesOutputAttributeIDs &output_ids={})
CurvesGeometry resample_to_length(const CurvesGeometry &src_curves, const IndexMask &selection, const VArray< float > &sample_lengths, const ResampleCurvesOutputAttributeIDs &output_ids={}, bool keep_last_segment=false)
static void node_init(bNodeTree *, bNode *node)
static EnumPropertyItem mode_items[]
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout_ex(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_rna(StructRNA *srna)
PropertyRNA * RNA_def_node_boolean(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const BooleanRNAAccessors accessors, std::optional< bool > default_value, bool allow_animation)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* draw_buttons_ex)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)