25 .description(
"The X axis size of the shape")
31 .description(
"The Y axis size of the shape")
37 .description(
"The X axis size of the shape")
43 .description(
"The X axis size of the shape")
50 "For Parallelogram, the relative X difference between the top and bottom edges. For "
51 "Trapezoid, the amount to move the top edge in the positive X axis")
53 auto &bottom_height =
b.add_input<
decl::Float>(
"Bottom Height")
57 .description(
"The distance between the bottom point and the X axis")
59 auto &top_height =
b.add_input<
decl::Float>(
"Top Height")
62 .description(
"The distance between the top point and the X axis")
67 .description(
"The exact location of the point to use")
72 .description(
"The exact location of the point to use")
77 .description(
"The exact location of the point to use")
82 .description(
"The exact location of the point to use")
86 const bNode *node =
b.node_or_null();
87 if (node !=
nullptr) {
91 width.available(
true);
92 height.available(
true);
95 width.available(
true);
96 height.available(
true);
97 offset.available(
true);
100 bottom.available(
true);
102 offset.available(
true);
103 height.available(
true);
106 width.available(
true);
107 bottom_height.available(
true);
108 top_height.available(
true);
138 bNode &node =
params.add_node(
"GeometryNodeCurvePrimitiveQuadrilateral");
150 else if (
params.node_tree().typeinfo->validate_link(
172 positions[0] =
float3(width / 2.0f, height / 2.0f, 0.0f);
173 positions[1] =
float3(-width / 2.0f, height / 2.0f, 0.0f);
174 positions[2] =
float3(-width / 2.0f, -height / 2.0f, 0.0f);
175 positions[3] =
float3(width / 2.0f, -height / 2.0f, 0.0f);
195 positions[0] =
float3(width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
196 positions[1] =
float3(-width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
197 positions[2] =
float3(-width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
198 positions[3] =
float3(width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
206 positions[0] =
float3(
top / 2.0f + offset, height / 2.0f, 0.0f);
207 positions[1] =
float3(-
top / 2.0f + offset, height / 2.0f, 0.0f);
208 positions[2] =
float3(-bottom / 2.0f, -height / 2.0f, 0.0f);
209 positions[3] =
float3(bottom / 2.0f, -height / 2.0f, 0.0f);
214 const float bottom_height,
215 const float top_height)
217 positions[0] =
float3(0, -bottom_height, 0);
218 positions[1] =
float3(width / 2, 0, 0);
219 positions[2] =
float3(0, top_height, 0);
220 positions[3] =
float3(-width / 2.0f, 0, 0);
237 std::max(
params.extract_input<
float>(
"Height"), 0.0f),
238 std::max(
params.extract_input<
float>(
"Width"), 0.0f));
243 std::max(
params.extract_input<
float>(
"Height"), 0.0f),
244 std::max(
params.extract_input<
float>(
"Width"), 0.0f),
245 params.extract_input<
float>(
"Offset"));
249 std::max(
params.extract_input<
float>(
"Bottom Width"), 0.0f),
250 std::max(
params.extract_input<
float>(
"Top Width"), 0.0f),
251 params.extract_input<
float>(
"Offset"),
252 std::max(
params.extract_input<
float>(
"Height"), 0.0f));
256 std::max(
params.extract_input<
float>(
"Width"), 0.0f),
257 std::max(
params.extract_input<
float>(
"Bottom Height"), 0.0f),
258 params.extract_input<
float>(
"Top Height"));
268 params.set_default_remaining_outputs();
282 "Create a rectangle"},
287 "Create a parallelogram"},
292 "Create a trapezoid"},
298 "Create a quadrilateral from four points"},
299 {0,
nullptr, 0,
nullptr,
nullptr},
316 ntype.
ui_name =
"Quadrilateral";
325 "NodeGeometryCurvePrimitiveQuad",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL
GeometryNodeCurvePrimitiveQuadMode
@ GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_KITE
@ GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_TRAPEZOID
@ GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_POINTS
@ GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_RECTANGLE
@ GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_PARALLELOGRAM
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
BMesh const char void * data
constexpr T & first() const
MutableSpan< float3 > positions_for_write()
MutableSpan< bool > cyclic_for_write()
Vector< SocketDeclaration * > outputs
GeometryNodeCurvePrimitiveQuadMode quad_mode
void operator()(LinkSearchOpParams ¶ms)
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_init(bNodeTree *, bNode *node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void create_kite_curve(MutableSpan< float3 > positions, const float width, const float bottom_height, const float top_height)
static void create_rectangle_curve(MutableSpan< float3 > positions, const float height, const float width)
static void node_register()
static void create_parallelogram_curve(MutableSpan< float3 > positions, const float height, const float width, const float offset)
static void create_points_curve(MutableSpan< float3 > positions, const float3 &p1, const float3 &p2, const float3 &p3, const float3 &p4)
static void node_declare(NodeDeclarationBuilder &b)
static void create_trapezoid_curve(MutableSpan< float3 > positions, const float bottom, const float top, const float offset, const float height)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void node_rna(StructRNA *srna)
static void node_geo_exec(GeoNodeExecParams params)
void search_link_ops_for_declarations(GatherLinkSearchOpParams ¶ms, Span< SocketDeclaration * > declarations)
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)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
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)