24 b.use_custom_socket_order();
25 b.allow_any_socket_order();
26 b.add_default_layout();
28 {GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil});
29 b.add_output<
decl::Geometry>(
"Curve").propagate_all().align_with_previous();
30 auto &count_input =
b.add_input<
decl::Int>(
"Count")
35 .make_available([](
bNode &node) {
45 .
description(
"Limit the maximum value of the radius in order to avoid overlapping fillets");
47 const bNode *node =
b.node_or_null();
48 if (node !=
nullptr) {
71 const bool limit_radius,
75 evaluator.
add(radius_field);
87 evaluator.
add(*count_field);
104 const bool limit_radius,
108 for (
const int layer_index : grease_pencil.layers().index_range()) {
109 Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
110 if (drawing ==
nullptr) {
139 const bool limit_radius =
params.extract_input<
bool>(
"Limit Radius");
141 std::optional<Field<int>> count_field;
167 grease_pencil, mode, count_field, radius_field, limit_radius, attribute_filter);
171 params.set_output(
"Curve", std::move(geometry_set));
181 "Align Bézier handles to create circular arcs at each control point"},
186 "Add control points along a circular arc (handle type is vector if Bézier Spline)"},
187 {0,
nullptr, 0,
nullptr,
nullptr},
193 "How to choose number of vertices on fillet",
204 ntype.
ui_name =
"Fillet Curve";
205 ntype.
ui_description =
"Round corners by generating circular arcs on each control point";
Low-level operations for grease pencil.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_FILLET_CURVE
GeometryNodeCurveFilletMode
@ GEO_NODE_CURVE_FILLET_BEZIER
@ GEO_NODE_CURVE_FILLET_POLY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
BMesh const char void * data
IndexRange curves_range() const
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
void tag_topology_changed()
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
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)
bke::CurvesGeometry fillet_curves_bezier(const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, bool limit_radius, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry fillet_curves_poly(const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, const VArray< int > &counts, bool limit_radius, const bke::AttributeFilter &attribute_filter)
static void node_init(bNodeTree *, bNode *node)
static void node_rna(StructRNA *srna)
static bke::CurvesGeometry fillet_curve(const bke::CurvesGeometry &src_curves, const GeometryNodeCurveFilletMode mode, const fn::FieldContext &field_context, const std::optional< Field< int > > &count_field, const Field< float > &radius_field, const bool limit_radius, const AttributeFilter &attribute_filter)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_register()
static void fillet_grease_pencil(GreasePencil &grease_pencil, const GeometryNodeCurveFilletMode mode, const std::optional< Field< int > > &count_field, const Field< float > &radius_field, const bool limit_radius, const AttributeFilter &attribute_filter)
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)
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)
const Curves * get_curves() const
bool has_grease_pencil() const
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void modify_geometry_sets(ForeachSubGeometryCallback callback)
GreasePencil * get_grease_pencil_for_write()
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
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)