[Bf-blender-cvs] [5aacad16e07] master: Fix T61462: Missing update when toggling GP layer visibility in the Outliner
Antonioya
noreply at git.blender.org
Tue Feb 12 17:01:44 CET 2019
Commit: 5aacad16e072ab1f2e76bd75219562f36fab2807
Author: Antonioya
Date: Tue Feb 12 17:01:09 2019 +0100
Branches: master
https://developer.blender.org/rB5aacad16e072ab1f2e76bd75219562f36fab2807
Fix T61462: Missing update when toggling GP layer visibility in the Outliner
===================================================================
M source/blender/editors/space_outliner/outliner_draw.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 37c224d0856..262ffa6b712 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -245,8 +245,11 @@ static void restrictbutton_ebone_visibility_cb(bContext *C, void *UNUSED(poin),
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, NULL);
}
-static void restrictbutton_gp_layer_flag_cb(bContext *C, void *UNUSED(poin), void *UNUSED(poin2))
+static void restrictbutton_gp_layer_flag_cb(bContext *C, void *poin, void *UNUSED(poin2))
{
+ ID *id = (ID *)poin;
+
+ DEG_id_tag_update(id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
}
@@ -681,6 +684,7 @@ static void outliner_draw_restrictbuts(
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
}
else if (tselem->type == TSE_GP_LAYER) {
+ ID *id = tselem->id;
bGPDlayer *gpl = (bGPDlayer *)te->directdata;
bt = uiDefIconButBitS(
@@ -688,7 +692,7 @@ static void outliner_draw_restrictbuts(
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
UI_UNIT_Y, &gpl->flag, 0, 0, 0, 0,
TIP_("Restrict/Allow visibility in the 3D View"));
- UI_but_func_set(bt, restrictbutton_gp_layer_flag_cb, NULL, gpl);
+ UI_but_func_set(bt, restrictbutton_gp_layer_flag_cb, id, gpl);
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
@@ -697,10 +701,8 @@ static void outliner_draw_restrictbuts(
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
UI_UNIT_Y, &gpl->flag, 0, 0, 0, 0,
TIP_("Restrict/Allow editing of strokes and keyframes in this layer"));
- UI_but_func_set(bt, restrictbutton_gp_layer_flag_cb, NULL, gpl);
+ UI_but_func_set(bt, restrictbutton_gp_layer_flag_cb, id, gpl);
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
-
- /* TODO: visibility in renders */
}
else if (outliner_is_collection_tree_element(te)) {
LayerCollection *lc = (tselem->type == TSE_LAYER_COLLECTION) ? te->directdata : NULL;
More information about the Bf-blender-cvs
mailing list