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
This commit is contained in:
committed by
Amélie Fondevilla
parent
3c26f84225
commit
5b0f200ea1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user