Blender  V2.93
editmesh_polybuild.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_object_types.h"
27 
28 #include "BLI_math.h"
29 
30 #include "BKE_context.h"
31 #include "BKE_editmesh.h"
32 #include "BKE_layer.h"
33 #include "BKE_mesh.h"
34 #include "BKE_report.h"
35 
36 #include "WM_types.h"
37 
38 #include "ED_mesh.h"
39 #include "ED_object.h"
40 #include "ED_scene.h"
41 #include "ED_screen.h"
42 #include "ED_transform.h"
43 #include "ED_view3d.h"
44 
45 #include "bmesh.h"
46 
47 #include "mesh_intern.h" /* own include */
48 
49 #include "RNA_access.h"
50 #include "RNA_define.h"
51 
52 #include "WM_api.h"
53 
54 #include "DEG_depsgraph.h"
55 
56 /* -------------------------------------------------------------------- */
60 static void edbm_selectmode_ensure(Scene *scene, BMEditMesh *em, short selectmode)
61 {
62  if ((scene->toolsettings->selectmode & selectmode) == 0) {
63  scene->toolsettings->selectmode |= selectmode;
66  }
67 }
68 
69 /* Could make public, for now just keep here. */
70 static void edbm_flag_disable_all_multi(ViewLayer *view_layer, View3D *v3d, const char hflag)
71 {
72  uint objects_len = 0;
74  view_layer, v3d, &objects_len);
75  for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
76  Object *ob_iter = objects[ob_index];
77  BMEditMesh *em_iter = BKE_editmesh_from_object(ob_iter);
78  BMesh *bm_iter = em_iter->bm;
79  if (bm_iter->totvertsel) {
80  EDBM_flag_disable_all(em_iter, hflag);
82  }
83  }
84  MEM_freeN(objects);
85 }
86 
87 /* When accessed as a tool, get the active edge from the preselection gizmo. */
88 static bool edbm_preselect_or_active(bContext *C, const View3D *v3d, Base **r_base, BMElem **r_ele)
89 {
90  ARegion *region = CTX_wm_region(C);
91  const bool show_gizmo = !((v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)));
92 
93  wmGizmoMap *gzmap = show_gizmo ? region->gizmo_map : NULL;
94  wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_mesh_preselect_elem") :
95  NULL;
96  if (gzgroup != NULL) {
97  wmGizmo *gz = gzgroup->gizmos.first;
98  ED_view3d_gizmo_mesh_preselect_get_active(C, gz, r_base, r_ele);
99  }
100  else {
101  ViewLayer *view_layer = CTX_data_view_layer(C);
102  Base *base = view_layer->basact;
103  Object *obedit = base->object;
104  BMEditMesh *em = BKE_editmesh_from_object(obedit);
105  BMesh *bm = em->bm;
106  *r_base = base;
107  *r_ele = BM_mesh_active_elem_get(bm);
108  }
109  return (*r_ele != NULL);
110 }
111 
113  ViewContext *vc,
114  Base **r_base,
115  BMElem **r_ele)
116 {
117  em_setup_viewcontext(C, vc);
118  bool ok = edbm_preselect_or_active(C, vc->v3d, r_base, r_ele);
119  if (ok) {
120  ED_view3d_viewcontext_init_object(vc, (*r_base)->object);
121  }
122  return ok;
123 }
124 
126  wmOperator *UNUSED(op),
127  const wmEvent *UNUSED(event))
128 {
129  ViewContext vc;
130  Base *basact = NULL;
131  BMElem *ele_act = NULL;
132  edbm_preselect_or_active_init_viewcontext(C, &vc, &basact, &ele_act);
133  BMEditMesh *em = vc.em;
134  BMesh *bm = em->bm;
135 
136  invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
138 
139  if (!ele_act) {
140  return OPERATOR_CANCELLED;
141  }
142 
144 
146 
147  if (ele_act->head.htype == BM_VERT) {
148  BM_vert_select_set(bm, (BMVert *)ele_act, true);
149  }
150  if (ele_act->head.htype == BM_EDGE) {
151  BM_edge_select_set(bm, (BMEdge *)ele_act, true);
152  }
153  if (ele_act->head.htype == BM_FACE) {
154  BM_face_select_set(bm, (BMFace *)ele_act, true);
155  }
156 
158  EDBM_update_generic(vc.obedit->data, true, true);
159  if (basact != NULL) {
160  if (vc.view_layer->basact != basact) {
161  ED_object_base_activate(C, basact);
162  }
163  }
164  BM_select_history_store(bm, ele_act);
166  return OPERATOR_FINISHED;
167 }
168 
170 {
171  /* identifiers */
172  ot->name = "Poly Build Transform at Cursor";
173  ot->idname = "MESH_OT_polybuild_transform_at_cursor";
174 
175  /* api callbacks */
178 
179  /* flags */
181 
182  /* to give to transform */
184 }
185 
187  wmOperator *op,
188  const wmEvent *UNUSED(event))
189 {
190  bool changed = false;
191 
192  ViewContext vc;
193  Base *basact = NULL;
194  BMElem *ele_act = NULL;
195  edbm_preselect_or_active_init_viewcontext(C, &vc, &basact, &ele_act);
196  BMEditMesh *em = vc.em;
197  BMesh *bm = em->bm;
198 
199  invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
201 
202  if (!ele_act) {
203  return OPERATOR_CANCELLED;
204  }
205 
207 
208  if (ele_act->head.htype == BM_FACE) {
209  BMFace *f_act = (BMFace *)ele_act;
212  if (!EDBM_op_callf(em, op, "delete geom=%hf context=%i", BM_ELEM_TAG, DEL_FACES)) {
213  return OPERATOR_CANCELLED;
214  }
215  changed = true;
216  }
217  if (ele_act->head.htype == BM_VERT) {
218  BMVert *v_act = (BMVert *)ele_act;
219  if (BM_vert_is_edge_pair(v_act) && !BM_vert_is_wire(v_act)) {
220  BM_edge_collapse(bm, v_act->e, v_act, true, true);
221  changed = true;
222  }
223  else {
226 
227  if (!EDBM_op_callf(em,
228  op,
229  "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
230  BM_ELEM_TAG,
231  false,
232  false)) {
233  return OPERATOR_CANCELLED;
234  }
235  changed = true;
236  }
237  }
238 
239  if (changed) {
241  EDBM_update_generic(vc.obedit->data, true, true);
242  if (basact != NULL) {
243  if (vc.view_layer->basact != basact) {
244  ED_object_base_activate(C, basact);
245  }
246  }
248  return OPERATOR_FINISHED;
249  }
250  return OPERATOR_CANCELLED;
251 }
252 
254 {
255  /* identifiers */
256  ot->name = "Poly Build Delete at Cursor";
257  ot->idname = "MESH_OT_polybuild_delete_at_cursor";
258 
259  /* api callbacks */
262 
263  /* flags */
265 
266  /* to give to transform */
268 }
269 
272 /* -------------------------------------------------------------------- */
277 {
278  float center[3];
279  bool changed = false;
280 
281  ViewContext vc;
282  Base *basact = NULL;
283  BMElem *ele_act = NULL;
284  edbm_preselect_or_active_init_viewcontext(C, &vc, &basact, &ele_act);
285  BMEditMesh *em = vc.em;
286  BMesh *bm = em->bm;
287 
288  invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
290 
292 
293  if (ele_act == NULL || ele_act->head.htype == BM_FACE) {
294  /* Just add vert */
298  mul_m4_v3(vc.obedit->imat, center);
299 
302  BM_vert_select_set(bm, v_new, true);
303  BM_select_history_store(bm, v_new);
304  changed = true;
305  }
306  else if (ele_act->head.htype == BM_EDGE) {
307  BMEdge *e_act = (BMEdge *)ele_act;
308  BMFace *f_reference = e_act->l ? e_act->l->f : NULL;
309 
310  mid_v3_v3v3(center, e_act->v1->co, e_act->v2->co);
313  mul_m4_v3(vc.obedit->imat, center);
314  if (f_reference->len == 3 && RNA_boolean_get(op->ptr, "create_quads")) {
315  const float fac = line_point_factor_v3(center, e_act->v1->co, e_act->v2->co);
316  BMVert *v_new = BM_edge_split(bm, e_act, e_act->v1, NULL, CLAMPIS(fac, 0.0f, 1.0f));
317  copy_v3_v3(v_new->co, center);
319  BM_vert_select_set(bm, v_new, true);
320  BM_select_history_store(bm, v_new);
321  }
322  else {
323  BMVert *v_tri[3];
324  v_tri[0] = e_act->v1;
325  v_tri[1] = e_act->v2;
326  v_tri[2] = BM_vert_create(bm, center, NULL, BM_CREATE_NOP);
327  if (e_act->l && e_act->l->v == v_tri[0]) {
328  SWAP(BMVert *, v_tri[0], v_tri[1]);
329  }
330  BM_face_create_verts(bm, v_tri, 3, f_reference, BM_CREATE_NOP, true);
332  BM_vert_select_set(bm, v_tri[2], true);
333  BM_select_history_store(bm, v_tri[2]);
334  }
335  changed = true;
336  }
337  else if (ele_act->head.htype == BM_VERT) {
338  BMVert *v_act = (BMVert *)ele_act;
339  BMEdge *e_pair[2] = {NULL};
340 
341  if (v_act->e != NULL) {
342  for (uint allow_wire = 0; allow_wire < 2 && (e_pair[1] == NULL); allow_wire++) {
343  int i = 0;
344  BMEdge *e_iter = v_act->e;
345  do {
346  if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) &&
347  (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) {
348  if (i == 2) {
349  e_pair[0] = e_pair[1] = NULL;
350  break;
351  }
352  e_pair[i++] = e_iter;
353  }
354  } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_act)) != v_act->e);
355  }
356  }
357 
358  if (e_pair[1] != NULL) {
359  /* Quad from edge pair. */
360  if (BM_edge_calc_length_squared(e_pair[0]) < BM_edge_calc_length_squared(e_pair[1])) {
361  SWAP(BMEdge *, e_pair[0], e_pair[1]);
362  }
363 
364  BMFace *f_reference = e_pair[0]->l ? e_pair[0]->l->f : NULL;
365 
366  mul_v3_m4v3(center, vc.obedit->obmat, v_act->co);
368  mul_m4_v3(vc.obedit->imat, center);
369 
370  BMVert *v_quad[4];
371  v_quad[0] = v_act;
372  v_quad[1] = BM_edge_other_vert(e_pair[0], v_act);
373  v_quad[2] = BM_vert_create(bm, center, NULL, BM_CREATE_NOP);
374  v_quad[3] = BM_edge_other_vert(e_pair[1], v_act);
375  if (e_pair[0]->l && e_pair[0]->l->v == v_quad[0]) {
376  SWAP(BMVert *, v_quad[1], v_quad[3]);
377  }
378  // BMFace *f_new =
379  BM_face_create_verts(bm, v_quad, 4, f_reference, BM_CREATE_NOP, true);
380 
382  BM_vert_select_set(bm, v_quad[2], true);
383  BM_select_history_store(bm, v_quad[2]);
384  changed = true;
385  }
386  else {
387  /* Just add edge */
389  ED_view3d_win_to_3d_int(vc.v3d, vc.region, v_act->co, event->mval, center);
390  mul_m4_v3(vc.obedit->imat, center);
391 
393 
394  BM_edge_create(bm, v_act, v_new, NULL, BM_CREATE_NOP);
395 
396  BM_vert_select_set(bm, v_new, true);
397  BM_select_history_store(bm, v_new);
398  changed = true;
399  }
400  }
401 
402  if (changed) {
404  EDBM_update_generic(vc.obedit->data, true, true);
405 
406  if (basact != NULL) {
407  if (vc.view_layer->basact != basact) {
408  ED_object_base_activate(C, basact);
409  }
410  }
411 
413 
414  return OPERATOR_FINISHED;
415  }
416  return OPERATOR_CANCELLED;
417 }
418 
420 {
421  /* identifiers */
422  ot->name = "Poly Build Face at Cursor";
423  ot->idname = "MESH_OT_polybuild_face_at_cursor";
424 
425  /* api callbacks */
428 
429  /* flags */
431 
433  "create_quads",
434  true,
435  "Create Quads",
436  "Automatically split edges in triangles to maintain quad topology");
437  /* to give to transform */
439 }
440 
443 /* -------------------------------------------------------------------- */
448  wmOperator *UNUSED(op),
449  const wmEvent *event)
450 {
451  float center[3];
452  bool changed = false;
453 
454  ViewContext vc;
455  Base *basact = NULL;
456  BMElem *ele_act = NULL;
457  edbm_preselect_or_active_init_viewcontext(C, &vc, &basact, &ele_act);
458  BMEditMesh *em = vc.em;
459  BMesh *bm = em->bm;
460 
461  invert_m4_m4(vc.obedit->imat, vc.obedit->obmat);
463 
465 
466  if (ele_act == NULL || ele_act->head.hflag == BM_FACE) {
467  return OPERATOR_PASS_THROUGH;
468  }
469  if (ele_act->head.htype == BM_EDGE) {
470  BMEdge *e_act = (BMEdge *)ele_act;
471  mid_v3_v3v3(center, e_act->v1->co, e_act->v2->co);
474  mul_m4_v3(vc.obedit->imat, center);
475 
476  const float fac = line_point_factor_v3(center, e_act->v1->co, e_act->v2->co);
477  BMVert *v_new = BM_edge_split(bm, e_act, e_act->v1, NULL, CLAMPIS(fac, 0.0f, 1.0f));
478  copy_v3_v3(v_new->co, center);
479 
481  BM_vert_select_set(bm, v_new, true);
482  BM_select_history_store(bm, v_new);
483  changed = true;
484  }
485  else if (ele_act->head.htype == BM_VERT) {
486  /* Just do nothing, allow dragging. */
487  return OPERATOR_FINISHED;
488  }
489 
490  if (changed) {
492  EDBM_update_generic(vc.obedit->data, true, true);
493 
495 
496  if (vc.view_layer->basact != basact) {
497  ED_object_base_activate(C, basact);
498  }
499 
500  return OPERATOR_FINISHED;
501  }
502  return OPERATOR_CANCELLED;
503 }
504 
506 {
507  /* identifiers */
508  ot->name = "Poly Build Split at Cursor";
509  ot->idname = "MESH_OT_polybuild_split_at_cursor";
510 
511  /* api callbacks */
514 
515  /* flags */
517 
518  /* to give to transform */
520 }
521 
524 /* -------------------------------------------------------------------- */
529  wmOperator *op,
530  const wmEvent *UNUSED(event))
531 {
532  bool changed = false;
533 
534  ViewContext vc;
535  Base *basact = NULL;
536  BMElem *ele_act = NULL;
537  edbm_preselect_or_active_init_viewcontext(C, &vc, &basact, &ele_act);
538  BMEditMesh *em = vc.em;
539  BMesh *bm = em->bm;
540 
541  if (ele_act == NULL) {
542  /* pass */
543  }
544  else if (ele_act->head.htype == BM_EDGE) {
545  BMEdge *e_act = (BMEdge *)ele_act;
546  BMLoop *l_a, *l_b;
547  if (BM_edge_loop_pair(e_act, &l_a, &l_b)) {
548  BMFace *f_new = BM_faces_join_pair(bm, l_a, l_b, true);
549  if (f_new) {
550  changed = true;
551  }
552  }
553  }
554  else if (ele_act->head.htype == BM_VERT) {
555  BMVert *v_act = (BMVert *)ele_act;
556  if (BM_vert_is_edge_pair(v_act)) {
557  BM_edge_collapse(bm, v_act->e, v_act, true, true);
558  }
559  else {
560  /* too involved to do inline */
561 
562  /* Avoid using selection so failure wont leave modified state. */
565 
566  if (!EDBM_op_callf(em,
567  op,
568  "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
569  BM_ELEM_TAG,
570  false,
571  false)) {
572  return OPERATOR_CANCELLED;
573  }
574  }
575  changed = true;
576  }
577 
578  if (changed) {
580 
582  EDBM_update_generic(vc.obedit->data, true, true);
583 
584  if (vc.view_layer->basact != basact) {
585  ED_object_base_activate(C, basact);
586  }
587 
589 
590  return OPERATOR_FINISHED;
591  }
592  return OPERATOR_CANCELLED;
593 }
594 
596 {
597  /* identifiers */
598  ot->name = "Poly Build Dissolve at Cursor";
599  ot->idname = "MESH_OT_polybuild_dissolve_at_cursor";
600 
601  /* api callbacks */
604 
605  /* flags */
607 }
608 
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
Definition: editmesh.c:85
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
Definition: BKE_layer.h:426
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
Definition: math_geom.c:3449
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1278
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:732
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:742
MINLINE void copy_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
Definition: math_vector.c:270
unsigned int uint
Definition: BLI_sys_types.h:83
#define CLAMPIS(a, b, c)
#define SWAP(type, a, b)
#define UNUSED(x)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_SELECT
Definition: DNA_ID.h:638
Object is a sort of wrapper for general info.
#define SCE_SELECT_VERTEX
@ V3D_GIZMO_HIDE_TOOL
@ V3D_GIZMO_HIDE
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_PASS_THROUGH
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc)
void EDBM_selectmode_set(struct BMEditMesh *em)
void EDBM_update_generic(struct Mesh *me, const bool do_tessellation, const bool is_destructive)
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag)
void EDBM_mesh_normals_update(struct BMEditMesh *em)
void ED_object_base_activate(struct bContext *C, struct Base *base)
#define P_PROPORTIONAL
Definition: ED_transform.h:124
void Transform_Properties(struct wmOperatorType *ot, int flags)
#define P_MIRROR_DUMMY
Definition: ED_transform.h:123
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
Definition: space_view3d.c:190
void ED_view3d_win_to_3d_int(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
void ED_view3d_gizmo_mesh_preselect_get_active(struct bContext *C, struct wmGizmo *gz, struct Base **r_base, struct BMElem **r_ele)
NSNotificationCenter * center
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:39
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define BM_DISK_EDGE_NEXT(e, v)
Definition: bmesh_class.h:556
@ BM_FACE
Definition: bmesh_class.h:386
@ BM_VERT
Definition: bmesh_class.h:383
@ BM_EDGE
Definition: bmesh_class.h:384
@ BM_ELEM_HIDDEN
Definition: bmesh_class.h:472
@ BM_ELEM_SELECT
Definition: bmesh_class.h:471
@ BM_ELEM_TAG
Definition: bmesh_class.h:484
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
BMFace * BM_face_create_verts(BMesh *bm, BMVert **vert_arr, const int len, const BMFace *f_example, const eBMCreateFlag create_flag, const bool create_edges)
Definition: bmesh_core.c:500
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
Definition: bmesh_core.c:147
@ BM_CREATE_NOP
Definition: bmesh_core.h:27
#define BM_elem_flag_test(ele, hflag)
Definition: bmesh_inline.h:26
#define BM_elem_flag_enable(ele, hflag)
Definition: bmesh_inline.h:28
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
BMElem * BM_mesh_active_elem_get(BMesh *bm)
#define BM_select_history_store(bm, ele)
BMFace * BM_faces_join_pair(BMesh *bm, BMLoop *l_a, BMLoop *l_b, const bool do_del)
Faces Join Pair.
Definition: bmesh_mods.c:221
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
Definition: bmesh_mods.c:591
BMVert * BM_edge_collapse(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces)
Definition: bmesh_mods.c:566
@ DEL_FACES
bool BM_vert_is_wire(const BMVert *v)
Definition: bmesh_query.c:919
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
Definition: bmesh_query.c:753
float BM_edge_calc_length_squared(const BMEdge *e)
Definition: bmesh_query.c:721
bool BM_vert_is_edge_pair(const BMVert *v)
Definition: bmesh_query.c:771
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
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 BMLoop * l_b
Scene scene
static bool edbm_preselect_or_active(bContext *C, const View3D *v3d, Base **r_base, BMElem **r_ele)
static void edbm_flag_disable_all_multi(ViewLayer *view_layer, View3D *v3d, const char hflag)
void MESH_OT_polybuild_transform_at_cursor(wmOperatorType *ot)
static int edbm_polybuild_face_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int edbm_polybuild_dissolve_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int edbm_polybuild_delete_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int edbm_polybuild_transform_at_cursor_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
void MESH_OT_polybuild_face_at_cursor(wmOperatorType *ot)
static int edbm_polybuild_split_at_cursor_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
static void edbm_selectmode_ensure(Scene *scene, BMEditMesh *em, short selectmode)
static bool edbm_preselect_or_active_init_viewcontext(bContext *C, ViewContext *vc, Base **r_base, BMElem **r_ele)
void MESH_OT_polybuild_delete_at_cursor(wmOperatorType *ot)
void MESH_OT_polybuild_dissolve_at_cursor(wmOperatorType *ot)
void MESH_OT_polybuild_split_at_cursor(wmOperatorType *ot)
bool EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt,...)
bool EDBM_view3d_poll(bContext *C)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
struct wmGizmoMap * gizmo_map
BMVert * v1
Definition: bmesh_class.h:134
BMVert * v2
Definition: bmesh_class.h:134
struct BMLoop * l
Definition: bmesh_class.h:140
short selectmode
Definition: BKE_editmesh.h:72
struct BMesh * bm
Definition: BKE_editmesh.h:52
BMHeader head
Definition: bmesh_class.h:255
int len
Definition: bmesh_class.h:279
char htype
Definition: bmesh_class.h:76
char hflag
Definition: bmesh_class.h:78
struct BMVert * v
Definition: bmesh_class.h:165
struct BMFace * f
Definition: bmesh_class.h:183
float co[3]
Definition: bmesh_class.h:99
struct BMEdge * e
Definition: bmesh_class.h:109
int totvertsel
Definition: bmesh_class.h:298
struct Object * object
void * first
Definition: DNA_listBase.h:47
float imat[4][4]
float obmat[4][4]
void * data
struct ToolSettings * toolsettings
View3DCursor cursor
char gizmo_flag
struct Scene * scene
Definition: ED_view3d.h:76
struct ARegion * region
Definition: ED_view3d.h:80
struct ViewLayer * view_layer
Definition: ED_view3d.h:77
struct BMEditMesh * em
Definition: ED_view3d.h:84
struct Object * obedit
Definition: ED_view3d.h:79
struct wmWindow * win
Definition: ED_view3d.h:82
struct View3D * v3d
Definition: ED_view3d.h:81
struct RegionView3D * rv3d
Definition: ED_view3d.h:83
struct Base * basact
int mval[2]
Definition: WM_types.h:583
ListBase gizmos
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
struct StructRNA * srna
Definition: WM_types.h:802
struct PointerRNA * ptr
void WM_event_add_mousemove(wmWindow *win)
wmOperatorType * ot
Definition: wm_files.c:3156
wmGizmoGroup * WM_gizmomap_group_find(struct wmGizmoMap *gzmap, const char *idname)
Definition: wm_gizmo_map.c:219