[Bf-blender-cvs] [0b734f0] blender-v2.78-release: Fix: Grease Pencil palettes were missing a RNA path callback

Joshua Leung noreply at git.blender.org
Mon Oct 24 13:52:18 CEST 2016


Commit: 0b734f0b591a6e9406bbc177569a94bc88c8a810
Author: Joshua Leung
Date:   Fri Oct 14 01:18:53 2016 +1300
Branches: blender-v2.78-release
https://developer.blender.org/rB0b734f0b591a6e9406bbc177569a94bc88c8a810

Fix: Grease Pencil palettes were missing a RNA path callback

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

M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 7eaf8b6..c9715dd 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 */




More information about the Bf-blender-cvs mailing list