Blender  V3.3
blenkernel/intern/mesh_mirror.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright Blender Foundation. All rights reserved. */
3 
8 #include "BLI_math.h"
9 
10 #include "DNA_mesh_types.h"
11 #include "DNA_meshdata_types.h"
12 #include "DNA_object_types.h"
13 
14 #include "BKE_deform.h"
15 #include "BKE_lib_id.h"
16 #include "BKE_lib_query.h"
17 #include "BKE_mesh.h"
18 #include "BKE_mesh_mirror.h"
19 #include "BKE_modifier.h"
20 
21 #include "bmesh.h"
22 #include "bmesh_tools.h"
23 
24 #include "MEM_guardedalloc.h"
25 
26 #include "MOD_modifiertypes.h"
27 
29  const Mesh *mesh,
30  int axis,
31  const float plane_co[3],
32  float plane_no[3])
33 {
34  bool do_bisect_flip_axis = ((axis == 0 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_X) ||
35  (axis == 1 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_Y) ||
36  (axis == 2 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_Z));
37 
38  const float bisect_distance = mmd->bisect_threshold;
39 
40  Mesh *result;
41  BMesh *bm;
42  BMIter viter;
43  BMVert *v, *v_next;
44 
46  &(struct BMeshCreateParams){0},
47  &(struct BMeshFromMeshParams){
48  .calc_face_normal = true,
49  .calc_vert_normal = true,
50  .cd_mask_extra = {.vmask = CD_MASK_ORIGINDEX,
51  .emask = CD_MASK_ORIGINDEX,
52  .pmask = CD_MASK_ORIGINDEX},
53  });
54 
55  /* Define bisecting plane (aka mirror plane). */
56  float plane[4];
57  if (!do_bisect_flip_axis) {
58  /* That reversed condition is a little weird, but for some reason that's how you keep
59  * the part of the mesh which is on the non-mirrored side when flip option is disabled.
60  * I think this is the expected behavior. */
61  negate_v3(plane_no);
62  }
63  plane_from_point_normal_v3(plane, plane_co, plane_no);
64 
65  BM_mesh_bisect_plane(bm, plane, true, false, 0, 0, bisect_distance);
66 
67  /* Plane definitions for vert killing. */
68  float plane_offset[4];
69  copy_v3_v3(plane_offset, plane);
70  plane_offset[3] = plane[3] - bisect_distance;
71 
72  /* Delete verts across the mirror plane. */
73  BM_ITER_MESH_MUTABLE (v, v_next, &viter, bm, BM_VERTS_OF_MESH) {
74  if (plane_point_side_v3(plane_offset, v->co) > 0.0f) {
75  BM_vert_kill(bm, v);
76  }
77  }
78 
81 
82  return result;
83 }
84 
86  Mesh *mesh,
87  const int axis,
88  const float dist)
89 {
91  &(struct BMeshCreateParams){
92  .use_toolflags = 1,
93  },
94  &(struct BMeshFromMeshParams){
95  .calc_face_normal = true,
96  .calc_vert_normal = true,
97  .cd_mask_extra =
98  {
99  .vmask = CD_MASK_SHAPEKEY,
100  },
101  });
104  "symmetrize input=%avef direction=%i dist=%f use_shapekey=%b",
105  axis,
106  dist,
107  true);
108 
109  BM_mesh_bm_to_me(bmain,
110  bm,
111  mesh,
112  (&(struct BMeshToMeshParams){
113  .calc_object_remap = true,
114 
115  }));
116  BM_mesh_free(bm);
117 }
118 
120  Object *ob,
121  const Mesh *mesh,
122  const int axis,
123  const bool use_correct_order_on_merge)
124 {
125  const float tolerance_sq = mmd->tolerance * mmd->tolerance;
126  const bool do_vtargetmap = (mmd->flag & MOD_MIR_NO_MERGE) == 0;
127  int tot_vtargetmap = 0; /* total merge vertices */
128 
129  const bool do_bisect = ((axis == 0 && mmd->flag & MOD_MIR_BISECT_AXIS_X) ||
130  (axis == 1 && mmd->flag & MOD_MIR_BISECT_AXIS_Y) ||
131  (axis == 2 && mmd->flag & MOD_MIR_BISECT_AXIS_Z));
132 
133  Mesh *result;
134  MVert *mv, *mv_prev;
135  MEdge *me;
136  MLoop *ml;
137  MPoly *mp;
138  float mtx[4][4];
139  float plane_co[3], plane_no[3];
140  int i;
141  int a, totshape;
142  int *vtargetmap = NULL, *vtmap_a = NULL, *vtmap_b = NULL;
143 
144  /* mtx is the mirror transformation */
145  unit_m4(mtx);
146  mtx[axis][axis] = -1.0f;
147 
148  Object *mirror_ob = mmd->mirror_ob;
149  if (mirror_ob != NULL) {
150  float tmp[4][4];
151  float itmp[4][4];
152 
153  /* tmp is a transform from coords relative to the object's own origin,
154  * to coords relative to the mirror object origin */
155  invert_m4_m4(tmp, mirror_ob->obmat);
156  mul_m4_m4m4(tmp, tmp, ob->obmat);
157 
158  /* itmp is the reverse transform back to origin-relative coordinates */
159  invert_m4_m4(itmp, tmp);
160 
161  /* combine matrices to get a single matrix that translates coordinates into
162  * mirror-object-relative space, does the mirror, and translates back to
163  * origin-relative space */
164  mul_m4_series(mtx, itmp, mtx, tmp);
165 
166  if (do_bisect) {
167  copy_v3_v3(plane_co, itmp[3]);
168  copy_v3_v3(plane_no, itmp[axis]);
169 
170  /* Account for non-uniform scale in `ob`, see: T87592. */
171  float ob_scale[3] = {
172  len_squared_v3(ob->obmat[0]),
173  len_squared_v3(ob->obmat[1]),
174  len_squared_v3(ob->obmat[2]),
175  };
176  /* Scale to avoid precision loss with extreme values. */
177  const float ob_scale_max = max_fff(UNPACK3(ob_scale));
178  if (LIKELY(ob_scale_max != 0.0f)) {
179  mul_v3_fl(ob_scale, 1.0f / ob_scale_max);
180  mul_v3_v3(plane_no, ob_scale);
181  }
182  }
183  }
184  else if (do_bisect) {
185  copy_v3_v3(plane_co, mtx[3]);
186  /* Need to negate here, since that axis is inverted (for mirror transform). */
187  negate_v3_v3(plane_no, mtx[axis]);
188  }
189 
190  Mesh *mesh_bisect = NULL;
191  if (do_bisect) {
193  mmd, mesh, axis, plane_co, plane_no);
194  mesh = mesh_bisect;
195  }
196 
197  const int maxVerts = mesh->totvert;
198  const int maxEdges = mesh->totedge;
199  const int maxLoops = mesh->totloop;
200  const int maxPolys = mesh->totpoly;
201 
203  mesh, maxVerts * 2, maxEdges * 2, 0, maxLoops * 2, maxPolys * 2);
204 
205  /* Copy custom-data to original geometry. */
206  CustomData_copy_data(&mesh->vdata, &result->vdata, 0, 0, maxVerts);
207  CustomData_copy_data(&mesh->edata, &result->edata, 0, 0, maxEdges);
208  CustomData_copy_data(&mesh->ldata, &result->ldata, 0, 0, maxLoops);
209  CustomData_copy_data(&mesh->pdata, &result->pdata, 0, 0, maxPolys);
210 
211  /* Subsurf for eg won't have mesh data in the custom-data arrays.
212  * now add mvert/medge/mpoly layers. */
214  memcpy(result->mvert, mesh->mvert, sizeof(*result->mvert) * mesh->totvert);
215  }
217  memcpy(result->medge, mesh->medge, sizeof(*result->medge) * mesh->totedge);
218  }
220  memcpy(result->mloop, mesh->mloop, sizeof(*result->mloop) * mesh->totloop);
221  memcpy(result->mpoly, mesh->mpoly, sizeof(*result->mpoly) * mesh->totpoly);
222  }
223 
224  /* Copy custom-data to new geometry,
225  * copy from itself because this data may have been created in the checks above. */
226  CustomData_copy_data(&result->vdata, &result->vdata, 0, maxVerts, maxVerts);
227  CustomData_copy_data(&result->edata, &result->edata, 0, maxEdges, maxEdges);
228  /* loops are copied later */
229  CustomData_copy_data(&result->pdata, &result->pdata, 0, maxPolys, maxPolys);
230 
231  if (do_vtargetmap) {
232  /* second half is filled with -1 */
233  vtargetmap = MEM_malloc_arrayN(maxVerts, sizeof(int[2]), "MOD_mirror tarmap");
234 
235  vtmap_a = vtargetmap;
236  vtmap_b = vtargetmap + maxVerts;
237  }
238 
239  /* mirror vertex coordinates */
240  mv_prev = result->mvert;
241  mv = mv_prev + maxVerts;
242  for (i = 0; i < maxVerts; i++, mv++, mv_prev++) {
243  mul_m4_v3(mtx, mv->co);
244 
245  if (do_vtargetmap) {
246  /* Compare location of the original and mirrored vertex,
247  * to see if they should be mapped for merging.
248  *
249  * Always merge from the copied into the original vertices so it's possible to
250  * generate a 1:1 mapping by scanning vertices from the beginning of the array
251  * as is done in #BKE_editmesh_vert_coords_when_deformed. Without this,
252  * the coordinates returned will sometimes point to the copied vertex locations, see:
253  * T91444.
254  *
255  * However, such a change also affects non-versionable things like some modifiers binding, so
256  * we cannot enforce that behavior on existing modifiers, in which case we keep using the
257  * old, incorrect behavior of merging the source vertex into its copy.
258  */
259  if (use_correct_order_on_merge) {
260  if (UNLIKELY(len_squared_v3v3(mv_prev->co, mv->co) < tolerance_sq)) {
261  *vtmap_b = i;
262  tot_vtargetmap++;
263 
264  /* average location */
265  mid_v3_v3v3(mv->co, mv_prev->co, mv->co);
266  copy_v3_v3(mv_prev->co, mv->co);
267  }
268  else {
269  *vtmap_b = -1;
270  }
271 
272  /* Fill here to avoid 2x loops. */
273  *vtmap_a = -1;
274  }
275  else {
276  if (UNLIKELY(len_squared_v3v3(mv_prev->co, mv->co) < tolerance_sq)) {
277  *vtmap_a = maxVerts + i;
278  tot_vtargetmap++;
279 
280  /* average location */
281  mid_v3_v3v3(mv->co, mv_prev->co, mv->co);
282  copy_v3_v3(mv_prev->co, mv->co);
283  }
284  else {
285  *vtmap_a = -1;
286  }
287 
288  /* Fill here to avoid 2x loops. */
289  *vtmap_b = -1;
290  }
291 
292  vtmap_a++;
293  vtmap_b++;
294  }
295  }
296 
297  /* handle shape keys */
298  totshape = CustomData_number_of_layers(&result->vdata, CD_SHAPEKEY);
299  for (a = 0; a < totshape; a++) {
301  for (i = maxVerts; i < result->totvert; i++) {
302  mul_m4_v3(mtx, cos[i]);
303  }
304  }
305 
306  /* adjust mirrored edge vertex indices */
307  me = result->medge + maxEdges;
308  for (i = 0; i < maxEdges; i++, me++) {
309  me->v1 += maxVerts;
310  me->v2 += maxVerts;
311  }
312 
313  /* adjust mirrored poly loopstart indices, and reverse loop order (normals) */
314  mp = result->mpoly + maxPolys;
315  ml = result->mloop;
316  for (i = 0; i < maxPolys; i++, mp++) {
317  MLoop *ml2;
318  int j, e;
319 
320  /* reverse the loop, but we keep the first vertex in the face the same,
321  * to ensure that quads are split the same way as on the other side */
323  &result->ldata, &result->ldata, mp->loopstart, mp->loopstart + maxLoops, 1);
324 
325  for (j = 1; j < mp->totloop; j++) {
327  &result->ldata,
328  mp->loopstart + j,
329  mp->loopstart + maxLoops + mp->totloop - j,
330  1);
331  }
332 
333  ml2 = ml + mp->loopstart + maxLoops;
334  e = ml2[0].e;
335  for (j = 0; j < mp->totloop - 1; j++) {
336  ml2[j].e = ml2[j + 1].e;
337  }
338  ml2[mp->totloop - 1].e = e;
339 
340  mp->loopstart += maxLoops;
341  }
342 
343  /* adjust mirrored loop vertex and edge indices */
344  ml = result->mloop + maxLoops;
345  for (i = 0; i < maxLoops; i++, ml++) {
346  ml->v += maxVerts;
347  ml->e += maxEdges;
348  }
349 
350  /* handle uvs,
351  * let tessface recalc handle updating the MTFace data */
352  if (mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V) ||
353  (is_zero_v2(mmd->uv_offset_copy) == false)) {
354  const bool do_mirr_u = (mmd->flag & MOD_MIR_MIRROR_U) != 0;
355  const bool do_mirr_v = (mmd->flag & MOD_MIR_MIRROR_V) != 0;
356  /* If set, flip around center of each tile. */
357  const bool do_mirr_udim = (mmd->flag & MOD_MIR_MIRROR_UDIM) != 0;
358 
359  const int totuv = CustomData_number_of_layers(&result->ldata, CD_MLOOPUV);
360 
361  for (a = 0; a < totuv; a++) {
362  MLoopUV *dmloopuv = CustomData_get_layer_n(&result->ldata, CD_MLOOPUV, a);
363  int j = maxLoops;
364  dmloopuv += j; /* second set of loops only */
365  for (; j-- > 0; dmloopuv++) {
366  if (do_mirr_u) {
367  float u = dmloopuv->uv[0];
368  if (do_mirr_udim) {
369  dmloopuv->uv[0] = ceilf(u) - fmodf(u, 1.0f) + mmd->uv_offset[0];
370  }
371  else {
372  dmloopuv->uv[0] = 1.0f - u + mmd->uv_offset[0];
373  }
374  }
375  if (do_mirr_v) {
376  float v = dmloopuv->uv[1];
377  if (do_mirr_udim) {
378  dmloopuv->uv[1] = ceilf(v) - fmodf(v, 1.0f) + mmd->uv_offset[1];
379  }
380  else {
381  dmloopuv->uv[1] = 1.0f - v + mmd->uv_offset[1];
382  }
383  }
384  dmloopuv->uv[0] += mmd->uv_offset_copy[0];
385  dmloopuv->uv[1] += mmd->uv_offset_copy[1];
386  }
387  }
388  }
389 
390  /* handle custom split normals */
391  if (ob->type == OB_MESH && (((Mesh *)ob->data)->flag & ME_AUTOSMOOTH) &&
393  const int totloop = result->totloop;
394  const int totpoly = result->totpoly;
395  float(*loop_normals)[3] = MEM_calloc_arrayN((size_t)totloop, sizeof(*loop_normals), __func__);
396  CustomData *ldata = &result->ldata;
397  short(*clnors)[2] = CustomData_get_layer(ldata, CD_CUSTOMLOOPNORMAL);
398  MLoopNorSpaceArray lnors_spacearr = {NULL};
399 
400  /* The transform matrix of a normal must be
401  * the transpose of inverse of transform matrix of the geometry... */
402  float mtx_nor[4][4];
403  invert_m4_m4(mtx_nor, mtx);
404  transpose_m4(mtx_nor);
405 
406  /* calculate custom normals into loop_normals, then mirror first half into second half */
407 
410  result->totvert,
411  result->medge,
412  result->totedge,
413  result->mloop,
414  loop_normals,
415  totloop,
416  result->mpoly,
418  totpoly,
419  true,
420  mesh->smoothresh,
421  &lnors_spacearr,
422  clnors,
423  NULL);
424 
425  /* mirroring has to account for loops being reversed in polys in second half */
426  mp = result->mpoly;
427  for (i = 0; i < maxPolys; i++, mp++) {
428  MPoly *mpmirror = result->mpoly + maxPolys + i;
429  int j;
430 
431  for (j = mp->loopstart; j < mp->loopstart + mp->totloop; j++) {
432  int mirrorj = mpmirror->loopstart;
433  if (j > mp->loopstart) {
434  mirrorj += mpmirror->totloop - (j - mp->loopstart);
435  }
436  copy_v3_v3(loop_normals[mirrorj], loop_normals[j]);
437  mul_m4_v3(mtx_nor, loop_normals[mirrorj]);
439  lnors_spacearr.lspacearr[mirrorj], loop_normals[mirrorj], clnors[mirrorj]);
440  }
441  }
442 
443  MEM_freeN(loop_normals);
444  BKE_lnor_spacearr_free(&lnors_spacearr);
445  }
446 
447  /* handle vgroup stuff */
449  if ((mmd->flag & MOD_MIR_VGROUP) && CustomData_has_layer(&result->vdata, CD_MDEFORMVERT)) {
451  maxVerts;
452  int flip_map_len = 0;
453  int *flip_map = BKE_object_defgroup_flip_map(ob, &flip_map_len, false);
454  if (flip_map) {
455  for (i = 0; i < maxVerts; dvert++, i++) {
456  /* merged vertices get both groups, others get flipped */
457  if (use_correct_order_on_merge && do_vtargetmap && (vtargetmap[i + maxVerts] != -1)) {
458  BKE_defvert_flip_merged(dvert - maxVerts, flip_map, flip_map_len);
459  }
460  else if (!use_correct_order_on_merge && do_vtargetmap && (vtargetmap[i] != -1)) {
461  BKE_defvert_flip_merged(dvert, flip_map, flip_map_len);
462  }
463  else {
464  BKE_defvert_flip(dvert, flip_map, flip_map_len);
465  }
466  }
467 
468  MEM_freeN(flip_map);
469  }
470  }
471  }
472 
473  if (do_vtargetmap) {
474  /* slow - so only call if one or more merge verts are found,
475  * users may leave this on and not realize there is nothing to merge - campbell */
476  if (tot_vtargetmap) {
478  result, vtargetmap, tot_vtargetmap, MESH_MERGE_VERTS_DUMP_IF_MAPPED);
479  }
480  MEM_freeN(vtargetmap);
481  }
482 
483  if (mesh_bisect != NULL) {
484  BKE_id_free(NULL, mesh_bisect);
485  }
486 
487  return result;
488 }
typedef float(TangentPoint)[2]
int CustomData_number_of_layers(const struct CustomData *data, int type)
bool CustomData_has_layer(const struct CustomData *data, int type)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_get_layer(const struct CustomData *data, int type)
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
support for deformation groups and hooks.
bool BKE_object_supports_vertex_groups(const struct Object *ob)
int * BKE_object_defgroup_flip_map(const struct Object *ob, int *flip_map_len, bool use_default)
void BKE_defvert_flip(struct MDeformVert *dvert, const int *flip_map, int flip_map_len)
Definition: deform.c:402
void BKE_defvert_flip_merged(struct MDeformVert *dvert, const int *flip_map, int flip_map_len)
Definition: deform.c:416
void BKE_id_free(struct Main *bmain, void *idv)
const float(* BKE_mesh_poly_normals_ensure(const struct Mesh *mesh))[3]
@ MESH_MERGE_VERTS_DUMP_IF_MAPPED
Definition: BKE_mesh.h:818
struct Mesh * BKE_mesh_new_nomain_from_template(const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
struct BMesh * BKE_mesh_to_bmesh_ex(const struct Mesh *me, const struct BMeshCreateParams *create_params, const struct BMeshFromMeshParams *convert_params)
const float(* BKE_mesh_vertex_normals_ensure(const struct Mesh *mesh))[3]
struct Mesh * BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm, const struct CustomData_MeshMasks *cd_mask_extra, const struct Mesh *me_settings)
struct Mesh * BKE_mesh_merge_verts(struct Mesh *mesh, const int *vtargetmap, int tot_vtargetmap, int merge_mode)
Definition: mesh_merge.c:192
void BKE_mesh_normals_loop_split(const struct MVert *mverts, const float(*vert_normals)[3], int numVerts, struct MEdge *medges, int numEdges, struct MLoop *mloops, float(*r_loopnors)[3], int numLoops, struct MPoly *mpolys, const float(*polynors)[3], int numPolys, bool use_split_normals, float split_angle, MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2], int *r_loop_to_poly)
void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr)
void BKE_lnor_space_custom_normal_to_data(MLoopNorSpace *lnor_space, const float custom_lnor[3], short r_clnor_data[2])
MINLINE float max_fff(float a, float b, float c)
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
Definition: math_geom.c:209
MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:259
void unit_m4(float m[4][4])
Definition: rct.c:1090
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1287
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:729
#define mul_m4_series(...)
void transpose_m4(float R[4][4])
Definition: math_matrix.c:1377
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3(float r[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
Definition: math_vector.c:237
MINLINE bool is_zero_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
#define UNPACK3(a)
#define UNLIKELY(x)
#define LIKELY(x)
#define CD_MASK_ORIGINDEX
@ CD_CUSTOMLOOPNORMAL
@ CD_MDEFORMVERT
@ CD_SHAPEKEY
@ CD_MEDGE
@ CD_MVERT
@ CD_MLOOPUV
#define CD_MASK_SHAPEKEY
@ ME_AUTOSMOOTH
@ MOD_MIR_BISECT_AXIS_Z
@ MOD_MIR_MIRROR_U
@ MOD_MIR_BISECT_AXIS_X
@ MOD_MIR_MIRROR_V
@ MOD_MIR_BISECT_FLIP_AXIS_X
@ MOD_MIR_VGROUP
@ MOD_MIR_BISECT_AXIS_Y
@ MOD_MIR_BISECT_FLIP_AXIS_Z
@ MOD_MIR_NO_MERGE
@ MOD_MIR_BISECT_FLIP_AXIS_Y
@ MOD_MIR_MIRROR_UDIM
Object is a sort of wrapper for general info.
@ OB_MESH
Read Guarded memory(de)allocation.
Mesh * BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(MirrorModifierData *mmd, const Mesh *mesh, int axis, const float plane_co[3], float plane_no[3])
void BKE_mesh_mirror_apply_mirror_on_axis(struct Main *bmain, Mesh *mesh, const int axis, const float dist)
Mesh * BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, Object *ob, const Mesh *mesh, const int axis, const bool use_correct_order_on_merge)
void BM_mesh_bisect_plane(BMesh *bm, const float plane[4], const bool use_snap_center, const bool use_tag, const short oflag_center, const short oflag_new, const float eps)
void BM_vert_kill(BMesh *bm, BMVert *v)
Definition: bmesh_core.c:939
@ BM_VERTS_OF_MESH
#define BM_ITER_MESH_MUTABLE(ele, ele_next, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
Definition: bmesh_mesh.cc:258
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMeshParams *params)
@ BMO_FLAG_RESPECT_HIDE
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
#define BMO_FLAG_DEFAULTS
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:34
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:32
#define ceilf(x)
Definition: metal/compat.h:225
#define fmodf(x, y)
Definition: metal/compat.h:230
static unsigned a[3]
Definition: RandGen.cpp:78
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:319
float co[3]
Definition: bmesh_class.h:87
unsigned int v1
unsigned int v2
MLoopNorSpace ** lspacearr
Definition: BKE_mesh.h:560
unsigned int e
unsigned int v
float co[3]
Definition: BKE_main.h:121
struct MEdge * medge
float smoothresh
CustomData vdata
struct MVert * mvert
int totedge
int totvert
struct MLoop * mloop
CustomData pdata
int totpoly
CustomData edata
int totloop
struct MPoly * mpoly
CustomData ldata
struct Object * mirror_ob
float obmat[4][4]
void * data