[Bf-blender-cvs] [3c2186cbbf9] greasepencil-object: GP Palette Slots - Initial DNA structures

Joshua Leung noreply at git.blender.org
Wed Sep 27 08:42:22 CEST 2017


Commit: 3c2186cbbf98eb187c800abcd53fc3e296454a21
Author: Joshua Leung
Date:   Wed Sep 27 19:41:59 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB3c2186cbbf98eb187c800abcd53fc3e296454a21

GP Palette Slots - Initial DNA structures

Start of support for GP "Palette Slots". These act like "Material Slots"
in that they allow a single GP datablock to refer to multiple Palette
datablocks, making it easier for the user to manage the set of available
palettes.

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

M	source/blender/makesdna/DNA_gpencil_types.h

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

diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 948a6cbd79a..3d28bf7b1d7 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -188,6 +188,28 @@ typedef enum eGPDpalette_Flag {
 } eGPDpalette_Flag;
 
 /* ***************************************** */
+/* GP Palette Slots - 2.8+ Replacement for bGPDpalette */
+
+/**
+ * Palette Slot
+ *
+ * This is equivalent to the "Material Slot" concept on normal geometry,
+ * but, instead of referencing a Material, we instead reference Blender
+ * Palette datablocks (since these are used to supply GP colours).
+ *
+ * GP datablocks can have several of these at a time - one for each palette
+ * used by a stroke in the datablock.
+ */
+typedef struct bGPDpaletteref {
+	/* the palette referenced in this slot */
+	Palette *palette;
+	
+	/* settings */
+	int flag;    /* (eGPDpalette_Flag) */
+	int pad;
+} bGPDpaletteref;
+
+/* ***************************************** */
 /* GP Strokes */
 
 /* Grease-Pencil Annotations - 'Stroke'
@@ -376,6 +398,7 @@ typedef struct bGPdata {
 	 
 	/* Palettes */
 	ListBase palettes;          /* list of bGPDpalette's   - Deprecated (2.78 - 2.79 only) */
+	ListBase palette_slots;     /* list of bGPDpaletteref's - (2.8+) */
 	
 	/* Runtime Only - Drawing Manager cache */
 	struct GHash *batch_cache_data;



More information about the Bf-blender-cvs mailing list