[Bf-blender-cvs] [9dab2a5892d] greasepencil-object: Back removed property and set as deprecated

Antonio Vazquez noreply at git.blender.org
Sun Feb 25 11:29:48 CET 2018


Commit: 9dab2a5892dd2e2067295fbbb8649bb2025251d7
Author: Antonio Vazquez
Date:   Sun Feb 25 11:29:33 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9dab2a5892dd2e2067295fbbb8649bb2025251d7

Back removed property and set as deprecated

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

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesrna/intern/rna_palette.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index afd0e5d5067..41b63a20f4f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -979,6 +979,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
 							copy_v4_v4(newcolor->rgb, oldcolor->color);
 							copy_v4_v4(newcolor->fill, oldcolor->fill);
 							newcolor->flag = oldcolor->flag;
+							if (oldcolor->flag & PAC_COLOR_DOT) {
+								newcolor->mode = PAC_MODE_DOTS;
+							}
+							else {
+								newcolor->mode = PAC_MODE_LINE;
+							}
 						}
 						/* set first color active by default */
 						if (!BLI_listbase_is_empty(&newpalette->colors)) {
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index df0d8808af9..9692c849b30 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -186,7 +186,7 @@ typedef enum ePaletteColor_Flag {
 	/* Flip fill colors */
 	PAC_COLOR_FLIP_FILL = (1 << 6),
 	/* Stroke use Dots */
-	/* PAC_COLOR_DOT = (1 << 7), DEPRECATED*
+	PAC_COLOR_DOT = (1 << 7), /* deprecated (only for old files) */
 	/* Texture is a pattern */
 	PAC_COLOR_PATTERN = (1 << 8)
 } ePaletteColor_Flag;
diff --git a/source/blender/makesrna/intern/rna_palette.c b/source/blender/makesrna/intern/rna_palette.c
index 4212418a114..b8fc48ee89d 100644
--- a/source/blender/makesrna/intern/rna_palette.c
+++ b/source/blender/makesrna/intern/rna_palette.c
@@ -439,6 +439,13 @@ static void rna_def_palettecolor(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PAC_COLOR_FLIP_FILL);
 	RNA_def_property_ui_text(prop, "Flip", "Flip filling colors");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Palette_dependency_update");
+	prop = RNA_def_property(srna, "use_dot", PROP_BOOLEAN, PROP_NONE);
+
+	/* deprecated - this data was moved to mode */
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", PAC_COLOR_DOT);
+	RNA_def_property_ui_text(prop, "Use Dots", "Draw stroke using dots instead of lines");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Palette_dependency_update");
+	/* ------  */
 
 	prop = RNA_def_property(srna, "use_pattern", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PAC_COLOR_PATTERN);



More information about the Bf-blender-cvs mailing list