[Bf-blender-cvs] [e2bae71] layers: Add/use DNA_DEPRECATED_LAYERS

Julian Eisel noreply at git.blender.org
Tue Nov 22 14:14:41 CET 2016


Commit: e2bae71afe0b214091341cf13bab25ed9b4923a8
Author: Julian Eisel
Date:   Tue Nov 22 14:04:23 2016 +0100
Branches: layers
https://developer.blender.org/rBe2bae71afe0b214091341cf13bab25ed9b4923a8

Add/use DNA_DEPRECATED_LAYERS

Using DNA_DEPRECATED resulted in thousands of warnings, so rather not use this. These warnings can still be handy though to check for usage of deprecated struct members as we go, so this quick way to toggle them could be handy. Note that this should eventually be replaced by DNA_DEPRECATED once stuff is actually deprecated.

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

M	source/blender/makesdna/DNA_defs.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/intern/makesdna.c

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

diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index fc9dd8f..565ff18 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -58,6 +58,15 @@
 #endif
 
 
+/* 2.8: Allow toggling warnings for members that'll be deprecated during layer system rewrite. */
+#define DNA_DEPRECATED_LAYERS_ALLOW
+
+#ifdef DNA_DEPRECATED_LAYERS_ALLOW
+#  define DNA_DEPRECATED_LAYERS
+#else
+#  define DNA_DEPRECATED_LAYERS DNA_DEPRECATED
+#endif
+
 /* hrmf, we need a better include then this */
 #include "../blenlib/BLI_sys_types.h" /* needed for int64_t only! */
 
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 6306e7b..15c2741 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -142,8 +142,8 @@ typedef struct Object {
 	ListBase defbase;   /* list of bDeformGroup (vertex groups) names and flag only */
 	ListBase modifiers; /* list of ModifierData structures */
 
-	int mode DNA_DEPRECATED; /* Local object mode - deprecated in 2.8 */
-	int restore_mode DNA_DEPRECATED; /* Keep track of what mode to return to after toggling a mode - deprecated in 2.8 */
+	int mode DNA_DEPRECATED_LAYERS; /* Local object mode - deprecated in 2.8 */
+	int restore_mode DNA_DEPRECATED_LAYERS; /* Keep track of what mode to return to after toggling a mode - deprecated in 2.8 */
 
 	/* materials */
 	struct Material **mat;	/* material slots */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 8e5a120..97c9b1f 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -72,7 +72,7 @@ struct ColorSpace;
 /* Base - Wrapper for referencing Objects in a SceneLayer */
 typedef struct Base {
 	struct Base *next, *prev;
-	unsigned int lay DNA_DEPRECATED;	/* deprecated in 2.8 */
+	unsigned int lay DNA_DEPRECATED_LAYERS;	/* deprecated in 2.8 */
 	unsigned int selcol;
 	int flag;
 	short sx, sy;
@@ -708,8 +708,8 @@ typedef struct RenderData {
 	rcti disprect;
 	
 	/* information on different layers to be rendered */
-	ListBase layers DNA_DEPRECATED; /* deprecated in 2.8 */
-	short actlay DNA_DEPRECATED; /* deprecated in 2.8 */
+	ListBase layers DNA_DEPRECATED_LAYERS; /* deprecated in 2.8 */
+	short actlay DNA_DEPRECATED_LAYERS; /* deprecated in 2.8 */
 	
 	/* number of mblur samples */
 	short mblur_samples;
@@ -791,7 +791,7 @@ typedef struct RenderData {
 	float unit_line_thickness; /* in pixels */
 
 	/* render engine */
-	char engine[32] DNA_DEPRECATED; /* deprecated in 2.8 */
+	char engine[32] DNA_DEPRECATED_LAYERS; /* deprecated in 2.8 */
 
 	/* Cycles baking */
 	struct BakeData bake;
@@ -1592,9 +1592,9 @@ typedef struct Scene {
 	
 	struct Scene *set;
 	
-	ListBase base DNA_DEPRECATED;
-	struct Base *basact DNA_DEPRECATED;		/* active base - deprecated in 2.8 */
-	struct Object *obedit DNA_DEPRECATED;	/* name replaces old G.obedit - deprecated in 2.8 */
+	ListBase base DNA_DEPRECATED_LAYERS;
+	struct Base *basact DNA_DEPRECATED_LAYERS;		/* active base - deprecated in 2.8 */
+	struct Object *obedit DNA_DEPRECATED_LAYERS;	/* name replaces old G.obedit - deprecated in 2.8 */
 	
 	float cursor[3];			/* 3d cursor location */
 	float twcent[3];			/* center for transform widget */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 0f7ed8c..34c7a72 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -497,6 +497,10 @@ static int preprocess_include(char *maindata, int len)
 		else if (cp[-1] == '*' && cp[0] == ' ') {
 			/* pointers with a space */
 		}	/* skip special keywords */
+		else if (strncmp("DNA_DEPRECATED_LAYERS", cp, 21) == 0) {
+			a -= 20;
+			cp += 20;
+		}
 		else if (strncmp("DNA_DEPRECATED", cp, 14) == 0) {
 			/* single values are skipped already, so decrement 1 less */
 			a -= 13;




More information about the Bf-blender-cvs mailing list