diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 9b881c13347..7ba89538b18 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -783,6 +783,16 @@ static void rna_GPencilPalette_info_set(PointerRNA *ptr, const char *value) sizeof(palette->info)); } +static char *rna_GPencilPalette_path(PointerRNA *ptr) +{ + bGPDpalette *palette = ptr->data; + char name_esc[sizeof(palette->info) * 2]; + + BLI_strescape(name_esc, palette->info, sizeof(name_esc)); + + return BLI_sprintfN("palettes[\"%s\"]", name_esc); +} + static char *rna_GPencilPalette_color_path(PointerRNA *ptr) { bGPdata *gpd = ptr->id.data; @@ -1510,6 +1520,7 @@ static void rna_def_gpencil_palette(BlenderRNA *brna) srna = RNA_def_struct(brna, "GPencilPalette", NULL); RNA_def_struct_sdna(srna, "bGPDpalette"); RNA_def_struct_ui_text(srna, "Grease Pencil Palette", "Collection of related palettes"); + RNA_def_struct_path_func(srna, "rna_GPencilPalette_path"); RNA_def_struct_ui_icon(srna, ICON_COLOR); /* Name */ |