Blender V4.3
bmo_utils.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 "MEM_guardedalloc.h"
13
14#include "DNA_mesh_types.h"
15#include "DNA_meshdata_types.h"
16
17#include "BLI_alloca.h"
18#include "BLI_math_matrix.h"
19#include "BLI_math_vector.h"
20
21#include "BKE_attribute.hh"
22#include "BKE_customdata.hh"
23
24#include "bmesh.hh"
25
26#include "intern/bmesh_operators_private.hh" /* own include */
27
28#define ELE_NEW 1
29
31{
32 float vec[3];
33
34 BMO_slot_vec_get(op->slots_in, "co", vec);
35
38}
39
41{
42 BMOIter iter;
43 BMVert *v;
44 float mat[4][4], mat_space[4][4], imat_space[4][4];
45
46 const uint shape_keys_len = BMO_slot_bool_get(op->slots_in, "use_shapekey") ?
48 0;
49 const uint cd_shape_key_offset = CustomData_get_offset(&bm->vdata, CD_SHAPEKEY);
50
51 BMO_slot_mat4_get(op->slots_in, "matrix", mat);
52 BMO_slot_mat4_get(op->slots_in, "space", mat_space);
53
54 if (!is_zero_m4(mat_space)) {
55 invert_m4_m4(imat_space, mat_space);
56 mul_m4_series(mat, imat_space, mat, mat_space);
57 }
58
59 BMO_ITER (v, &iter, op->slots_in, "verts", BM_VERT) {
60 mul_m4_v3(mat, v->co);
61
62 if (shape_keys_len != 0) {
63 float(*co_dst)[3] = static_cast<float(*)[3]>(BM_ELEM_CD_GET_VOID_P(v, cd_shape_key_offset));
64 for (int i = 0; i < shape_keys_len; i++, co_dst++) {
65 mul_m4_v3(mat, *co_dst);
66 }
67 }
68 }
69}
70
72{
73 float mat[4][4], vec[3];
74
75 BMO_slot_vec_get(op->slots_in, "vec", vec);
76
77 unit_m4(mat);
78 copy_v3_v3(mat[3], vec);
79
81 op->flag,
82 "transform matrix=%m4 space=%s verts=%s use_shapekey=%s",
83 mat,
84 op,
85 "space",
86 op,
87 "verts",
88 op,
89 "use_shapekey");
90}
91
93{
94 float mat[3][3], vec[3];
95
96 BMO_slot_vec_get(op->slots_in, "vec", vec);
97
98 unit_m3(mat);
99 mat[0][0] = vec[0];
100 mat[1][1] = vec[1];
101 mat[2][2] = vec[2];
102
104 op->flag,
105 "transform matrix=%m3 space=%s verts=%s use_shapekey=%s",
106 mat,
107 op,
108 "space",
109 op,
110 "verts",
111 op,
112 "use_shapekey");
113}
114
116{
117 float center[3];
118 float mat[4][4];
119
120 BMO_slot_vec_get(op->slots_in, "cent", center);
121 BMO_slot_mat4_get(op->slots_in, "matrix", mat);
122 transform_pivot_set_m4(mat, center);
123
125 op->flag,
126 "transform matrix=%m4 space=%s verts=%s use_shapekey=%s",
127 mat,
128 op,
129 "space",
130 op,
131 "verts",
132 op,
133 "use_shapekey");
134}
135
137{
138 const int cd_loop_mdisp_offset = CustomData_get_offset(&bm->ldata, CD_MDISPS);
139 const bool use_loop_mdisp_flip = BMO_slot_bool_get(op->slots_in, "flip_multires");
140 BMOIter siter;
141 BMFace *f;
142
143 BMO_ITER (f, &siter, op->slots_in, "faces", BM_FACE) {
144 BM_face_normal_flip_ex(bm, f, cd_loop_mdisp_offset, use_loop_mdisp_flip);
145 }
146}
147
148#define SEL_FLAG 1
149#define SEL_ORIG 2
150
152{
153 BMOIter siter;
154 BMFace *f;
155 bool changed = false;
156 BMO_ITER (f, &siter, op->slots_in, "faces", BM_FACE) {
157 if (f->len == 4) {
158 f->l_first = f->l_first->next;
159 changed = true;
160 }
161 }
162 if (changed) {
164 }
165}
166
167static void bmo_face_flag_set_flush(BMesh *bm, BMFace *f, const short oflag, const bool value)
168{
169 BMLoop *l_iter;
170 BMLoop *l_first;
171
172 BMO_face_flag_set(bm, f, oflag, value);
173 l_iter = l_first = BM_FACE_FIRST_LOOP(f);
174 do {
175 BMO_edge_flag_set(bm, l_iter->e, oflag, value);
176 BMO_vert_flag_set(bm, l_iter->v, oflag, value);
177 } while ((l_iter = l_iter->next) != l_first);
178}
179
181 BMOperator *op,
182 const bool use_faces,
183 const bool use_faces_step)
184{
185 BMOIter siter;
186
187 if (!use_faces) {
188 BMVert *v;
189
190 BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
191 bool found = false;
192
193 {
194 BMIter eiter;
195 BMEdge *e;
196
197 BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
199 found = true;
200 break;
201 }
202 }
203 }
204
205 if (found) {
206 if (!use_faces_step) {
207 BMIter eiter;
208 BMEdge *e;
209
210 BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
214 }
215 }
216 }
217 else {
218 BMIter fiter;
219 BMFace *f;
220
221 BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) {
224 }
225 }
226
227 /* handle wire edges (when stepping over faces) */
228 {
229 BMIter eiter;
230 BMEdge *e;
231 BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
232 if (BM_edge_is_wire(e)) {
234 {
237 }
238 }
239 }
240 }
241 }
242 }
243 }
244 }
245 else {
246 BMFace *f;
247
248 BMO_ITER (f, &siter, op->slots_in, "geom", BM_FACE) {
249 BMIter liter;
250 BMLoop *l;
251
252 BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
253 if (!use_faces_step) {
254 BMIter fiter;
255 BMFace *f_other;
256
257 BM_ITER_ELEM (f_other, &fiter, l->e, BM_FACES_OF_EDGE) {
258 if (!BMO_face_flag_test(bm, f_other, SEL_ORIG | SEL_FLAG) &&
260 {
262 }
263 }
264 }
265 else {
266 BMIter fiter;
267 BMFace *f_other;
268
269 BM_ITER_ELEM (f_other, &fiter, l->v, BM_FACES_OF_VERT) {
270 if (!BMO_face_flag_test(bm, f_other, SEL_ORIG | SEL_FLAG) &&
272 {
274 }
275 }
276 }
277 }
278 }
279 }
280}
281
283 BMOperator *op,
284 const bool use_faces,
285 const bool use_faces_step)
286{
287 BMOIter siter;
288
289 if (!use_faces) {
290 BMVert *v;
291
292 BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) {
293 bool found = false;
294
295 if (!use_faces_step) {
296 BMIter eiter;
297 BMEdge *e;
298
299 BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
301 found = true;
302 break;
303 }
304 }
305 }
306 else {
307 BMIter fiter;
308 BMFace *f;
309
310 BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) {
311 if (!BMO_face_flag_test(bm, f, SEL_ORIG)) {
312 found = true;
313 break;
314 }
315 }
316
317 /* handle wire edges (when stepping over faces) */
318 if (!found) {
319 BMIter eiter;
320 BMEdge *e;
321
322 BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
323 if (BM_edge_is_wire(e)) {
325 found = true;
326 break;
327 }
328 }
329 }
330 }
331 }
332
333 if (found) {
334 BMIter eiter;
335 BMEdge *e;
336
338
339 BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
341 }
342 }
343 }
344 }
345 else {
346 BMFace *f;
347
348 BMO_ITER (f, &siter, op->slots_in, "geom", BM_FACE) {
349 BMIter liter;
350 BMLoop *l;
351
352 BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
353
354 if (!use_faces_step) {
355 BMIter fiter;
356 BMFace *f_other;
357
358 BM_ITER_ELEM (f_other, &fiter, l->e, BM_FACES_OF_EDGE) {
359 if (!BMO_face_flag_test(bm, f_other, SEL_ORIG)) {
361 break;
362 }
363 }
364 }
365 else {
366 BMIter fiter;
367 BMFace *f_other;
368
369 BM_ITER_ELEM (f_other, &fiter, l->v, BM_FACES_OF_VERT) {
370 if (!BMO_face_flag_test(bm, f_other, SEL_ORIG)) {
372 break;
373 }
374 }
375 }
376 }
377 }
378 }
379}
380
382{
383 const bool use_faces = BMO_slot_bool_get(op->slots_in, "use_faces");
384 const bool use_face_step = BMO_slot_bool_get(op->slots_in, "use_face_step");
385 const bool constrict = BMO_slot_bool_get(op->slots_in, "use_contract");
386
388
389 if (constrict) {
390 bmo_region_extend_contract(bm, op, use_faces, use_face_step);
391 }
392 else {
393 bmo_region_extend_expand(bm, op, use_faces, use_face_step);
394 }
395
397}
398
400{
401 BMOIter siter;
402 BMIter iter;
403 BMVert *v;
404 BMEdge *e;
405 float(*cos)[3] = static_cast<float(*)[3]>(
406 MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_len(op->slots_in, "verts"), __func__));
407 float *co, *co2, clip_dist = BMO_slot_float_get(op->slots_in, "clip_dist");
408 const float fac = BMO_slot_float_get(op->slots_in, "factor");
409 int i, j, clipx, clipy, clipz;
410 int xaxis, yaxis, zaxis;
411
412 clipx = BMO_slot_bool_get(op->slots_in, "mirror_clip_x");
413 clipy = BMO_slot_bool_get(op->slots_in, "mirror_clip_y");
414 clipz = BMO_slot_bool_get(op->slots_in, "mirror_clip_z");
415
416 xaxis = BMO_slot_bool_get(op->slots_in, "use_axis_x");
417 yaxis = BMO_slot_bool_get(op->slots_in, "use_axis_y");
418 zaxis = BMO_slot_bool_get(op->slots_in, "use_axis_z");
419
420 i = 0;
421 BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
422
423 co = cos[i];
424 zero_v3(co);
425
426 j = 0;
427 BM_ITER_ELEM (e, &iter, v, BM_EDGES_OF_VERT) {
428 co2 = BM_edge_other_vert(e, v)->co;
429 add_v3_v3v3(co, co, co2);
430 j += 1;
431 }
432
433 if (!j) {
434 copy_v3_v3(co, v->co);
435 i++;
436 continue;
437 }
438
439 mul_v3_fl(co, 1.0f / float(j));
440 interp_v3_v3v3(co, v->co, co, fac);
441
442 if (clipx && fabsf(v->co[0]) <= clip_dist) {
443 co[0] = 0.0f;
444 }
445 if (clipy && fabsf(v->co[1]) <= clip_dist) {
446 co[1] = 0.0f;
447 }
448 if (clipz && fabsf(v->co[2]) <= clip_dist) {
449 co[2] = 0.0f;
450 }
451
452 i++;
453 }
454
455 i = 0;
456 BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
457 if (xaxis) {
458 v->co[0] = cos[i][0];
459 }
460 if (yaxis) {
461 v->co[1] = cos[i][1];
462 }
463 if (zaxis) {
464 v->co[2] = cos[i][2];
465 }
466
467 i++;
468 }
469
470 MEM_freeN(cos);
471}
472
473/**************************************************************************** *
474 * Cycle UVs for a face
475 **************************************************************************** */
476
478{
479 BMOIter fs_iter; /* selected faces iterator */
480 BMFace *fs; /* current face */
481 BMIter l_iter; /* iteration loop */
482
483 const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
484 const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_PROP_FLOAT2);
485
486 if (cd_loop_uv_offset != -1) {
487 BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
488 if (use_ccw == false) { /* same loops direction */
489 BMLoop *lf; /* current face loops */
490 float *f_luv; /* first face loop uv */
491 float p_uv[2]; /* previous uvs */
492 float t_uv[2]; /* temp uvs */
493
494 int n = 0;
495 BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
496 /* current loop uv is the previous loop uv */
497 float *luv = BM_ELEM_CD_GET_FLOAT_P(lf, cd_loop_uv_offset);
498 if (n == 0) {
499 f_luv = luv;
500 copy_v2_v2(p_uv, luv);
501 }
502 else {
503 copy_v2_v2(t_uv, luv);
504 copy_v2_v2(luv, p_uv);
505 copy_v2_v2(p_uv, t_uv);
506 }
507 n++;
508 }
509
510 copy_v2_v2(f_luv, p_uv);
511 }
512 else { /* counter loop direction */
513 BMLoop *lf; /* current face loops */
514 float *p_luv; /* previous loop uv */
515 float *luv;
516 float t_uv[2]; /* current uvs */
517
518 int n = 0;
519 BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
520 /* previous loop uv is the current loop uv */
521 luv = BM_ELEM_CD_GET_FLOAT_P(lf, cd_loop_uv_offset);
522 if (n == 0) {
523 p_luv = luv;
524 copy_v2_v2(t_uv, luv);
525 }
526 else {
527 copy_v2_v2(p_luv, luv);
528 p_luv = luv;
529 }
530 n++;
531 }
532
533 copy_v2_v2(luv, t_uv);
534 }
535 }
536 }
537}
538
539/**************************************************************************** *
540 * Reverse UVs for a face
541 **************************************************************************** */
542
543static void bm_face_reverse_uvs(BMFace *f, const int cd_loop_uv_offset)
544{
545 BMIter iter;
546 BMLoop *l;
547 int i;
548
549 float(*uvs)[2] = BLI_array_alloca(uvs, f->len);
550
551 BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
552 float *luv = BM_ELEM_CD_GET_FLOAT_P(l, cd_loop_uv_offset);
553 copy_v2_v2(uvs[i], luv);
554 }
555
556 /* now that we have the uvs in the array, reverse! */
557 BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
558 /* current loop uv is the previous loop uv */
559 float *luv = BM_ELEM_CD_GET_FLOAT_P(l, cd_loop_uv_offset);
560 copy_v2_v2(luv, uvs[(f->len - i - 1)]);
561 }
562}
564{
565 BMOIter iter;
566 BMFace *f;
567 const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_PROP_FLOAT2);
568
569 if (cd_loop_uv_offset != -1) {
570 BMO_ITER (f, &iter, op->slots_in, "faces", BM_FACE) {
571 bm_face_reverse_uvs(f, cd_loop_uv_offset);
572 }
573 }
574}
575
576/**************************************************************************** *
577 * Cycle colors for a face
578 **************************************************************************** */
579
581 int index,
582 int *r_cd_color_offset,
583 int *r_cd_color_type)
584{
585 Mesh me_query = blender::dna::shallow_zero_initialize();
586 CustomData_reset(&me_query.vert_data);
587 CustomData_reset(&me_query.edge_data);
588 CustomData_reset(&me_query.face_data);
589 me_query.corner_data = bm->ldata;
590 *((short *)me_query.id.name) = ID_ME;
591
592 AttributeOwner owner = AttributeOwner::from_id(&me_query.id);
595 if (!layer) {
596 *r_cd_color_offset = -1;
597 return;
598 }
599
600 *r_cd_color_offset = layer->offset;
601 *r_cd_color_type = layer->type;
602}
603
605{
606 BMOIter fs_iter; /* selected faces iterator */
607 BMFace *fs; /* current face */
608 BMIter l_iter; /* iteration loop */
609
610 const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw");
611
612 const int color_index = BMO_slot_int_get(op->slots_in, "color_index");
613
614 int cd_loop_color_offset;
615 int cd_loop_color_type;
616
617 bmo_get_loop_color_ref(bm, color_index, &cd_loop_color_offset, &cd_loop_color_type);
618
619 if (cd_loop_color_offset == -1) {
620 BMO_error_raise(bm, op, BMO_ERROR_CANCEL, "color_index is invalid");
621 return;
622 }
623
624 const size_t size = cd_loop_color_type == CD_PROP_COLOR ? sizeof(MPropCol) : sizeof(MLoopCol);
625 void *p_col; /* previous color */
626 void *t_col = alloca(size); /* Temp color. */
627
628 BMO_ITER (fs, &fs_iter, op->slots_in, "faces", BM_FACE) {
629 if (use_ccw == false) { /* same loops direction */
630 BMLoop *lf; /* current face loops */
631 void *f_lcol; /* first face loop color */
632
633 int n = 0;
634 BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
635 /* current loop color is the previous loop color */
636 void *lcol = BM_ELEM_CD_GET_VOID_P(lf, cd_loop_color_offset);
637
638 if (n == 0) {
639 f_lcol = lcol;
640 p_col = lcol;
641 }
642 else {
643 memcpy(t_col, lcol, size);
644 memcpy(lcol, p_col, size);
645 memcpy(p_col, t_col, size);
646 }
647 n++;
648 }
649
650 memcpy(f_lcol, p_col, size);
651 }
652 else { /* counter loop direction */
653 BMLoop *lf; /* current face loops */
654 void *lcol, *p_lcol;
655
656 int n = 0;
657 BM_ITER_ELEM (lf, &l_iter, fs, BM_LOOPS_OF_FACE) {
658 /* previous loop color is the current loop color */
659 lcol = BM_ELEM_CD_GET_VOID_P(lf, cd_loop_color_offset);
660 if (n == 0) {
661 p_lcol = lcol;
662 memcpy(t_col, lcol, size);
663 }
664 else {
665 memcpy(p_lcol, lcol, size);
666 p_lcol = lcol;
667 }
668 n++;
669 }
670
671 memcpy(lcol, t_col, size);
672 }
673 }
674}
675
676/*************************************************************************** *
677 * Reverse colors for a face
678 *************************************************************************** */
680 const int cd_loop_color_offset,
681 const int cd_loop_color_type)
682{
683 BMIter iter;
684 BMLoop *l;
685 int i;
686
687 const size_t size = cd_loop_color_type == CD_PROP_COLOR ? sizeof(MPropCol) : sizeof(MLoopCol);
688
689 char *cols = static_cast<char *>(alloca(size * f->len));
690
691 char *col = cols;
692 BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
693 void *lcol = BM_ELEM_CD_GET_VOID_P(l, cd_loop_color_offset);
694 memcpy((void *)col, lcol, size);
695 col += size;
696 }
697
698 /* now that we have the uvs in the array, reverse! */
699 BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, i) {
700 /* current loop uv is the previous loop color */
701 void *lcol = BM_ELEM_CD_GET_VOID_P(l, cd_loop_color_offset);
702
703 col = cols + (f->len - i - 1) * size;
704 memcpy(lcol, (void *)col, size);
705 }
706}
707
709{
710 BMOIter iter;
711 BMFace *f;
712
713 const int color_index = BMO_slot_int_get(op->slots_in, "color_index");
714
715 int cd_loop_color_offset;
716 int cd_loop_color_type;
717
718 bmo_get_loop_color_ref(bm, color_index, &cd_loop_color_offset, &cd_loop_color_type);
719
720 if (cd_loop_color_offset == -1) {
721 BMO_error_raise(bm, op, BMO_ERROR_CANCEL, "color_index is invalid");
722 return;
723 }
724
725 BMO_ITER (f, &iter, op->slots_in, "faces", BM_FACE) {
726 bm_face_reverse_colors(f, cd_loop_color_offset, cd_loop_color_type);
727 }
728}
CustomDataLayer * BKE_attribute_from_index(AttributeOwner &owner, int lookup_index, AttrDomainMask domain_mask, eCustomDataMask layer_mask)
Definition attribute.cc:878
@ ATTR_DOMAIN_MASK_CORNER
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
void CustomData_reset(CustomData *data)
int CustomData_number_of_layers(const CustomData *data, eCustomDataType type)
#define BLI_array_alloca(arr, realsize)
Definition BLI_alloca.h:25
void unit_m3(float m[3][3])
void unit_m4(float m[4][4])
Definition rct.c:1127
void transform_pivot_set_m4(float mat[4][4], const float pivot[3])
void mul_m4_v3(const float M[4][4], float r[3])
#define mul_m4_series(...)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
bool is_zero_m4(const float mat[4][4])
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])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
Definition math_vector.c:36
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
@ ID_ME
#define CD_MASK_COLOR_ALL
@ CD_PROP_COLOR
@ CD_PROP_FLOAT2
struct MLoopCol MLoopCol
struct MPropCol MPropCol
Read Guarded memory(de)allocation.
@ BM_LOOP
#define BM_ALL_NOLOOP
@ BM_ELEM_HIDDEN
#define BM_FACE_FIRST_LOOP(p)
#define BM_ELEM_CD_GET_FLOAT_P(ele, offset)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
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.cc:43
@ BM_CREATE_NOP
Definition bmesh_core.hh:24
@ BMO_ERROR_CANCEL
void BMO_error_raise(BMesh *bm, BMOperator *owner, eBMOpErrorLevel level, const char *msg) ATTR_NONNULL(1
#define BM_elem_flag_test(ele, hflag)
#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
#define BM_FACE
#define BM_VERT
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, char htype, 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)
void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, short oflag)
#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_int_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
int BMO_slot_buffer_len(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
#define BMO_face_flag_test(bm, e, oflag)
bool BMO_slot_bool_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name)
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.cc:115
void bmo_region_extend_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:381
void bmo_reverse_uvs_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:563
#define SEL_ORIG
Definition bmo_utils.cc:149
#define ELE_NEW
Definition bmo_utils.cc:28
void bmo_flip_quad_tessellation_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:151
static void bmo_region_extend_expand(BMesh *bm, BMOperator *op, const bool use_faces, const bool use_faces_step)
Definition bmo_utils.cc:180
void bmo_transform_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:40
static void bmo_face_flag_set_flush(BMesh *bm, BMFace *f, const short oflag, const bool value)
Definition bmo_utils.cc:167
void bmo_reverse_colors_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:708
void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:604
static void bm_face_reverse_uvs(BMFace *f, const int cd_loop_uv_offset)
Definition bmo_utils.cc:543
void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:477
static void bm_face_reverse_colors(BMFace *f, const int cd_loop_color_offset, const int cd_loop_color_type)
Definition bmo_utils.cc:679
#define SEL_FLAG
Definition bmo_utils.cc:148
void bmo_translate_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:71
void bmo_create_vert_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:30
void bmo_smooth_vert_exec(BMesh *, BMOperator *op)
Definition bmo_utils.cc:399
static void bmo_get_loop_color_ref(BMesh *bm, int index, int *r_cd_color_offset, int *r_cd_color_type)
Definition bmo_utils.cc:580
void bmo_scale_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:92
static void bmo_region_extend_contract(BMesh *bm, BMOperator *op, const bool use_faces, const bool use_faces_step)
Definition bmo_utils.cc:282
void bmo_reverse_faces_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:136
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
static AttributeOwner from_id(ID *id)
Definition attribute.cc:43
#define fabsf(x)
draw_view in_light_buf[] float
uint col
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
ccl_device_inline float3 cos(float3 v)
BMLoop * l_first
struct BMVert * v
struct BMEdge * e
struct BMLoop * next
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
float co[3]
char elem_index_dirty
CustomData vdata
CustomData ldata
char name[66]
Definition DNA_ID.h:425
CustomData edge_data
CustomData corner_data
CustomData face_data
CustomData vert_data