21 b.add_input<
decl::Bool>(
N_(
"Selection")).default_value(
true).supports_field().hide_value();
22 b.add_input<
decl::Int>(
N_(
"Minimum Vertices")).default_value(4).min(4).max(10000);
28 uiItemR(layout,
ptr,
"quad_method", 0,
"", ICON_NONE);
29 uiItemR(layout,
ptr,
"ngon_method", 0,
"", ICON_NONE);
39 const int quad_method,
40 const int ngon_method,
42 const int min_vertices)
49 from_mesh_params.calc_vert_normal =
true;
50 from_mesh_params.cd_mask_extra = cd_mask_extra;
55 for (
int i_face : selection) {
69 const int min_vertices =
std::max(
params.extract_input<
int>(
"Minimum Vertices"), 4);
86 evaluator.add(selection_field);
88 const IndexMask selection = evaluator.get_evaluated_as_mask(0);
91 mesh_in, quad_method, ngon_method, selection, min_vertices);
95 params.set_output(
"Mesh", std::move(geometry_set));
CustomData interface, see also DNA_customdata_types.h.
@ GEO_COMPONENT_TYPE_MESH
struct BMesh * BKE_mesh_to_bmesh_ex(const struct Mesh *me, const struct BMeshCreateParams *create_params, const struct BMeshFromMeshParams *convert_params)
struct Mesh * BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm, const struct CustomData_MeshMasks *cd_mask_extra, const struct Mesh *me_settings)
#define GEO_NODE_TRIANGULATE
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
static uint8 component(Color32 c, uint i)
#define CD_MASK_ORIGINDEX
GeometryNodeTriangulateQuads
@ GEO_NODE_TRIANGULATE_QUAD_SHORTEDGE
GeometryNodeTriangulateNGons
@ GEO_NODE_TRIANGULATE_NGON_BEAUTY
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int 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)
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 *UNUSED(ntree), bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_geo_exec(GeoNodeExecParams params)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_triangulate()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
const Mesh * get_mesh_for_read() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeDeclareFunction declare