28 b.add_input<
decl::Int>(
"Minimum Vertices").default_value(4).min(4).max(10000);
45 const int quad_method,
46 const int ngon_method,
48 const int min_vertices)
55 from_mesh_params.calc_vert_normal =
true;
56 from_mesh_params.cd_mask_extra = cd_mask_extra;
61 selection.foreach_index([&](
const int i_face) {
70 result->runtime->bounds_cache = mesh.runtime->bounds_cache;
83 const int min_vertices = std::max(
params.extract_input<
int>(
"Minimum Vertices"), 4);
96 evaluator.
add(selection_field);
98 const IndexMask selection = evaluator.get_evaluated_as_mask(0);
101 mesh_in, quad_method, ngon_method, selection, min_vertices);
105 params.set_output(
"Mesh", std::move(geometry_set));
110 static const EnumPropertyItem rna_node_geometry_triangulate_quad_method_items[] = {
115 "Split the quads in nice triangles, slower method"},
120 "Split the quads on the first and third vertices"},
125 "Split the quads on the 2nd and 4th vertices"},
130 "Split the quads along their shortest diagonal"},
135 "Split the quads along their longest diagonal"},
136 {0,
nullptr, 0,
nullptr,
nullptr},
139 static const EnumPropertyItem rna_node_geometry_triangulate_ngon_method_items[] = {
144 "Arrange the new triangles evenly (slow)"},
149 "Split the polygons with an ear clipping algorithm"},
150 {0,
nullptr, 0,
nullptr,
nullptr},
156 "Method for splitting the quads into triangles",
157 rna_node_geometry_triangulate_quad_method_items,
166 "Method for splitting the n-gons into triangles",
167 rna_node_geometry_triangulate_ngon_method_items,
CustomData interface, see also DNA_customdata_types.h.
Mesh * BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
BMesh * BKE_mesh_to_bmesh_ex(const Mesh *mesh, const BMeshCreateParams *create_params, const BMeshFromMeshParams *convert_params)
#define NODE_CLASS_GEOMETRY
#define CD_MASK_ORIGINDEX
GeometryNodeTriangulateQuads
@ GEO_NODE_TRIANGULATE_QUAD_SHORTEDGE
@ GEO_NODE_TRIANGULATE_QUAD_BEAUTY
@ GEO_NODE_TRIANGULATE_QUAD_ALTERNATE
@ GEO_NODE_TRIANGULATE_QUAD_LONGEDGE
@ GEO_NODE_TRIANGULATE_QUAD_FIXED
GeometryNodeTriangulateNGons
@ GEO_NODE_TRIANGULATE_NGON_EARCLIP
@ GEO_NODE_TRIANGULATE_NGON_BEAUTY
@ GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_AMOUNT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
#define BM_elem_flag_set(ele, hflag, val)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
void BM_mesh_triangulate(BMesh *bm, const int quad_method, const int ngon_method, const int min_vertices, const bool tag_only, BMOperator *op, BMOpSlot *slot_facemap_out, BMOpSlot *slot_facemap_double_out)
int add(GField field, GVArray *varray_ptr)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
void debug_randomize_edge_order(Mesh *mesh)
void debug_randomize_face_order(Mesh *mesh)
static void node_register()
static Mesh * triangulate_mesh_selection(const Mesh &mesh, const int quad_method, const int ngon_method, const IndexMask &selection, const int min_vertices)
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, int type, const char *name, short nclass)
const Mesh * get_mesh() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare