Blender  V2.93
bmo_utils.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
24 #include "MEM_guardedalloc.h"
25 
26 #include "DNA_meshdata_types.h"
27 
28 #include "BLI_alloca.h"
29 #include "BLI_math.h"
30 
31 #include "BKE_customdata.h"
32 
33 #include "bmesh.h"
34 
35 #include "intern/bmesh_operators_private.h" /* own include */
36 
37 #define ELE_NEW 1
38 
40 {
41  float vec[3];
42 
43  BMO_slot_vec_get(op->slots_in, "co", vec);
44 
47 }
48 
50 {
51  BMOIter iter;
52  BMVert *v;
53  float mat[4][4], mat_space[4][4], imat_space[4][4];
54 
55  const uint shape_keys_len = BMO_slot_bool_get(op->slots_in, "use_shapekey") ?
57  0;
58  const uint cd_shape_key_offset = CustomData_get_offset(&bm->vdata, CD_SHAPEKEY);
59 
60  BMO_slot_mat4_get(op->slots_in, "matrix", mat);
61  BMO_slot_mat4_get(op->slots_in, "space", mat_space);
62 
63  if (!is_zero_m4(mat_space)) {
64  invert_m4_m4(imat_space, mat_space);
65  mul_m4_series(mat, imat_space, mat, mat_space);
66  }
67 
68  BMO_ITER (v, &iter, op->slots_in, "verts", BM_VERT) {
69  mul_m4_v3(mat, v->co);
70 
71  if (shape_keys_len != 0) {
72  float(*co_dst)[3] = BM_ELEM_CD_GET_VOID_P(v, cd_shape_key_offset);
73  for (int i = 0; i < shape_keys_len; i++, co_dst++) {
74  mul_m4_v3(mat, *co_dst);
75  }
76  }
77  }
78 }
79 
81 {
82  float mat[4][4], vec[3];
83 
84  BMO_slot_vec_get(op->slots_in, "vec", vec);
85 
86  unit_m4(mat);
87  copy_v3_v3(mat[3], vec);
88 
90  op->flag,
91  "transform matrix=%m4 space=%s verts=%s use_shapekey=%s",
92  mat,
93  op,
94  "space",
95  op,
96  "verts",
97  op,
98  "use_shapekey");
99 }
100 
102 {
103  float mat[3][3], vec[3];
104 
105  BMO_slot_vec_get(op->slots_in, "vec", vec);
106 
107  unit_m3(mat);
108  mat[0][0] = vec[0];
109  mat[1][1] = vec[1];
110  mat[2][2] = vec[2];
111 
113  op->flag,
114  "transform matrix=%m3 space=%s verts=%s use_shapekey=%s",
115  mat,
116  op,
117  "space",
118  op,
119  "verts",
120  op,
121  "use_shapekey");
122 }
123 
125 {
126  float center[3];
127  float mat[4][4];
128 
129  BMO_slot_vec_get(op->slots_in, "cent", center);
130  BMO_slot_mat4_get(op->slots_in, "matrix", mat);
132 
134  op->flag,
135  "transform matrix=%m4 space=%s verts=%s use_shapekey=%s",
136  mat,
137  op,
138  "space",
139  op,
140  "verts",
141  op,
142  "use_shapekey");
143 }
144 
146 {
147  const int cd_loop_mdisp_offset = CustomData_get_offset(&bm->ldata, CD_MDISPS);
148  const bool use_loop_mdisp_flip = BMO_slot_bool_get(op->slots_in, "flip_multires");
149  BMOIter siter;
150  BMFace *f;
151 
152  BMO_ITER (f, &siter, op->slots_in, "faces", BM_FACE) {
153  BM_face_normal_flip_ex(bm, f, cd_loop_mdisp_offset, use_loop_mdisp_flip);
154  }
155 }
156 
157 #define SEL_FLAG 1
158 #define SEL_ORIG 2
159 
160 static void bmo_face_flag_set_flush(BMesh *bm, BMFace *f, const short oflag, const bool value)
161 {
162  BMLoop *l_iter;
163  BMLoop *l_first;
164 
165  BMO_face_flag_set(bm, f, oflag, value);
166  l_iter = l_first = BM_FACE_FIRST_LOOP(f);
167  do {
168  BMO_edge_flag_set(bm, l_iter->e, oflag, value);
169  BMO_vert_flag_set(bm, l_iter->v, oflag, value);
170  } while ((l_iter = l_iter->next) != l_first);
171 }
172 
174  BMOperator *op,
175  const bool use_faces,
176  const bool use_faces_step)
177 {
178  BMOIter siter;
179 
180  if (!use_faces) {
181  BMVert *v;
182 
183  BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
184  bool found = false;
185 
186  {
187  BMIter eiter;
188  BMEdge *e;
189 
190  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
192  found = true;
193  break;
194  }
195  }
196  }
197 
198  if (found) {
199  if (!use_faces_step) {
200  BMIter eiter;
201  BMEdge *e;
202 
203  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
207  }
208  }
209  }
210  else {
211  BMIter fiter;
212  BMFace *f;
213 
214  BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) {
217  }
218  }
219 
220  /* handle wire edges (when stepping over faces) */
221  {
222  BMIter eiter;
223  BMEdge *e;
224  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
225  if (BM_edge_is_wire(e)) {
226  if (!BMO_edge_flag_test(bm, e, SEL_FLAG) &&
230  }
231  }
232  }
233  }
234  }
235  }
236  }
237  }
238  else {
239  BMFace *f;
240 
241  BMO_ITER (f, &siter, op->slots_in, "geom", BM_FACE) {
242  BMIter liter;
243  BMLoop *l;
244 
245  BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
246  if (!use_faces_step) {
247  BMIter fiter;
248  BMFace *f_other;
249 
250  BM_ITER_ELEM (f_other, &fiter, l->e, BM_FACES_OF_EDGE) {
251  if (!BMO_face_flag_test(bm, f_other, SEL_ORIG | SEL_FLAG) &&
252  !BM_elem_flag_test(f_other, BM_ELEM_HIDDEN)) {
253  BMO_face_flag_enable(bm, f_other, SEL_FLAG);
254  }
255  }
256  }
257  else {
258  BMIter fiter;
259  BMFace *f_other;
260 
261  BM_ITER_ELEM (f_other, &fiter, l->v, BM_FACES_OF_VERT) {
262  if (!BMO_face_flag_test(bm, f_other, SEL_ORIG | SEL_FLAG) &&
263  !BM_elem_flag_test(f_other, BM_ELEM_HIDDEN)) {
264  BMO_face_flag_enable(bm, f_other, SEL_FLAG);
265  }
266  }
267  }
268  }
269  }
270  }
271 }
272 
274  BMOperator *op,
275  const bool use_faces,
276  const bool use_faces_step)
277 {
278  BMOIter siter;
279 
280  if (!use_faces) {
281  BMVert *v;
282 
283  BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
284  bool found = false;
285 
286  if (!use_faces_step) {
287  BMIter eiter;
288  BMEdge *e;
289 
290  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
291  if (!BMO_edge_flag_test(bm, e, SEL_ORIG)) {
292  found = true;
293  break;
294  }
295  }
296  }
297  else {
298  BMIter fiter;
299  BMFace *f;
300 
301  BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) {
302  if (!BMO_face_flag_test(bm, f, SEL_ORIG)) {
303  found = true;
304  break;
305  }
306  }
307 
308  /* handle wire edges (when stepping over faces) */
309  if (!found) {
310  BMIter eiter;
311  BMEdge *e;
312 
313  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
314  if (BM_edge_is_wire(e)) {
315  if (!BMO_edge_flag_test(bm, e, SEL_ORIG)) {
316  found = true;
317  break;
318  }
319  }
320  }
321  }
322  }
323 
324  if (found) {
325  BMIter eiter;
326  BMEdge *e;
327 
329 
330  BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
332  }
333  }
334  }
335  }
336  else {
337  BMFace *f;
338 
339  BMO_ITER (f, &siter, op->slots_in, "geom", BM_FACE) {
340  BMIter liter;
341  BMLoop *l;
342 
343  BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
344 
345  if (!use_faces_step) {
346  BMIter fiter;
347  BMFace *f_other;
348 
349  BM_ITER_ELEM (f_other, &fiter, l->e, BM_FACES_OF_EDGE) {
350  if (!BMO_face_flag_test(bm, f_other, SEL_ORIG)) {
352  break;
353  }
354  }
355  }
356  else {
357  BMIter fiter;
358  BMFace *f_other;
359 
360  BM_ITER_ELEM (f_other, &fiter, l->v, BM_FACES_OF_VERT) {
361  if (!BMO_face_flag_test(bm, f_other, SEL_ORIG)) {
363  break;
364  }
365  }
366  }
367  }
368  }
369  }
370 }
371 
373 {
374  const bool use_faces = BMO_slot_bool_get(op->slots_in, "use_faces");
375  const bool use_face_step = BMO_slot_bool_get(op->slots_in, "use_face_step");
376  const bool constrict = BMO_slot_bool_get(op->slots_in, "use_contract");
377 
379 
380  if (constrict) {
381  bmo_region_extend_contract(bm, op, use_faces, use_face_step);
382  }
383  else {
384  bmo_region_extend_expand(bm, op, use_faces, use_face_step);
385  }
386 
388 }
389 
391 {
392  BMOIter siter;
393  BMIter iter;
394  BMVert *v;
395  BMEdge *e;
396  float(*cos)[3] = MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_count(op->slots_in, "verts"),
397  __func__);
398  float *co, *co2, clip_dist = BMO_slot_float_get(op->slots_in, "clip_dist");
399  const float fac = BMO_slot_float_get(op->slots_in, "factor");
400  int i, j, clipx, clipy, clipz;
401  int xaxis, yaxis, zaxis;
402 
403  clipx = BMO_slot_bool_get(op->slots_in, "mirror_clip_x");
404  clipy = BMO_slot_bool_get(op->slots_in, "mirror_clip_y");
405  clipz = BMO_slot_bool_get(op->slots_in, "mirror_clip_z");
406 
407  xaxis = BMO_slot_bool_get(op->slots_in, "use_axis_x");
408  yaxis = BMO_slot_bool_get(op->slots_in, "use_axis_y");
409  zaxis = BMO_slot_bool_get(op->slots_in, "use_axis_z");
410 
411  i = 0;
412  BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
413 
414  co = cos[i];
415  zero_v3(co);
416 
417  j = 0;
418  BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
419  co2 = BM_edge_other_vert(e, v)->co;
420  add_v3_v3v3(co, co, co2);
421  j += 1;
422  }
423 
424  if (!j) {
425  copy_v3_v3(co, v->co);
426  i++;
427  continue;
428  }
429 
430  mul_v3_fl(co, 1.0f / (float)j);
431  interp_v3_v3v3(co, v->co, co, fac);
432 
433  if (clipx && fabsf(v->co[0]) <= clip_dist) {
434  co[0] = 0.0f;
435  }
436  if (clipy && fabsf(v->co[1]) <= clip_dist) {
437  co[1] = 0.0f;
438  }
439  if (clipz && fabsf(v->co[2]) <= clip_dist) {
440  co[2] = 0.0f;
441  }
442 
443  i++;
444  }
445 
446  i = 0;
447  BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
448  if (xaxis) {
449  v->co[0] = cos[i][0];
450  }
451  if (yaxis) {
452  v->co[1] = cos[i][1];
453  }
454  if (zaxis) {
455  v->co[2] = cos[i][2];
456  }
457 
458  i++;
459  }
460 
461  MEM_freeN(cos);
462 }
463 
464 /**************************************************************************** *
465  * Cycle UVs for a face
466  **************************************************************************** */
467 
469 {
470  BMOIter fs_iter; /* selected faces iterator */
471  BMFace *fs; /* current face */
472  BMIter l_iter; /* iteration loop */
473 
474  const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
475  const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
476 
477  if (cd_loop_uv_offset != -1) {
478  BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
479  if (use_ccw == false) { /* same loops direction */
480  BMLoop *lf; /* current face loops */
481  MLoopUV *f_luv; /* first face loop uv */
482  float p_uv[2]; /* previous uvs */
483  float t_uv[2]; /* tmp uvs */
484 
485  int n = 0;
486  BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
487  /* current loop uv is the previous loop uv */
488  MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(lf, cd_loop_uv_offset);
489  if (n == 0) {
490  f_luv = luv;
491  copy_v2_v2(p_uv, luv->uv);
492  }
493  else {
494  copy_v2_v2(t_uv, luv->uv);
495  copy_v2_v2(luv->uv, p_uv);
496  copy_v2_v2(p_uv, t_uv);
497  }
498  n++;
499  }
500 
501  copy_v2_v2(f_luv->uv, p_uv);
502  }
503  else { /* counter loop direction */
504  BMLoop *lf; /* current face loops */
505  MLoopUV *p_luv; /* previous loop uv */
506  MLoopUV *luv;
507  float t_uv[2]; /* current uvs */
508 
509  int n = 0;
510  BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
511  /* previous loop uv is the current loop uv */
512  luv = BM_ELEM_CD_GET_VOID_P(lf, cd_loop_uv_offset);
513  if (n == 0) {
514  p_luv = luv;
515  copy_v2_v2(t_uv, luv->uv);
516  }
517  else {
518  copy_v2_v2(p_luv->uv, luv->uv);
519  p_luv = luv;
520  }
521  n++;
522  }
523 
524  copy_v2_v2(luv->uv, t_uv);
525  }
526  }
527  }
528 }
529 
530 /**************************************************************************** *
531  * Reverse UVs for a face
532  **************************************************************************** */
533 
534 static void bm_face_reverse_uvs(BMFace *f, const int cd_loop_uv_offset)
535 {
536  BMIter iter;
537  BMLoop *l;
538  int i;
539 
540  float(*uvs)[2] = BLI_array_alloca(uvs, f->len);
541 
542  BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
543  MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
544  copy_v2_v2(uvs[i], luv->uv);
545  }
546 
547  /* now that we have the uvs in the array, reverse! */
548  BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
549  /* current loop uv is the previous loop uv */
550  MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
551  copy_v2_v2(luv->uv, uvs[(f->len - i - 1)]);
552  }
553 }
555 {
556  BMOIter iter;
557  BMFace *f;
558  const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
559 
560  if (cd_loop_uv_offset != -1) {
561  BMO_ITER (f, &iter, op->slots_in, "faces", BM_FACE) {
562  bm_face_reverse_uvs(f, cd_loop_uv_offset);
563  }
564  }
565 }
566 
567 /**************************************************************************** *
568  * Cycle colors for a face
569  **************************************************************************** */
570 
572 {
573  BMOIter fs_iter; /* selected faces iterator */
574  BMFace *fs; /* current face */
575  BMIter l_iter; /* iteration loop */
576 
577  const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
578  const int cd_loop_color_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPCOL);
579 
580  if (cd_loop_color_offset != -1) {
581  BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
582  if (use_ccw == false) { /* same loops direction */
583  BMLoop *lf; /* current face loops */
584  MLoopCol *f_lcol; /* first face loop color */
585  MLoopCol p_col; /* previous color */
586  MLoopCol t_col; /* tmp color */
587 
588  int n = 0;
589  BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
590  /* current loop color is the previous loop color */
591  MLoopCol *lcol = BM_ELEM_CD_GET_VOID_P(lf, cd_loop_color_offset);
592  if (n == 0) {
593  f_lcol = lcol;
594  p_col = *lcol;
595  }
596  else {
597  t_col = *lcol;
598  *lcol = p_col;
599  p_col = t_col;
600  }
601  n++;
602  }
603 
604  *f_lcol = p_col;
605  }
606  else { /* counter loop direction */
607  BMLoop *lf; /* current face loops */
608  MLoopCol *p_lcol; /* previous loop color */
609  MLoopCol *lcol;
610  MLoopCol t_col; /* current color */
611 
612  int n = 0;
613  BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
614  /* previous loop color is the current loop color */
615  lcol = BM_ELEM_CD_GET_VOID_P(lf, cd_loop_color_offset);
616  if (n == 0) {
617  p_lcol = lcol;
618  t_col = *lcol;
619  }
620  else {
621  *p_lcol = *lcol;
622  p_lcol = lcol;
623  }
624  n++;
625  }
626 
627  *lcol = t_col;
628  }
629  }
630  }
631 }
632 
633 /*************************************************************************** *
634  * Reverse colors for a face
635  *************************************************************************** */
636 static void bm_face_reverse_colors(BMFace *f, const int cd_loop_color_offset)
637 {
638  BMIter iter;
639  BMLoop *l;
640  int i;
641 
642  MLoopCol *cols = BLI_array_alloca(cols, f->len);
643 
644  BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
645  MLoopCol *lcol = BM_ELEM_CD_GET_VOID_P(l, cd_loop_color_offset);
646  cols[i] = *lcol;
647  }
648 
649  /* now that we have the uvs in the array, reverse! */
650  BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
651  /* current loop uv is the previous loop color */
652  MLoopCol *lcol = BM_ELEM_CD_GET_VOID_P(l, cd_loop_color_offset);
653  *lcol = cols[(f->len - i - 1)];
654  }
655 }
657 {
658  BMOIter iter;
659  BMFace *f;
660  const int cd_loop_color_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPCOL);
661 
662  if (cd_loop_color_offset != -1) {
663  BMO_ITER (f, &iter, op->slots_in, "faces", BM_FACE) {
664  bm_face_reverse_colors(f, cd_loop_color_offset);
665  }
666  }
667 }
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
int CustomData_number_of_layers(const struct CustomData *data, int type)
int CustomData_get_offset(const struct CustomData *data, int type)
#define BLI_array_alloca(arr, realsize)
Definition: BLI_alloca.h:36
void unit_m3(float m[3][3])
Definition: math_matrix.c:58
void unit_m4(float m[4][4])
Definition: rct.c:1140
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1278
void transform_pivot_set_m4(float mat[4][4], const float pivot[3])
Definition: math_matrix.c:2411
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:732
#define mul_m4_series(...)
bool is_zero_m4(const float mat[4][4])
Definition: math_matrix.c:2601
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
Definition: math_vector.c:49
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
unsigned int uint
Definition: BLI_sys_types.h:83
#define UNUSED(x)
@ CD_MLOOPCOL
@ CD_SHAPEKEY
@ CD_MLOOPUV
NSNotificationCenter * center
Read Guarded memory(de)allocation.
#define BM_ALL_NOLOOP
Definition: bmesh_class.h:411
@ BM_FACE
Definition: bmesh_class.h:386
@ BM_VERT
Definition: bmesh_class.h:383
@ BM_ELEM_HIDDEN
Definition: bmesh_class.h:472
#define BM_FACE_FIRST_LOOP(p)
Definition: bmesh_class.h:553
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
Definition: bmesh_class.h:530
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
Definition: bmesh_core.c:58
@ BM_CREATE_NOP
Definition: bmesh_core.h:27
#define BM_elem_flag_test(ele, hflag)
Definition: bmesh_inline.h:26
#define BM_ITER_ELEM(ele, iter, data, itype)
@ BM_FACES_OF_EDGE
@ BM_FACES_OF_VERT
@ BM_EDGES_OF_VERT
@ BM_LOOPS_OF_FACE
#define BM_ITER_ELEM_INDEX(ele, iter, data, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BMO_slot_mat4_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_mat[4][4])
void BMO_slot_buffer_flag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
BMO_FLAG_BUFFER.
#define BMO_edge_flag_test(bm, e, oflag)
void BMO_slot_vec_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, float r_vec[3])
#define BMO_edge_flag_enable(bm, e, oflag)
float BMO_slot_float_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
#define BMO_vert_flag_enable(bm, e, oflag)
#define BMO_vert_flag_set(bm, e, oflag, val)
#define BMO_edge_flag_set(bm, e, oflag, val)
#define BMO_face_flag_enable(bm, e, oflag)
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
#define BMO_face_flag_set(bm, e, oflag, val)
int BMO_slot_buffer_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
#define BMO_face_flag_test(bm, e, oflag)
void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const short oflag)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt,...)
ATTR_WARN_UNUSED_RESULT const BMFlagLayer const short oflag
void BM_face_normal_flip_ex(BMesh *bm, BMFace *f, const int cd_loop_mdisp_offset, const bool use_loop_mdisp_flip)
Face Flip Normal.
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
void bmo_rotate_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:124
void bmo_region_extend_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:372
void bmo_reverse_uvs_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:554
#define SEL_ORIG
Definition: bmo_utils.c:158
#define ELE_NEW
Definition: bmo_utils.c:37
static void bmo_region_extend_expand(BMesh *bm, BMOperator *op, const bool use_faces, const bool use_faces_step)
Definition: bmo_utils.c:173
void bmo_transform_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:49
static void bmo_face_flag_set_flush(BMesh *bm, BMFace *f, const short oflag, const bool value)
Definition: bmo_utils.c:160
void bmo_reverse_colors_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:656
void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:571
static void bm_face_reverse_uvs(BMFace *f, const int cd_loop_uv_offset)
Definition: bmo_utils.c:534
void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:468
#define SEL_FLAG
Definition: bmo_utils.c:157
void bmo_translate_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:80
void bmo_create_vert_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:39
static void bm_face_reverse_colors(BMFace *f, const int cd_loop_color_offset)
Definition: bmo_utils.c:636
void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op)
Definition: bmo_utils.c:390
void bmo_scale_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:101
static void bmo_region_extend_contract(BMesh *bm, BMOperator *op, const bool use_faces, const bool use_faces_step)
Definition: bmo_utils.c:273
void bmo_reverse_faces_exec(BMesh *bm, BMOperator *op)
Definition: bmo_utils.c:145
#define fabsf(x)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:319
int len
Definition: bmesh_class.h:279
struct BMVert * v
Definition: bmesh_class.h:165
struct BMEdge * e
Definition: bmesh_class.h:176
struct BMLoop * next
Definition: bmesh_class.h:245
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
float co[3]
Definition: bmesh_class.h:99
CustomData vdata
Definition: bmesh_class.h:337
CustomData ldata
Definition: bmesh_class.h:337