diff options
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/mesh/editface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude.c | 5 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife_project.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 31 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 9 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 9 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_mirror.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 6 |
10 files changed, 27 insertions, 44 deletions
diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 57bf67e825e..9a779db4812 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../../blentranslation ../../bmesh ../../depsgraph + ../../draw ../../gpu ../../imbuf ../../makesdna diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index d61c340f7a2..9a70b0a8d36 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -77,7 +77,7 @@ void paintface_flush_flags(struct bContext *C, Object *ob, short flag) BKE_mesh_flush_select_from_polys(me); } - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); if (ob_eval == NULL) { diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index 0da4d20c6b5..5b16cfd00f5 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -658,6 +658,7 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot) static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { + struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc; BMVert *v1; BMIter iter; @@ -819,7 +820,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w /* also project the source, for retopo workflow */ if (use_proj) { - EDBM_project_snap_verts(C, vc.ar, vc.em); + EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em); } } @@ -852,7 +853,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w } if (use_proj) { - EDBM_project_snap_verts(C, vc.ar, vc.em); + EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em); } /* This normally happens when pushing undo but modal operators diff --git a/source/blender/editors/mesh/editmesh_knife_project.c b/source/blender/editors/mesh/editmesh_knife_project.c index 13bcb1334a9..3d34a4ad3b5 100644 --- a/source/blender/editors/mesh/editmesh_knife_project.c +++ b/source/blender/editors/mesh/editmesh_knife_project.c @@ -57,7 +57,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, Object *ob, LinkNode *polys) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ARegion *ar = CTX_wm_region(C); struct Mesh *me_eval; bool me_eval_needs_free; @@ -173,7 +173,7 @@ void MESH_OT_knife_project(wmOperatorType *ot) ot->poll = ED_operator_editmesh_region_view3d; /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* parameters */ RNA_def_boolean(ot->srna, diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index c7606758b63..2ddd654f824 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -272,7 +272,7 @@ static int ringsel_init(bContext *C, wmOperator *op, bool do_cut) em_setup_viewcontext(C, &lcd->vc); - lcd->depsgraph = CTX_data_depsgraph(C); + lcd->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); /* assign the drawing handle for drawing preview line... */ lcd->ar = CTX_wm_region(C); diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 7b770f055b4..12b5a36c510 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -68,6 +68,8 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" +#include "DRW_engine.h" + #include "mesh_intern.h" /* own include */ /* use bmesh operator flags for a few operators */ @@ -197,15 +199,11 @@ void EDBM_automerge(Scene *scene, Object *obedit, bool update, const char hflag) /** \name Back-Buffer OpenGL Selection * \{ */ -static BMElem *EDBM_select_id_bm_elem_get(struct EDSelectID_Context *sel_id_ctx, - Base **bases, - const uint sel_id, - uint *r_base_index) +static BMElem *edbm_select_id_bm_elem_get(Base **bases, const uint sel_id, uint *r_base_index) { uint elem_id; char elem_type = 0; - bool success = ED_view3d_select_id_elem_get( - sel_id_ctx, sel_id, &elem_id, r_base_index, &elem_type); + bool success = DRW_select_elem_get(sel_id, &elem_id, r_base_index, &elem_type); if (success) { Object *obedit = bases[*r_base_index]->object; @@ -335,20 +333,17 @@ BMVert *EDBM_vert_find_nearest_ex(ViewContext *vc, { FAKE_SELECT_MODE_BEGIN(vc, fake_select_mode, select_mode, SCE_SELECT_VERTEX); - struct EDSelectID_Context *sel_id_ctx = ED_view3d_select_id_context_create( - vc, bases, bases_len, select_mode); + DRW_draw_select_id(vc->depsgraph, vc->ar, vc->v3d, bases, bases_len, select_mode); index = ED_select_buffer_find_nearest_to_point(vc->mval, 1, UINT_MAX, &dist_px); if (index) { - eve = (BMVert *)EDBM_select_id_bm_elem_get(sel_id_ctx, bases, index, &base_index); + eve = (BMVert *)edbm_select_id_bm_elem_get(bases, index, &base_index); } else { eve = NULL; } - ED_view3d_select_id_context_destroy(sel_id_ctx); - FAKE_SELECT_MODE_END(vc, fake_select_mode); } @@ -564,20 +559,17 @@ BMEdge *EDBM_edge_find_nearest_ex(ViewContext *vc, { FAKE_SELECT_MODE_BEGIN(vc, fake_select_mode, select_mode, SCE_SELECT_EDGE); - struct EDSelectID_Context *sel_id_ctx = ED_view3d_select_id_context_create( - vc, bases, bases_len, select_mode); + DRW_draw_select_id(vc->depsgraph, vc->ar, vc->v3d, bases, bases_len, select_mode); index = ED_select_buffer_find_nearest_to_point(vc->mval, 1, UINT_MAX, &dist_px); if (index) { - eed = (BMEdge *)EDBM_select_id_bm_elem_get(sel_id_ctx, bases, index, &base_index); + eed = (BMEdge *)edbm_select_id_bm_elem_get(bases, index, &base_index); } else { eed = NULL; } - ED_view3d_select_id_context_destroy(sel_id_ctx); - FAKE_SELECT_MODE_END(vc, fake_select_mode); } @@ -777,20 +769,17 @@ BMFace *EDBM_face_find_nearest_ex(ViewContext *vc, { FAKE_SELECT_MODE_BEGIN(vc, fake_select_mode, select_mode, SCE_SELECT_FACE); - struct EDSelectID_Context *sel_id_ctx = ED_view3d_select_id_context_create( - vc, bases, bases_len, select_mode); + DRW_draw_select_id(vc->depsgraph, vc->ar, vc->v3d, bases, bases_len, select_mode); index = ED_select_buffer_sample_point(vc->mval); if (index) { - efa = (BMFace *)EDBM_select_id_bm_elem_get(sel_id_ctx, bases, index, &base_index); + efa = (BMFace *)edbm_select_id_bm_elem_get(bases, index, &base_index); } else { efa = NULL; } - ED_view3d_select_id_context_destroy(sel_id_ctx); - FAKE_SELECT_MODE_END(vc, fake_select_mode); } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 919de4cdb20..ecdf103e6eb 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -411,7 +411,7 @@ void MESH_OT_unsubdivide(wmOperatorType *ot) ot->srna, "iterations", 2, 1, 1000, "Iterations", "Number of times to unsubdivide", 1, 100); } -void EDBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em) +void EDBM_project_snap_verts(bContext *C, Depsgraph *depsgraph, ARegion *ar, BMEditMesh *em) { Main *bmain = CTX_data_main(C); Object *obedit = em->ob; @@ -421,7 +421,7 @@ void EDBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em) ED_view3d_init_mats_rv3d(obedit, ar->regiondata); struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d( - bmain, CTX_data_scene(C), CTX_data_depsgraph(C), 0, ar, CTX_wm_view3d(C)); + bmain, CTX_data_scene(C), depsgraph, 0, ar, CTX_wm_view3d(C)); BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { @@ -4593,7 +4593,8 @@ static int edbm_fill_grid_exec(bContext *C, wmOperator *op) /* Only reuse on redo because these settings need to match the current selection. * We never want to use them on other geometry, repeat last for eg, see: T60777. */ - if ((op->flag & OP_IS_REPEAT_LAST) == 0 && RNA_property_is_set(op->ptr, prop_span)) { + if (((op->flag & OP_IS_INVOKE) || (op->flag & OP_IS_REPEAT_LAST) == 0) && + RNA_property_is_set(op->ptr, prop_span)) { span = RNA_property_int_get(op->ptr, prop_span); span = min_ii(span, (clamp / 2) - 1); calc_span = false; @@ -8615,7 +8616,7 @@ static int edbm_normals_tools_exec(bContext *C, wmOperator *op) switch (mode) { case EDBM_CLNOR_TOOLS_COPY: - if (bm->totfacesel == 0 || bm->totvertsel == 0) { + if (bm->totfacesel == 0 && bm->totvertsel == 0) { BM_loop_normal_editdata_array_free(lnors_ed_arr); continue; } diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index e823fb46140..7071258d8cf 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -699,7 +699,6 @@ typedef struct MeshUndoStep_Elem { typedef struct MeshUndoStep { UndoStep step; - struct UndoIDPtrMap *id_map; MeshUndoStep_Elem *elems; uint elems_len; } MeshUndoStep; @@ -788,10 +787,6 @@ static void mesh_undosys_step_free(UndoStep *us_p) undomesh_free_data(&elem->data); } MEM_freeN(us->elems); - - if (us->id_map != NULL) { - BKE_undosys_ID_map_destroy(us->id_map); - } } static void mesh_undosys_foreach_ID_ref(UndoStep *us_p, @@ -804,10 +799,6 @@ static void mesh_undosys_foreach_ID_ref(UndoStep *us_p, MeshUndoStep_Elem *elem = &us->elems[i]; foreach_ID_ref_fn(user_data, ((UndoRefID *)&elem->obedit_ref)); } - - if (us->id_map != NULL) { - BKE_undosys_ID_map_foreach_ID_ref(us->id_map, foreach_ID_ref_fn, user_data); - } } /* Export for ED_undo_sys. */ diff --git a/source/blender/editors/mesh/mesh_mirror.c b/source/blender/editors/mesh/mesh_mirror.c index d76801a2500..e086eda9b33 100644 --- a/source/blender/editors/mesh/mesh_mirror.c +++ b/source/blender/editors/mesh/mesh_mirror.c @@ -278,7 +278,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, } if ((tot_unique <= tot_unique_prev) && (tot_unique_edges <= tot_unique_edges_prev)) { - /* Finish searching for unique values when 1 loop dosn't give a + /* Finish searching for unique values when 1 loop doesn't give a * higher number of unique values compared to the previous loop. */ break; } diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 41736fb9a14..b082af352b2 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -311,7 +311,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); /* count & check */ CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { @@ -674,7 +674,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); Object *ob_active = CTX_data_active_object(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Mesh *me = (Mesh *)ob_active->data; Mesh *selme = NULL; Mesh *me_deformed = NULL; @@ -1165,7 +1165,7 @@ static void ed_mesh_pick_face_vert__mpoly_find( bool ED_mesh_pick_face_vert( bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); unsigned int poly_index; Mesh *me = ob->data; |