Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-27 04:01:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-27 04:01:35 +0400
commitca05219f3ec3574d2e1cb9c8eaa2790f685f26bb (patch)
treeb4cfdda1c423fe0552f024c06363272c5f3d8eff /source/blender/editors/mesh/editmesh_select.c
parent4d802ff682b81143012d9a10cf6a58322dd18d89 (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_select.c')
-rw-r--r--source/blender/editors/mesh/editmesh_select.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index df1a824f3de..deca9228cdf 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -115,6 +115,7 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update)
BMO_op_callf(em->bm, "automerge verts=%hv dist=%f", BM_ELEM_SELECT, scene->toolsettings->doublimit);
if (update) {
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
+ BMEdit_RecalcTessellation(em);
}
}
}
@@ -722,9 +723,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* dependencies graph and notification stuff */
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -763,9 +762,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* dependencies graph and notification stuff */
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -807,9 +804,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
EDBM_selectmode_flush(em);
- /* dependencies graph and notification stuff */
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
/* we succeeded */
return OPERATOR_FINISHED;
@@ -1356,7 +1351,6 @@ static int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, B
/* since you want to create paths with multiple selects, it doesn't have extend option */
static void mouse_mesh_shortest_path(bContext *C, int mval[2])
{
- Object *ob = CTX_data_edit_object(C);
ViewContext vc;
BMEditMesh *em;
BMEdge *e;
@@ -1416,8 +1410,7 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
break;
}
- DAG_id_tag_update(ob->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
+ EDBM_update_generic(C, em, FALSE);
}
}
@@ -2172,8 +2165,7 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- 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, FALSE);
return OPERATOR_FINISHED;
}