25 .description(
"The number of evaluated points on the curve");
27 .default_value({-1.0f, 0.0f, 0.0f})
29 .
description(
"Position of the start control point of the curve");
31 .default_value({-0.5f, 0.5f, 0.0f})
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");
42 .default_value({1.0f, 0.0f, 0.0f})
44 .
description(
"Position of the end control point of the curve");
56 MEM_cnew<NodeGeometryCurvePrimitiveBezierSegment>(__func__);
63 const float3 start_handle_right,
65 const float3 end_handle_left,
71 curves.resolution_for_write().fill(resolution);
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",
150 "NodeGeometryCurvePrimitiveBezierSegment",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
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)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
constexpr void fill(const T &value) const
constexpr T & first() const
constexpr T & last(const int64_t n=0) const
local_group_size(16, 16) .push_constant(Type b
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
Curves * curves_new_nomain_single(int points_num, CurveType type)
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)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare