60 view_layer, v3d, &objects_len);
61 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
62 Object *ob_iter = objects[ob_index];
82 if (gzgroup !=
NULL) {
95 return (*r_ele !=
NULL);
145 .calc_looptri = true,
146 .calc_normals = true,
147 .is_destructive = true,
149 if (basact !=
NULL) {
162 ot->
name =
"Poly Build Transform at Cursor";
163 ot->
idname =
"MESH_OT_polybuild_transform_at_cursor";
180 bool changed =
false;
219 "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
232 .calc_looptri = true,
233 .calc_normals = true,
234 .is_destructive = true,
236 if (basact !=
NULL) {
250 ot->
name =
"Poly Build Delete at Cursor";
251 ot->
idname =
"MESH_OT_polybuild_delete_at_cursor";
273 bool changed =
false;
318 v_tri[0] = e_act->
v1;
319 v_tri[1] = e_act->
v2;
321 if (e_act->
l && e_act->
l->
v == v_tri[0]) {
335 if (v_act->
e !=
NULL) {
336 for (
uint allow_wire = 0; allow_wire < 2 && (e_pair[1] ==
NULL); allow_wire++) {
343 e_pair[0] = e_pair[1] =
NULL;
346 e_pair[i++] = e_iter;
352 if (e_pair[1] !=
NULL) {
369 if (e_pair[0]->
l && e_pair[0]->
l->
v == v_quad[0]) {
399 .calc_looptri = true,
400 .calc_normals = true,
401 .is_destructive = true,
404 if (basact !=
NULL) {
420 ot->
name =
"Poly Build Face at Cursor";
421 ot->
idname =
"MESH_OT_polybuild_face_at_cursor";
434 "Automatically split edges in triangles to maintain quad topology");
450 bool changed =
false;
491 .calc_looptri = true,
492 .calc_normals = true,
493 .is_destructive = true,
510 ot->
name =
"Poly Build Split at Cursor";
511 ot->
idname =
"MESH_OT_polybuild_split_at_cursor";
534 bool changed =
false;
543 if (ele_act ==
NULL) {
570 "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
585 .calc_looptri = true,
586 .calc_normals = true,
587 .is_destructive = true,
604 ot->
name =
"Poly Build Dissolve at Cursor";
605 ot->
idname =
"MESH_OT_polybuild_dissolve_at_cursor";
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
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])
void DEG_id_tag_update(struct ID *id, int flag)
Object is a sort of wrapper for general info.
#define SCE_SELECT_VERTEX
void EDBM_update(struct Mesh *me, const struct EDBMUpdate_Params *params)
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc)
void EDBM_selectmode_set(struct BMEditMesh *em)
void EDBM_flag_disable_all(struct BMEditMesh *em, char hflag)
void ED_object_base_activate(struct bContext *C, struct Base *base)
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)
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
NSNotificationCenter * center
Read Guarded memory(de)allocation.
#define BM_DISK_EDGE_NEXT(e, v)
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.
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)
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.
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
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.
BMVert * BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac)
Edge Split.
BMVert * BM_edge_collapse(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool kill_degenerate_faces)
bool BM_vert_is_wire(const BMVert *v)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
float BM_edge_calc_length_squared(const BMEdge *e)
bool BM_vert_is_edge_pair(const BMVert *v)
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
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)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
struct wmGizmoMap * gizmo_map
struct ToolSettings * toolsettings
struct ViewLayer * view_layer
struct RegionView3D * rv3d
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void WM_event_add_mousemove(wmWindow *win)
wmGizmoGroup * WM_gizmomap_group_find(struct wmGizmoMap *gzmap, const char *idname)