Blender V4.3
bmo_unsubdivide.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12#include "BLI_utildefines.h"
13
14#include "bmesh.hh"
15#include "bmesh_tools.hh"
16
17#include "intern/bmesh_operators_private.hh" /* own include */
18
20{
21 /* - `BMVert.flag & BM_ELEM_TAG`: Shows we touched this vert.
22 * - `BMVert.index == -1`: Shows we will remove this vert. */
23 BMVert *v;
24 BMIter iter;
25
26 const int iterations = max_ii(1, BMO_slot_int_get(op->slots_in, "iterations"));
27
28 BMOpSlot *vinput = BMO_slot_get(op->slots_in, "verts");
29 BMVert **vinput_arr = (BMVert **)vinput->data.buf;
30 int v_index;
31
32 /* tag verts */
35 }
36 for (v_index = 0; v_index < vinput->len; v_index++) {
37 v = vinput_arr[v_index];
39 }
40
41 /* do all the real work here */
42 BM_mesh_decimate_unsubdivide_ex(bm, iterations, true);
43}
MINLINE int max_ii(int a, int b)
@ BM_ELEM_TAG
void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, int iterations, bool tag_only)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
@ BM_VERTS_OF_MESH
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void bmo_unsubdivide_exec(BMesh *bm, BMOperator *op)
union BMOpSlot::@139 data
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]