25 .description(
"The X axis size of the shape");
30 .description(
"The Y axis size of the shape")
36 .description(
"The X axis size of the shape")
42 .description(
"The X axis size of the shape")
49 "For Parallelogram, the relative X difference between the top and bottom edges. For "
50 "Trapezoid, the amount to move the top edge in the positive X axis")
52 auto &bottom_height =
b.add_input<
decl::Float>(
"Bottom Height")
56 .description(
"The distance between the bottom point and the X axis")
58 auto &top_height =
b.add_input<
decl::Float>(
"Top Height")
61 .description(
"The distance between the top point and the X axis")
66 .description(
"The exact location of the point to use")
71 .description(
"The exact location of the point to use")
76 .description(
"The exact location of the point to use")
81 .description(
"The exact location of the point to use")
85 const bNode *node =
b.node_or_null();
86 if (node !=
nullptr) {
90 width.available(
true);
91 height.available(
true);
94 width.available(
true);
95 height.available(
true);
96 offset.available(
true);
99 bottom.available(
true);
101 offset.available(
true);
102 height.available(
true);
105 width.available(
true);
106 bottom_height.available(
true);
107 top_height.available(
true);
137 bNode &node =
params.add_node(
"GeometryNodeCurvePrimitiveQuadrilateral");
149 else if (
params.node_tree().typeinfo->validate_link(
171 positions[0] =
float3(width / 2.0f, height / 2.0f, 0.0f);
172 positions[1] =
float3(-width / 2.0f, height / 2.0f, 0.0f);
173 positions[2] =
float3(-width / 2.0f, -height / 2.0f, 0.0f);
174 positions[3] =
float3(width / 2.0f, -height / 2.0f, 0.0f);
194 positions[0] =
float3(width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
195 positions[1] =
float3(-width / 2.0f + offset / 2.0f, height / 2.0f, 0.0f);
196 positions[2] =
float3(-width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
197 positions[3] =
float3(width / 2.0f - offset / 2.0f, -height / 2.0f, 0.0f);
205 positions[0] =
float3(
top / 2.0f + offset, height / 2.0f, 0.0f);
206 positions[1] =
float3(-
top / 2.0f + offset, height / 2.0f, 0.0f);
207 positions[2] =
float3(-bottom / 2.0f, -height / 2.0f, 0.0f);
208 positions[3] =
float3(bottom / 2.0f, -height / 2.0f, 0.0f);
213 const float bottom_height,
214 const float top_height)
216 positions[0] =
float3(0, -bottom_height, 0);
217 positions[1] =
float3(width / 2, 0, 0);
218 positions[2] =
float3(0, top_height, 0);
219 positions[3] =
float3(-width / 2.0f, 0, 0);
236 std::max(
params.extract_input<
float>(
"Height"), 0.0f),
237 std::max(
params.extract_input<
float>(
"Width"), 0.0f));
242 std::max(
params.extract_input<
float>(
"Height"), 0.0f),
243 std::max(
params.extract_input<
float>(
"Width"), 0.0f),
244 params.extract_input<
float>(
"Offset"));
248 std::max(
params.extract_input<
float>(
"Bottom Width"), 0.0f),
249 std::max(
params.extract_input<
float>(
"Top Width"), 0.0f),
250 params.extract_input<
float>(
"Offset"),
251 std::max(
params.extract_input<
float>(
"Height"), 0.0f));
255 std::max(
params.extract_input<
float>(
"Width"), 0.0f),
256 std::max(
params.extract_input<
float>(
"Bottom Height"), 0.0f),
257 params.extract_input<
float>(
"Top Height"));
267 params.set_default_remaining_outputs();
281 "Create a rectangle"},
286 "Create a parallelogram"},
291 "Create a trapezoid"},
297 "Create a quadrilateral from four points"},
298 {0,
nullptr, 0,
nullptr,
nullptr},
315 ntype.
ui_name =
"Quadrilateral";
324 "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)