26 .
description(
"Position of the first control point");
28 .default_value({0.0f, 0.0f, 1.0f})
30 .
description(
"Position of the second control point")
31 .make_available([](
bNode &node) {
36 .default_value({0.0f, 0.0f, 1.0f})
37 .description(
"Direction the line is going in. The length of this vector does not matter")
42 .description(
"Distance between the two points")
43 .make_available(enable_direction);
46 const bNode *node =
b.node_or_null();
47 if (node !=
nullptr) {
76 curves.positions_for_write().first() = start;
77 curves.positions_for_write().last() = end;
89 curves.positions_for_write().first() = start;
90 curves.positions_for_write().last() =
math::normalize(direction) * length + start;
108 params.extract_input<
float>(
"Length"));
121 "Define the start and end points of the line"},
126 "Define a line with a start point, direction and length"},
127 {0,
nullptr, 0,
nullptr,
nullptr},
133 "Method used to determine radius and placement",
145 "NodeGeometryCurvePrimitiveLine",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
GeometryNodeCurvePrimitiveLineMode
@ GEO_NODE_CURVE_PRIMITIVE_LINE_MODE_POINTS
@ GEO_NODE_CURVE_PRIMITIVE_LINE_MODE_DIRECTION
#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)
void make_available(bNode &node) 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)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static Curves * create_direction_line_curve(const float3 start, const float3 direction, const float length)
static void node_init(bNodeTree *, bNode *node)
static void node_register()
static void node_rna(StructRNA *srna)
static Curves * create_point_line_curve(const float3 start, const float3 end)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
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