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/object/object_edit.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/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 03ded30fb59..4d0e67eafee 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -440,11 +440,17 @@ void ED_object_enter_editmode(bContext *C, int flag) ob->mode= OB_MODE_EDIT; if (ob->type==OB_MESH) { + BMEditMesh *em; ok= 1; - scene->obedit= ob; // context sees this - + scene->obedit = ob; /* context sees this */ + EDBM_MakeEditBMesh(CTX_data_tool_settings(C), scene, ob); + em = BMEdit_FromObject(ob); + if (LIKELY(em)) { + BMEdit_RecalcTessellation(em); + } + WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_MESH, scene); } else if (ob->type==OB_ARMATURE) { |