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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-04-02 17:52:43 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-04-03 11:37:21 +0300
commitfe7ea8a24c8a147078d033b76d9a37a84042368c (patch)
tree591a83d912a2b533b039bdcee9ff938faaa39f38
parenta2a70cfc41edf3f8d63dcc6bc8d6b946583bec1a (diff)
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
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c5
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c1
2 files changed, 6 insertions, 0 deletions
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;
}