22 b.use_custom_socket_order();
23 b.allow_any_socket_order();
24 b.add_default_layout();
25 b.add_input<
decl::Geometry>(
"Mesh").supported_type(GeometryComponent::Type::Mesh);
26 b.add_output<
decl::Geometry>(
"Mesh").propagate_all().align_with_previous();
63 evaluator.
add(selection_field);
87 params.set_output(
"Mesh", std::move(geometry_set));
92 static const EnumPropertyItem rna_node_geometry_triangulate_quad_method_items[] = {
97 "Split the quads in nice triangles, slower method"},
102 "Split the quads on the first and third vertices"},
107 "Split the quads on the 2nd and 4th vertices"},
112 "Split the quads along their shortest diagonal"},
117 "Split the quads along their longest diagonal"},
118 {0,
nullptr, 0,
nullptr,
nullptr},
121 static const EnumPropertyItem rna_node_geometry_triangulate_ngon_method_items[] = {
126 "Arrange the new triangles evenly (slow)"},
131 "Split the polygons with an ear clipping algorithm"},
132 {0,
nullptr, 0,
nullptr,
nullptr},
138 "Method for splitting the quads into triangles",
139 rna_node_geometry_triangulate_quad_method_items,
148 "Method for splitting the n-gons into triangles",
149 rna_node_geometry_triangulate_ngon_method_items,
162 ntype.
ui_description =
"Convert all faces in a mesh to triangular faces";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_TRIANGULATE
@ GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_as_mask(int field_index)
void node_register_type(bNodeType &ntype)
void debug_randomize_edge_order(Mesh *mesh)
std::optional< Mesh * > mesh_triangulate(const Mesh &src_mesh, const IndexMask &selection, TriangulateNGonMode ngon_mode, TriangulateQuadMode quad_mode, const bke::AttributeFilter &attribute_filter)
void debug_randomize_face_order(Mesh *mesh)
static void node_register()
static void geo_triangulate_init(bNodeTree *, bNode *node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void node_rna(StructRNA *srna)
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, std::string idname, const std::optional< int16_t > legacy_type)
const Mesh * get_mesh() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
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
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)