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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-06-13 16:26:59 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-06-13 17:07:55 +0300
commit9c6522706125794201173207d0caecae0be0b484 (patch)
tree1d779a4262488cede1f5a2d85198aeefdf7d027c /source/blender/editors/uvedit
parentc1e503e89a7c3b463a1ef9fb5845ab6588e3c9a6 (diff)
Tag object/scene for selection update from operators
Before that depsgraph tagging was done from inside notifier listener in viewport. This had the following issues: - If there are no viewports, selection tag was not done. Causing possible issues when object becomes visible. - Required special trickery to detect which data to tag for update. - Was causing crash when transforming/selecting markers in clip editor. This is because selecting marker needed to poke viewport to redraw, since selected bundles will be displayed differently in viewport.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 45a6ccfe28b..e3d2537c040 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -1362,7 +1362,7 @@ static int uv_select_more_less(bContext *C, const bool select)
else {
EDBM_select_less(em, true);
}
-
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
@@ -1434,6 +1434,7 @@ static int uv_select_more_less(bContext *C, const bool select)
uv_select_flush_from_tag_loop(sima, scene, obedit, select);
}
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -2058,6 +2059,7 @@ static int uv_select_all_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
@@ -2371,7 +2373,7 @@ static int uv_mouse_select_multi(
#endif
}
- DEG_id_tag_update(obedit->data, 0);
+ DEG_id_tag_update(obedit->data, DEG_TAG_COPY_ON_WRITE | DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED;
@@ -2547,7 +2549,7 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- DEG_id_tag_update(obedit->data, 0);
+ DEG_id_tag_update(obedit->data, DEG_TAG_COPY_ON_WRITE | DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
@@ -3052,6 +3054,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op)
uv_select_sync_flush(ts, em, select);
if (ts->uv_flag & UV_SYNC_SELECTION) {
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
}
@@ -3181,6 +3184,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
if (changed) {
uv_select_sync_flush(ts, em, select);
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
@@ -3314,6 +3318,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo
uv_select_sync_flush(scene->toolsettings, em, select);
if (ts->uv_flag & UV_SYNC_SELECTION) {
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
}
}
@@ -3746,6 +3751,7 @@ static int uv_select_pinned_exec(bContext *C, wmOperator *UNUSED(op))
}
}
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -3812,6 +3818,8 @@ static int uv_hide_exec(bContext *C, wmOperator *op)
if (ts->uv_flag & UV_SYNC_SELECTION) {
EDBM_mesh_hide(em, swap);
+
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -3880,6 +3888,8 @@ static int uv_hide_exec(bContext *C, wmOperator *op)
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX | SCE_SELECT_EDGE);
BM_select_history_validate(em->bm);
+
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -3933,6 +3943,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *op)
/* call the mesh function if we are in mesh sync sel */
if (ts->uv_flag & UV_SYNC_SELECTION) {
EDBM_mesh_reveal(em, select);
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
@@ -4022,6 +4033,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *op)
/* re-select tagged faces */
BM_mesh_elem_hflag_enable_test(em->bm, BM_FACE, BM_ELEM_SELECT, true, false, BM_ELEM_TAG);
+ DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;