Blender V5.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
11
12#include "BLI_math_base_c.hh"
13
14#include "bmesh.hh"
15#include "bmesh_tools.hh"
16
17#include "intern/bmesh_operators_private.hh" /* own include */
18
19namespace blender {
20
22{
23 /* - `BMVert.flag & BM_ELEM_TAG`: Shows we touched this vert.
24 * - `BMVert.index == -1`: Shows we will remove this vert. */
25 BMVert *v;
26 BMIter iter;
27
28 const int iterations = max_ii(1, BMO_slot_int_get(op->slots_in, "iterations"));
29
30 BMOpSlot *vinput = BMO_slot_get(op->slots_in, "verts");
31 BMVert **vinput_arr = reinterpret_cast<BMVert **>(vinput->data.buf);
32 int v_index;
33
34 /* tag verts */
37 }
38 for (v_index = 0; v_index < vinput->len; v_index++) {
39 v = vinput_arr[v_index];
41 }
42
43 /* do all the real work here */
44 BM_mesh_decimate_unsubdivide_ex(bm, iterations, true);
45}
46
47} // namespace blender
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMesh Iterators.
void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, int iterations, bool tag_only)
int BMO_slot_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
MINLINE int max_ii(int a, int b)
ATTR_WARN_UNUSED_RESULT const BMVert * v
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
void bmo_unsubdivide_exec(BMesh *bm, BMOperator *op)
union blender::BMOpSlot::@376352321363166111241172004263244043165250166277 data
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]