25 .description(
"The number of evaluated points on the curve");
29 .description(
"Position of the start control point of the curve");
34 "Position of the start handle used to define the shape of the curve. In Offset mode, "
35 "relative to Start point");
39 "Position of the end handle used to define the shape of the curve. In Offset mode, "
40 "relative to End point");
44 .description(
"Position of the end control point of the curve");
63 const float3 start_handle_right,
65 const float3 end_handle_left,
77 positions.
first() = start;
78 positions.
last() = end;
84 handles_left.
first() = 2.0f * start - start_handle_right;
85 handles_right.
first() = start_handle_right;
87 handles_left.
last() = end_handle_left;
88 handles_right.
last() = 2.0f * end - end_handle_left;
91 handles_left.
first() = start - start_handle_right;
92 handles_right.
first() = start + start_handle_right;
94 handles_left.
last() = end + end_handle_left;
95 handles_right.
last() = end - end_handle_left;
112 std::max(
params.extract_input<
int>(
"Resolution"), 1),
125 "The start and end handles are fixed positions"},
130 "The start and end handles are offsets from the spline's control points"},
131 {0,
nullptr, 0,
nullptr,
nullptr},
137 "Method used to determine control handles",
148 ntype.
ui_name =
"Bézier Segment";
149 ntype.
ui_description =
"Generate a 2D Bézier spline from the given control points and handles";
154 "NodeGeometryCurvePrimitiveBezierSegment",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT
GeometryNodeCurvePrimitiveBezierSegmentMode
@ GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT_POSITION
@ GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT_OFFSET
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
BMesh const char void * data
constexpr void fill(const T &value) const
constexpr T & first() const
constexpr T & last(const int64_t n=0) const
MutableSpan< float3 > positions_for_write()
MutableSpan< int8_t > handle_types_right_for_write()
MutableSpan< int > resolution_for_write()
MutableSpan< float3 > handle_positions_left_for_write()
MutableSpan< float3 > handle_positions_right_for_write()
MutableSpan< int8_t > handle_types_left_for_write()
void * MEM_callocN(size_t len, const char *str)
void node_register_type(bNodeType &ntype)
Curves * curves_new_nomain_single(int points_num, CurveType type)
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))
static void node_rna(StructRNA *srna)
static void node_geo_exec(GeoNodeExecParams params)
static void node_init(bNodeTree *, bNode *node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static Curves * create_bezier_segment_curve(const float3 start, const float3 start_handle_right, const float3 end, const float3 end_handle_left, const int resolution, const GeometryNodeCurvePrimitiveBezierSegmentMode mode)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
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)
VecBase< float, 3 > float3
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)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
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)