23 b.use_custom_socket_order();
24 b.allow_any_socket_order();
25 b.add_default_layout();
27 {GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil});
28 b.add_output<
decl::Geometry>(
"Curve").propagate_all().align_with_previous();
38 const bNode *node =
b.node_or_null();
39 if (node !=
nullptr) {
63 data->keep_last_segment =
true;
86 src_curves, field_context, selection,
count);
89 geometry.replace_curves(dst_curves_id);
93 for (
const int layer_index : grease_pencil->layers().index_range()) {
94 Drawing *drawing = grease_pencil->get_eval_drawing(grease_pencil->layer(layer_index));
96 if (drawing ==
nullptr) {
103 src_curves, field_context, selection,
count);
118 src_curves, field_context, selection,
length, {}, storage.keep_last_segment);
121 geometry.replace_curves(dst_curves_id);
125 for (
const int layer_index : grease_pencil->layers().index_range()) {
126 Drawing *drawing = grease_pencil->get_eval_drawing(grease_pencil->layer(layer_index));
127 if (drawing ==
nullptr) {
134 src_curves, field_context, selection,
length, {}, storage.keep_last_segment);
148 src_curves, field_context, selection);
151 geometry.replace_curves(dst_curves_id);
155 for (
const int layer_index : grease_pencil->layers().index_range()) {
156 Drawing *drawing = grease_pencil->get_eval_drawing(grease_pencil->layer(layer_index));
157 if (drawing ==
nullptr) {
164 src_curves, field_context, selection);
173 params.set_output(
"Curve", std::move(geometry_set));
183 "Output the input spline's evaluated points, based on the resolution attribute for NURBS "
184 "and Bézier splines. Poly splines are unchanged"},
189 "Sample the specified number of points along each spline"},
194 "Calculate the number of samples by splitting each spline into segments with the specified "
196 {0,
nullptr, 0,
nullptr,
nullptr},
202 "How to specify the amount of samples",
209 "Do not collapse curves to single points if they are shorter than the "
210 "given length. The collapsing behavior exists for compatibility reasons.",
219 ntype.
ui_name =
"Resample Curve";
220 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)
#define NOD_storage_enum_accessors(member)
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)
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 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_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_register()
static void node_rna(StructRNA *srna)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
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)
void modify_geometry_sets(ForeachSubGeometryCallback callback)
GreasePencil * get_grease_pencil_for_write()
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
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
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)