From 5b0f200ea14eb15cfec40081244f60a6adfacd49 Mon Sep 17 00:00:00 2001 From: Amelie Fondevilla Date: Fri, 11 Aug 2023 11:31:30 +0200 Subject: [PATCH] GPv3: Fix layer renaming synchronization from the dopesheet Renaming a layer (or a layer group) from a dopesheet was not synchronized with the rest of blender. This patch fixes this by adding the proper notifiers to the RNA layer/layer group properties, and by updating the listeners of the layer treeview (properties panel), and the outliner to redraw the area if a layer was renamed. Pull Request: https://projects.blender.org/blender/blender/pulls/111038 --- source/blender/editors/space_buttons/space_buttons.cc | 2 +- source/blender/editors/space_outliner/space_outliner.cc | 2 +- source/blender/makesrna/intern/rna_grease_pencil.cc | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_buttons/space_buttons.cc b/source/blender/editors/space_buttons/space_buttons.cc index b49d8048c36..0bcc043344e 100644 --- a/source/blender/editors/space_buttons/space_buttons.cc +++ b/source/blender/editors/space_buttons/space_buttons.cc @@ -812,7 +812,7 @@ static void buttons_area_listener(const wmSpaceTypeListenerParams *params) case NC_GPENCIL: switch (wmn->data) { case ND_DATA: - if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED, NA_SELECTED)) { + if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED, NA_SELECTED, NA_RENAME)) { ED_area_tag_redraw(area); } break; diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index 535dea5c69d..bb9933a824a 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -236,7 +236,7 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) } break; case NC_GPENCIL: - if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) { + if (ELEM(wmn->action, NA_EDITED, NA_SELECTED, NA_RENAME)) { ED_region_tag_redraw(region); } break; diff --git a/source/blender/makesrna/intern/rna_grease_pencil.cc b/source/blender/makesrna/intern/rna_grease_pencil.cc index 100be0d7715..3ae536416f0 100644 --- a/source/blender/makesrna/intern/rna_grease_pencil.cc +++ b/source/blender/makesrna/intern/rna_grease_pencil.cc @@ -191,6 +191,7 @@ static void rna_def_grease_pencil_layer(BlenderRNA *brna) "rna_GreasePencilLayer_name_length", "rna_GreasePencilLayer_name_set"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_RENAME, "rna_grease_pencil_update"); /* Visibility */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); @@ -264,6 +265,7 @@ static void rna_def_grease_pencil_layer_group(BlenderRNA *brna) "rna_GreasePencilLayerGroup_name_length", "rna_GreasePencilLayerGroup_name_set"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_RENAME, "rna_grease_pencil_update"); /* Visibility */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);