[Bf-blender-cvs] [fe7ea8a24c8] master: Fix T75250: setting greasepencil active layer not refreshing the dopesheet

Philipp Oeser noreply at git.blender.org
Fri Apr 3 10:41:50 CEST 2020


Commit: fe7ea8a24c8a147078d033b76d9a37a84042368c
Author: Philipp Oeser
Date:   Thu Apr 2 16:52:43 2020 +0200
Branches: master
https://developer.blender.org/rBfe7ea8a24c8a147078d033b76d9a37a84042368c

Fix T75250: setting greasepencil active layer not refreshing the dopesheet

This was only reported for the 'Change Active Layer' operator [which was
not setting the channel as selected in the dopesheet], but this is also
the case elsewhere [where BKE_gpencil_layer_active_set is used], namely:
- gp_layer_remove_exec
- gp_layer_copy_exec
- gp_merge_layer_exec
- gp_layer_change_exec
- gp_layer_active_exec
- gp_stroke_separate_exec

We could set GP_LAYER_SELECT "by hand" in
BKE_gpencil_layer_active_set(), but there is already
animchan_sync_gplayer() that does that. For this, we need the
NA_SELECTED notifier though.

Maniphest Tasks: T75250

Differential Revision: https://developer.blender.org/D7311

===================================================================

M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 898facb86e8..a12f960c29e 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -331,6 +331,7 @@ static int gp_layer_remove_exec(bContext *C, wmOperator *op)
   /* notifiers */
   DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+  WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL);
 
   return OPERATOR_FINISHED;
 }
@@ -478,6 +479,7 @@ static int gp_layer_copy_exec(bContext *C, wmOperator *UNUSED(op))
   /* notifiers */
   DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+  WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL);
 
   return OPERATOR_FINISHED;
 }
@@ -1228,6 +1230,7 @@ static int gp_merge_layer_exec(bContext *C, wmOperator *op)
   /* notifiers */
   DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+  WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL);
 
   return OPERATOR_FINISHED;
 }
@@ -1291,6 +1294,7 @@ static int gp_layer_change_exec(bContext *C, wmOperator *op)
   /* updates */
   DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+  WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL);
 
   return OPERATOR_FINISHED;
 }
@@ -1336,6 +1340,7 @@ static int gp_layer_active_exec(bContext *C, wmOperator *op)
   /* updates */
   DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+  WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL);
 
   return OPERATOR_FINISHED;
 }
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 91169b34e34..8c31df02a11 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -4364,6 +4364,7 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op)
   DEG_relations_tag_update(bmain);
   WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);
   WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+  WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL);
 
   return OPERATOR_FINISHED;
 }



More information about the Bf-blender-cvs mailing list