20 auto enable_direction = [](
bNode &node) {
26 .description(
"Position of the first control point");
30 .description(
"Position of the second control point")
31 .make_available([](
bNode &node) {
37 .description(
"Direction the line is going in. The length of this vector does not matter")
38 .make_available(enable_direction);
42 .description(
"Distance between the two points")
43 .make_available(enable_direction);
46 const bNode *node =
b.node_or_null();
47 if (node !=
nullptr) {
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",
144 ntype.
ui_description =
"Generate a poly spline line with two points";
149 "NodeGeometryCurvePrimitiveLine",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_PRIMITIVE_LINE
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)
BMesh const char void * data
MutableSpan< float3 > positions_for_write()
float length(VecOp< float, D >) RET
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))
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)
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)