Blender V5.3
editmesh_polybuild.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 <algorithm>
13
14#include "DNA_mesh_types.h"
15#include "DNA_object_types.h"
16
17#include "BKE_context.hh"
18#include "BKE_editmesh.hh"
19#include "BKE_layer.hh"
20#include "BKE_object_types.hh"
21#include "BKE_screen.hh"
22
23#include "BLI_listbase.hh"
24#include "BLI_math_geom_c.hh"
25#include "BLI_math_matrix_c.hh"
26#include "BLI_math_vector_c.hh"
27
28#include "WM_types.hh"
29
30#include "ED_mesh.hh"
31#include "ED_object.hh"
32#include "ED_transform.hh"
33#include "ED_view3d.hh"
34
35#include "bmesh.hh"
36
37#include "mesh_intern.hh" /* own include */
38
39#include "RNA_access.hh"
40#include "RNA_define.hh"
41
42#include "WM_api.hh"
43
44#include "DEG_depsgraph.hh"
45
46namespace blender {
47
48/* -------------------------------------------------------------------- */
51
52static void edbm_selectmode_ensure(Scene *scene, BMEditMesh *em, BMesh *bm, short selectmode)
53{
54 if ((scene->toolsettings->selectmode & selectmode) == 0) {
55 scene->toolsettings->selectmode |= selectmode;
57 }
58}
59
60/* Could make public, for now just keep here. */
62 const Main &bmain, const Scene *scene, ViewLayer *view_layer, View3D *v3d, const char hflag)
63{
65 bmain, scene, view_layer, v3d);
66 for (Object *ob_iter : objects) {
68 if (bm->totvertsel) {
70 DEG_id_tag_update(ob_iter->data, ID_RECALC_SELECT);
71 }
72 }
73}
74
76static bool edbm_preselect_or_active(bContext *C, const View3D *v3d, Base **r_base, BMElem **r_ele)
77{
78 ARegion *region = CTX_wm_region(C);
79 const bool show_gizmo = !(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL));
80
81 wmGizmoMap *gzmap = show_gizmo ? region->runtime->gizmo_map : nullptr;
82 wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_mesh_preselect_elem") :
83 nullptr;
84
85 if (gzgroup != nullptr) {
86 /* Check the gizmo can draw, if not the state may be stale
87 * or if the gizmo group has never drawn the list may even be empty, see: #141336.
88 *
89 * NOTE(ideasman42): we could also fail with an error in this case,
90 * however that would be quite disruptive, so fallback to the active element. */
92 /* Typically only reached when attempting to use the tool during animation playback. */
93 gzgroup = nullptr;
94 }
95 else if (gzgroup->gizmos.is_empty()) {
96 /* If the gizmo group is drawing it *should* never be empty.
97 * Even so, avoid crashing if it is - investigate if this is ever reached. */
98 BLI_assert(false);
99 gzgroup = nullptr;
100 }
101 }
102
103 if (gzgroup != nullptr) {
104 wmGizmo *gz = gzgroup->gizmos.first();
106 }
107 else {
108 const Main *bmain = CTX_data_main(C);
109 const Scene *scene = CTX_data_scene(C);
110 ViewLayer *view_layer = CTX_data_view_layer(C);
111 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
112 Base *base = BKE_view_layer_active_base_get(view_layer);
113 Object *obedit = base->object;
115 *r_base = base;
116 *r_ele = BM_mesh_active_elem_get(bm);
117 }
118 return (*r_ele != nullptr);
119}
120
122 Base **r_base,
123 BMElem **r_ele)
124{
126 bool ok = edbm_preselect_or_active(C, vc.v3d, r_base, r_ele);
127 if (ok) {
128 ED_view3d_viewcontext_init_object(&vc, (*r_base)->object);
129 }
130 return vc;
131}
132
134 wmOperator * /*op*/,
135 const wmEvent * /*event*/)
136{
137 Base *basact = nullptr;
138 BMElem *ele_act = nullptr;
141
142 invert_m4_m4(vc.obedit->runtime->world_to_object.ptr(), vc.obedit->object_to_world().ptr());
144
145 if (!ele_act) {
146 return OPERATOR_CANCELLED;
147 }
148
150
152
153 if (ele_act->head.htype == BM_VERT) {
154 BM_vert_select_set(bm, reinterpret_cast<BMVert *>(ele_act), true);
155 }
156 if (ele_act->head.htype == BM_EDGE) {
157 BM_edge_select_set(bm, reinterpret_cast<BMEdge *>(ele_act), true);
158 }
159 if (ele_act->head.htype == BM_FACE) {
160 BM_face_select_set(bm, reinterpret_cast<BMFace *>(ele_act), true);
161 }
162
163 EDBMUpdate_Params params{};
164 params.calc_looptris = true;
165 params.calc_normals = true;
166 params.is_destructive = true;
167 EDBM_update(id_cast<Mesh *>(vc.obedit->data), &params);
168 if (basact != nullptr) {
170 if (BKE_view_layer_active_base_get(vc.view_layer) != basact) {
172 }
173 }
174 BM_select_history_store(bm, ele_act);
176 return OPERATOR_FINISHED;
177}
178
180{
181 /* identifiers */
182 ot->name = "Poly Build Transform at Cursor";
183 ot->idname = "MESH_OT_polybuild_transform_at_cursor";
184
185 /* API callbacks. */
188
189 /* flags */
191
192 /* to give to transform */
194}
195
197 wmOperator *op,
198 const wmEvent * /*event*/)
199{
200 bool changed = false;
201 Base *basact = nullptr;
202 BMElem *ele_act = nullptr;
205
206 invert_m4_m4(vc.obedit->runtime->world_to_object.ptr(), vc.obedit->object_to_world().ptr());
208
209 if (!ele_act) {
210 return OPERATOR_CANCELLED;
211 }
212
214
215 if (ele_act->head.htype == BM_FACE) {
216 BMFace *f_act = reinterpret_cast<BMFace *>(ele_act);
219 if (!EDBM_op_callf(bm, op, "delete geom=%hf context=%i", BM_ELEM_TAG, DEL_FACES)) {
220 return OPERATOR_CANCELLED;
221 }
222 changed = true;
223 }
224 if (ele_act->head.htype == BM_VERT) {
225 BMVert *v_act = reinterpret_cast<BMVert *>(ele_act);
226 if (BM_vert_is_edge_pair(v_act) && !BM_vert_is_wire(v_act)) {
227 BM_edge_collapse(bm, v_act->e, v_act, true, true);
228 changed = true;
229 }
230 else {
233
234 if (!EDBM_op_callf(bm,
235 op,
236 "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
238 false,
239 false))
240 {
241 return OPERATOR_CANCELLED;
242 }
243 changed = true;
244 }
245 }
246
247 if (changed) {
248 EDBMUpdate_Params params{};
249 params.calc_looptris = true;
250 params.calc_normals = true;
251 params.is_destructive = true;
252 EDBM_update(id_cast<Mesh *>(vc.obedit->data), &params);
253 if (basact != nullptr) {
255 if (BKE_view_layer_active_base_get(vc.view_layer) != basact) {
257 }
258 }
260 return OPERATOR_FINISHED;
261 }
262 return OPERATOR_CANCELLED;
263}
264
266{
267 /* identifiers */
268 ot->name = "Poly Build Delete at Cursor";
269 ot->idname = "MESH_OT_polybuild_delete_at_cursor";
270
271 /* API callbacks. */
274
275 /* flags */
277
278 /* to give to transform */
280}
281
283
284/* -------------------------------------------------------------------- */
287
289 wmOperator *op,
290 const wmEvent *event)
291{
292 float center[3];
293 bool changed = false;
294
295 Base *basact = nullptr;
296 BMElem *ele_act = nullptr;
299
300 invert_m4_m4(vc.obedit->runtime->world_to_object.ptr(), vc.obedit->object_to_world().ptr());
302
304
305 if (ele_act == nullptr || ele_act->head.htype == BM_FACE) {
306 /* Just add vert */
307 copy_v3_v3(center, vc.scene->cursor.location);
308 mul_v3_m4v3(center, vc.obedit->object_to_world().ptr(), center);
309 ED_view3d_win_to_3d_int(vc.v3d, vc.region, center, event->mval, center);
310 mul_m4_v3(vc.obedit->world_to_object().ptr(), center);
311
312 BMVert *v_new = BM_vert_create(bm, center, nullptr, BM_CREATE_NOP);
314 BM_vert_select_set(bm, v_new, true);
316 changed = true;
317 }
318 else if (ele_act->head.htype == BM_EDGE) {
319 BMEdge *e_act = reinterpret_cast<BMEdge *>(ele_act);
320 BMFace *f_reference = e_act->l ? e_act->l->f : nullptr;
321
322 mid_v3_v3v3(center, e_act->v1->co, e_act->v2->co);
323 mul_m4_v3(vc.obedit->object_to_world().ptr(), center);
324 ED_view3d_win_to_3d_int(vc.v3d, vc.region, center, event->mval, center);
325 mul_m4_v3(vc.obedit->world_to_object().ptr(), center);
326 if (f_reference->len == 3 && RNA_boolean_get(op->ptr, "create_quads")) {
327 const float fac = line_point_factor_v3(center, e_act->v1->co, e_act->v2->co);
328 BMVert *v_new = BM_edge_split(bm, e_act, e_act->v1, nullptr, std::clamp(fac, 0.0f, 1.0f));
329 copy_v3_v3(v_new->co, center);
331 BM_vert_select_set(bm, v_new, true);
333 }
334 else {
335 BMVert *v_tri[3];
336 v_tri[0] = e_act->v1;
337 v_tri[1] = e_act->v2;
338 v_tri[2] = BM_vert_create(bm, center, nullptr, BM_CREATE_NOP);
339 if (e_act->l && e_act->l->v == v_tri[0]) {
340 std::swap(v_tri[0], v_tri[1]);
341 }
342 BM_face_create_verts(bm, v_tri, 3, f_reference, BM_CREATE_NOP, true);
344 BM_vert_select_set(bm, v_tri[2], true);
345 BM_select_history_store(bm, v_tri[2]);
346 }
347 changed = true;
348 }
349 else if (ele_act->head.htype == BM_VERT) {
350 BMVert *v_act = reinterpret_cast<BMVert *>(ele_act);
351 BMEdge *e_pair[2] = {nullptr};
352
353 if (v_act->e != nullptr) {
354 for (uint allow_wire = 0; allow_wire < 2 && (e_pair[1] == nullptr); allow_wire++) {
355 int i = 0;
356 BMEdge *e_iter = v_act->e;
357 do {
358 if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) &&
359 (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter)))
360 {
361 if (i == 2) {
362 e_pair[0] = e_pair[1] = nullptr;
363 break;
364 }
365 e_pair[i++] = e_iter;
366 }
367 } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_act)) != v_act->e);
368 }
369 }
370
371 if (e_pair[1] != nullptr) {
372 /* Quad from edge pair. */
373 if (BM_edge_calc_length_squared(e_pair[0]) < BM_edge_calc_length_squared(e_pair[1])) {
374 std::swap(e_pair[0], e_pair[1]);
375 }
376
377 BMFace *f_reference = e_pair[0]->l ? e_pair[0]->l->f : nullptr;
378
379 mul_v3_m4v3(center, vc.obedit->object_to_world().ptr(), v_act->co);
380 ED_view3d_win_to_3d_int(vc.v3d, vc.region, center, event->mval, center);
381 mul_m4_v3(vc.obedit->world_to_object().ptr(), center);
382
383 BMVert *v_quad[4];
384 v_quad[0] = v_act;
385 v_quad[1] = BM_edge_other_vert(e_pair[0], v_act);
386 v_quad[2] = BM_vert_create(bm, center, nullptr, BM_CREATE_NOP);
387 v_quad[3] = BM_edge_other_vert(e_pair[1], v_act);
388 if (e_pair[0]->l && e_pair[0]->l->v == v_quad[0]) {
389 std::swap(v_quad[1], v_quad[3]);
390 }
391 // BMFace *f_new =
392 BM_face_create_verts(bm, v_quad, 4, f_reference, BM_CREATE_NOP, true);
393
395 BM_vert_select_set(bm, v_quad[2], true);
396 BM_select_history_store(bm, v_quad[2]);
397 changed = true;
398 }
399 else {
400 /* Just add edge */
401 mul_m4_v3(vc.obedit->object_to_world().ptr(), center);
402 ED_view3d_win_to_3d_int(vc.v3d, vc.region, v_act->co, event->mval, center);
403 mul_m4_v3(vc.obedit->world_to_object().ptr(), center);
404
405 BMVert *v_new = BM_vert_create(bm, center, nullptr, BM_CREATE_NOP);
406
407 BM_edge_create(bm, v_act, v_new, nullptr, BM_CREATE_NOP);
408
409 BM_vert_select_set(bm, v_new, true);
411 changed = true;
412 }
413 }
414
415 if (changed) {
416 EDBMUpdate_Params params{};
417 params.calc_looptris = true;
418 params.calc_normals = true;
419 params.is_destructive = true;
420 EDBM_update(id_cast<Mesh *>(vc.obedit->data), &params);
421
422 if (basact != nullptr) {
424 if (BKE_view_layer_active_base_get(vc.view_layer) != basact) {
426 }
427 }
428
430
431 return OPERATOR_FINISHED;
432 }
433 return OPERATOR_CANCELLED;
434}
435
437{
438 /* identifiers */
439 ot->name = "Poly Build Face at Cursor";
440 ot->idname = "MESH_OT_polybuild_face_at_cursor";
441
442 /* API callbacks. */
445
446 /* flags */
448
450 "create_quads",
451 true,
452 "Create Quads",
453 "Automatically split edges in triangles to maintain quad topology");
454 /* to give to transform */
456}
457
459
460/* -------------------------------------------------------------------- */
463
465 wmOperator * /*op*/,
466 const wmEvent *event)
467{
468 float center[3];
469 bool changed = false;
470
471 Base *basact = nullptr;
472 BMElem *ele_act = nullptr;
475
476 invert_m4_m4(vc.obedit->runtime->world_to_object.ptr(), vc.obedit->object_to_world().ptr());
478
480
481 if (ele_act == nullptr || ele_act->head.hflag == BM_FACE) {
483 }
484 if (ele_act->head.htype == BM_EDGE) {
485 BMEdge *e_act = reinterpret_cast<BMEdge *>(ele_act);
486 mid_v3_v3v3(center, e_act->v1->co, e_act->v2->co);
487 mul_m4_v3(vc.obedit->object_to_world().ptr(), center);
488 ED_view3d_win_to_3d_int(vc.v3d, vc.region, center, event->mval, center);
489 mul_m4_v3(vc.obedit->world_to_object().ptr(), center);
490
491 const float fac = line_point_factor_v3(center, e_act->v1->co, e_act->v2->co);
492 BMVert *v_new = BM_edge_split(bm, e_act, e_act->v1, nullptr, std::clamp(fac, 0.0f, 1.0f));
493 copy_v3_v3(v_new->co, center);
494
496 BM_vert_select_set(bm, v_new, true);
498 changed = true;
499 }
500 else if (ele_act->head.htype == BM_VERT) {
501 /* Just do nothing, allow dragging. */
502 return OPERATOR_FINISHED;
503 }
504
505 if (changed) {
506 EDBMUpdate_Params params{};
507 params.calc_looptris = true;
508 params.calc_normals = true;
509 params.is_destructive = true;
510 EDBM_update(id_cast<Mesh *>(vc.obedit->data), &params);
511
513
515 if (BKE_view_layer_active_base_get(vc.view_layer) != basact) {
517 }
518
519 return OPERATOR_FINISHED;
520 }
521 return OPERATOR_CANCELLED;
522}
523
525{
526 /* identifiers */
527 ot->name = "Poly Build Split at Cursor";
528 ot->idname = "MESH_OT_polybuild_split_at_cursor";
529
530 /* API callbacks. */
533
534 /* flags */
536
537 /* to give to transform */
539}
540
542
543/* -------------------------------------------------------------------- */
546
548 wmOperator *op,
549 const wmEvent * /*event*/)
550{
551 bool changed = false;
552
553 Base *basact = nullptr;
554 BMElem *ele_act = nullptr;
557
558 if (ele_act == nullptr) {
559 /* pass */
560 }
561 else if (ele_act->head.htype == BM_EDGE) {
562 BMEdge *e_act = reinterpret_cast<BMEdge *>(ele_act);
563 BMLoop *l_a, *l_b;
564 if (BM_edge_loop_pair(e_act, &l_a, &l_b)) {
565 BMFace *f_double;
566 BMFace *f_new = BM_faces_join_pair(bm, l_a, l_b, true, &f_double);
567 /* See #BM_faces_join note on callers asserting when `r_double` is non-null. */
568 BLI_assert_msg(f_double == nullptr,
569 "Doubled face detected at " AT ". Resulting mesh may be corrupt.");
570
571 if (f_new) {
572 changed = true;
573 }
574 }
575 }
576 else if (ele_act->head.htype == BM_VERT) {
577 BMVert *v_act = reinterpret_cast<BMVert *>(ele_act);
578 if (BM_vert_is_edge_pair(v_act)) {
579 BM_edge_collapse(bm, v_act->e, v_act, true, true);
580 }
581 else {
582 /* too involved to do inline */
583
584 /* Avoid using selection so failure won't leave modified state. */
587
588 if (!EDBM_op_callf(bm,
589 op,
590 "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
592 false,
593 false))
594 {
595 return OPERATOR_CANCELLED;
596 }
597 }
598 changed = true;
599 }
600
601 if (changed) {
603
604 EDBMUpdate_Params params{};
605 EDBM_update(id_cast<Mesh *>(vc.obedit->data), &params);
606
608 if (BKE_view_layer_active_base_get(vc.view_layer) != basact) {
610 }
611
613
614 return OPERATOR_FINISHED;
615 }
616 return OPERATOR_CANCELLED;
617}
618
620{
621 /* identifiers */
622 ot->name = "Poly Build Dissolve at Cursor";
623 ot->idname = "MESH_OT_polybuild_dissolve_at_cursor";
624
625 /* API callbacks. */
628
629 /* flags */
631}
632
634
635} // namespace blender
Object is a sort of wrapper for general info.
#define P_PROPORTIONAL
#define P_MIRROR_DUMMY
#define C
Definition RandGen.cpp:29
#define AT
#define BLI_assert_msg(a, msg)
#define BM_DISK_EDGE_NEXT(e, v)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_select_history_store(bm, ele)
void base_activate(bContext *C, Base *base)
void properties_register(wmOperatorType *ot, int flags)
BMesh Iterators.
void EDBM_flag_disable_all(BMesh *bm, char hflag)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
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)
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void ED_view3d_gizmo_mesh_preselect_get_active(const bContext *C, const wmGizmo *gz, Base **r_base, BMElem **r_ele)
void MESH_OT_polybuild_split_at_cursor(wmOperatorType *ot)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
Definition editmesh.cc:79
static wmOperatorStatus edbm_polybuild_transform_at_cursor_invoke(bContext *C, wmOperator *, const wmEvent *)
MINLINE void copy_v3_v3(float r[3], const float a[3])
unsigned int uint
Definition BKE_text.h:55
ATTR_WARN_UNUSED_RESULT const BMLoop * l
bool EDBM_view3d_poll(bContext *C)
static wmOperatorStatus edbm_polybuild_dissolve_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *)
bool BM_vert_is_wire(const BMVert *v)
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
bool EDBM_op_callf(BMesh *bm, wmOperator *op, const char *fmt,...)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
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.
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ViewLayer * CTX_data_view_layer(const bContext *C)
BMVert * BM_edge_collapse(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces)
static wmOperatorStatus edbm_polybuild_face_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
void mul_m4_v3(const float M[4][4], float r[3])
static void edbm_flag_disable_all_multi(const Main &bmain, const Scene *scene, ViewLayer *view_layer, View3D *v3d, const char hflag)
@ BM_CREATE_NOP
Definition bmesh_core.hh:34
void DEG_id_tag_update(ID *id, unsigned int flags)
bool WM_gizmo_context_check_drawstep(const bContext *C, eWM_GizmoFlagMapDrawStep step)
Definition wm_gizmo.cc:725
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void MESH_OT_polybuild_delete_at_cursor(wmOperatorType *ot)
ViewContext em_setup_viewcontext(bContext *C)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
float BM_edge_calc_length_squared(const BMEdge *e)
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
Main * CTX_data_main(const bContext *C)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
void MESH_OT_polybuild_dissolve_at_cursor(wmOperatorType *ot)
static wmOperatorStatus edbm_polybuild_delete_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *)
@ ID_RECALC_SELECT
Definition DNA_ID.h:1101
static bool edbm_preselect_or_active(bContext *C, const View3D *v3d, Base **r_base, BMElem **r_ele)
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
bool BM_vert_is_edge_pair(const BMVert *v)
wmGizmoGroup * WM_gizmomap_group_find(wmGizmoMap *gzmap, const char *idname)
static ViewContext edbm_preselect_or_active_init_viewcontext(bContext *C, Base **r_base, BMElem **r_ele)
void ED_view3d_win_to_3d_int(const View3D *v3d, const ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
BMFace * BM_faces_join_pair(BMesh *bm, BMLoop *l_a, BMLoop *l_b, const bool do_del, BMFace **r_double)
Faces Join Pair.
void MESH_OT_polybuild_face_at_cursor(wmOperatorType *ot)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
static wmOperatorStatus edbm_polybuild_split_at_cursor_invoke(bContext *C, wmOperator *, const wmEvent *event)
void WM_event_add_mousemove(wmWindow *win)
static void edbm_selectmode_ensure(Scene *scene, BMEditMesh *em, BMesh *bm, short selectmode)
ARegion * CTX_wm_region(const bContext *C)
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.
void EDBM_selectmode_set(BMEditMesh *em, BMesh *bm, short selectmode)
void MESH_OT_polybuild_transform_at_cursor(wmOperatorType *ot)
@ WM_GIZMOMAP_DRAWSTEP_3D
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
bke::ARegionRuntime * runtime
struct BMLoop * l
struct BMEdge * e
struct Object * object
const c_style_mat & ptr() const
bke::ObjectRuntime * runtime
View3DCursor cursor
struct ToolSettings * toolsettings
eView3D_GizmoFlag gizmo_flag
ViewLayer * view_layer
Definition ED_view3d.hh:80
RegionView3D * rv3d
Definition ED_view3d.hh:86
BMEditMesh * em
Definition ED_view3d.hh:87
ListBaseT< wmGizmo > gizmos
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141