diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-27 04:01:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-27 04:01:35 +0400 |
commit | ca05219f3ec3574d2e1cb9c8eaa2790f685f26bb (patch) | |
tree | b4cfdda1c423fe0552f024c06363272c5f3d8eff /source/blender/editors/mesh/editmesh_add.c | |
parent | 4d802ff682b81143012d9a10cf6a58322dd18d89 (diff) |
fix [#30651] bpy.ops.object.mode_set(...) editmode removes faces.
problem was that BMesh had tessellation call when undo pushes were called.
if python called an operator with no undo push, tessfaces would not be created.
fix this by making it the responsibility of each editmesh operator to re-tessellate, as it is with notifiers and depsgraph.
added EDBM_update_generic() function to add notifier, tag for depsgraph update and optionally re-tessellate.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index cb2442ff0b5..0d40e8585c3 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -98,29 +98,20 @@ static void make_prim_init(bContext *C, const char *idname, ED_object_enter_editmode(C, EM_DO_UNDO | EM_IGNORE_LAYER); /* rare cases the active layer is messed up */ *state = 1; } - else { - DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); - } *dia *= new_primitive_matrix(C, loc, rot, mat); } static void make_prim_finish(bContext *C, int *state, int enter_editmode) { - Object *obedit; - Mesh *me; - BMEditMesh *em; - - obedit = CTX_data_edit_object(C); - me = obedit->data; - em = me->edit_btmesh; + Object *obedit = CTX_data_edit_object(C); + BMEditMesh *em = BMEdit_FromObject(obedit); /* Primitive has all verts selected, use vert select flush * to push this up to edges & faces. */ EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX); - DAG_id_tag_update(obedit->data, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); + EDBM_update_generic(C, em, TRUE); /* userdef */ if (*state && !enter_editmode) { |