[Bf-blender-cvs] [92094c76a94] master: DNA: remove none particle brush & deprecated flags

Campbell Barton noreply at git.blender.org
Wed Mar 6 14:14:13 CET 2019


Commit: 92094c76a949fb9ad9f85ea09aa1f518b402a916
Author: Campbell Barton
Date:   Thu Mar 7 00:07:23 2019 +1100
Branches: master
https://developer.blender.org/rB92094c76a949fb9ad9f85ea09aa1f518b402a916

DNA: remove none particle brush & deprecated flags

The none brush doesn't make sense to have anymore with the tool system.

Also remove deprecated flags & types for object, armature & text.

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

M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/editors/physics/particle_object.c
M	source/blender/makesdna/DNA_armature_types.h
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_text_types.h
M	source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index a49081c5caa..e82efac3891 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -24,7 +24,7 @@
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         280
-#define BLENDER_SUBVERSION      46
+#define BLENDER_SUBVERSION      47
 /* Several breakages with 280, e.g. collections vs layers */
 #define BLENDER_MINVERSION      280
 #define BLENDER_MINSUBVERSION   0
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index c73c6ef6ac2..6567f98b520 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -729,7 +729,7 @@ void BKE_scene_init(Scene *sce)
 	pset->emitterdist = 0.25f;
 	pset->totrekey = 5;
 	pset->totaddkey = 5;
-	pset->brushtype = PE_BRUSH_NONE;
+	pset->brushtype = PE_BRUSH_COMB;
 	pset->draw_step = 2;
 	pset->fade_frames = 2;
 	pset->selectmode = SCE_SELECT_PATH;
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 4e64b8d0925..ab518646565 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -1545,6 +1545,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
 			if (ob->parent) {
 				Object *parent = (Object *)blo_do_versions_newlibadr(fd, lib, ob->parent);
 				if (parent) { /* parent may not be in group */
+					enum { PARCURVE = 1 };
 					if (parent->type == OB_ARMATURE && ob->partype == PARSKEL) {
 						ArmatureModifierData *amd;
 						bArmature *arm = (bArmature *)blo_do_versions_newlibadr(fd, lib, parent->data);
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index e5d3b9d473e..ab32a6d60a1 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1709,8 +1709,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
 			for (Brush *br = bmain->brush.first; br; br = br->id.next) {
 				br->falloff_angle = DEG2RADF(80);
 				br->flag &= ~(
-				        BRUSH_FLAG_DEPRECATED_1 | BRUSH_FLAG_DEPRECATED_2 |
-				        BRUSH_FLAG_DEPRECATED_3 | BRUSH_FLAG_DEPRECATED_4 |
+				        BRUSH_FLAG_DEPRECATED_1 | BRUSH_FLAG_DEPRECATED_6 |
+				        BRUSH_FLAG_DEPRECATED_7 | BRUSH_FLAG_DEPRECATED_17 |
 				        BRUSH_FRONTFACE_FALLOFF);
 			}
 
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 1179149bf90..d00554e7cd4 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -53,6 +53,7 @@
 #include "DNA_key_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_armature_types.h"
+#include "DNA_text_types.h"
 
 #include "BKE_action.h"
 #include "BKE_cloth.h"
@@ -2825,6 +2826,53 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 		}
 	}
 
+	if (!MAIN_VERSION_ATLEAST(bmain, 280, 47)) {
+		LISTBASE_FOREACH (Scene *, scene, &bmain->scene) {
+			ParticleEditSettings *pset = &scene->toolsettings->particle;
+			if (pset->brushtype < 0) {
+				pset->brushtype = PE_BRUSH_COMB;
+			}
+		}
+
+		LISTBASE_FOREACH (Object *, ob, &bmain->object) {
+			{
+				enum { PARCURVE = 1, PARKEY = 2, PAR_DEPRECATED = 16};
+				if (ELEM(ob->partype, PARCURVE, PARKEY, PAR_DEPRECATED)) {
+					ob->partype = PAROBJECT;
+				}
+			}
+
+			{
+				enum { OB_WAVE = 21, OB_LIFE = 23, OB_SECTOR = 24};
+				if (ELEM(ob->type, OB_WAVE, OB_LIFE, OB_SECTOR)) {
+					ob->type = OB_EMPTY;
+				}
+			}
+
+			ob->transflag &= ~(
+			        OB_TRANSFLAG_DEPRECATED_0 |
+			        OB_TRANSFLAG_DEPRECATED_1 |
+			        OB_TRANSFLAG_DEPRECATED_3 |
+			        OB_TRANSFLAG_DEPRECATED_6 |
+			        OB_TRANSFLAG_DEPRECATED_12);
+
+			ob->nlaflag &= ~(OB_ADS_DEPRECATED_1 | OB_ADS_DEPRECATED_2);
+		}
+
+		LISTBASE_FOREACH (bArmature *, arm, &bmain->armature) {
+			arm->flag &= ~(
+			        ARM_FLAG_DEPRECATED_1 |
+			        ARM_FLAG_DEPRECATED_5 |
+			        ARM_FLAG_DEPRECATED_7 |
+			        ARM_FLAG_DEPRECATED_12);
+		}
+
+		LISTBASE_FOREACH (Text *, text, &bmain->text) {
+			enum { TXT_READONLY = 1 << 8, TXT_FOLLOW = 1 << 9};
+			text->flags &= ~(TXT_READONLY | TXT_FOLLOW);
+		}
+	}
+
 	{
 		/* Versioning code until next subversion bump goes here. */
 	}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index 6bebb332c96..9f26ddf4ffd 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1305,6 +1305,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
 
 				/* new generic xray option */
 				arm = blo_do_versions_newlibadr(fd, lib, ob->data);
+				enum { ARM_DRAWXRAY = (1 << 1) };
 				if (arm->flag & ARM_DRAWXRAY) {
 					ob->dtx |= OB_DRAWXRAY;
 				}
@@ -2319,7 +2320,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
 				pset->emitterdist = 0.25f;
 				pset->totrekey = 5;
 				pset->totaddkey = 5;
-				pset->brushtype = PE_BRUSH_NONE;
 
 				for (a = 0; a < ARRAY_SIZE(pset->brush); a++) {
 					pset->brush[a].strength = 50;
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 3b063fd7164..e0903a9d7c5 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -622,8 +622,9 @@ static void disconnect_hair(
 
 	psys->flag |= PSYS_GLOBAL_HAIR;
 
-	if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_PUFF))
-		pset->brushtype = PE_BRUSH_NONE;
+	if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_PUFF)) {
+		pset->brushtype = PE_BRUSH_COMB;
+	}
 
 	PE_update_object(depsgraph, scene, ob, 0);
 }
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index b6016c3748d..9aec322520d 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -137,13 +137,13 @@ typedef struct bArmature {
 typedef enum eArmature_Flag {
 	ARM_RESTPOS         = (1<<0),
 	/** XRAY is here only for backwards converting */
-	ARM_DRAWXRAY        = (1<<1),
+	ARM_FLAG_DEPRECATED_1 = (1 << 1),  /* cleared */
 	ARM_DRAWAXES        = (1<<2),
 	ARM_DRAWNAMES       = (1<<3),
 	ARM_POSEMODE        = (1<<4),
-	ARM_EDITMODE        = (1<<5),
+	ARM_FLAG_DEPRECATED_5 = (1<<5),  /* cleared */
 	ARM_DELAYDEFORM     = (1<<6),
-	ARM_DONT_USE        = (1<<7),
+	ARM_FLAG_DEPRECATED_7 = (1 << 7),  /* cleared */
 	ARM_MIRROR_EDIT     = (1<<8),
 	ARM_AUTO_IK         = (1<<9),
 	/** made option negative, for backwards compat */
@@ -151,7 +151,7 @@ typedef enum eArmature_Flag {
 	/** draw custom colors  */
 	ARM_COL_CUSTOM      = (1<<11),
 	/** when ghosting, only show selected bones (this should belong to ghostflag instead) */
-	ARM_GHOST_ONLYSEL   = (1<<12), /* XXX deprecated */
+	ARM_FLAG_DEPRECATED_12 = (1 << 12), /* cleared */
 	/** dopesheet channel is expanded */
 	ARM_DS_EXPAND       = (1<<13),
 	/** other objects are used for visualizing various states (hack for efficient updates) */
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index e0d39fe72a4..b367c141581 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -356,13 +356,13 @@ typedef enum eBrushGradientSourceFill {
 /* Brush.flag */
 typedef enum eBrushFlags {
 	BRUSH_AIRBRUSH = (1 << 0),
-	BRUSH_FLAG_DEPRECATED_1 = (1 << 1),
+	BRUSH_FLAG_DEPRECATED_1 = (1 << 1),  /* cleared */
 	BRUSH_ALPHA_PRESSURE = (1 << 2),
 	BRUSH_SIZE_PRESSURE = (1 << 3),
 	BRUSH_JITTER_PRESSURE = (1 << 4),
 	BRUSH_SPACING_PRESSURE = (1 << 5),
-	BRUSH_FLAG_DEPRECATED_2 = (1 << 6),
-	BRUSH_FLAG_DEPRECATED_3 = (1 << 7),
+	BRUSH_FLAG_DEPRECATED_6 = (1 << 6),  /* cleared */
+	BRUSH_FLAG_DEPRECATED_7 = (1 << 7),  /* cleared */
 	BRUSH_ANCHORED = (1 << 8),
 	BRUSH_DIR_IN = (1 << 9),
 	BRUSH_SPACE = (1 << 10),
@@ -372,7 +372,7 @@ typedef enum eBrushFlags {
 	BRUSH_LOCK_ALPHA = (1 << 14),
 	BRUSH_ORIGINAL_NORMAL = (1 << 15),
 	BRUSH_OFFSET_PRESSURE = (1 << 16),
-	BRUSH_FLAG_DEPRECATED_4 = (1 << 17),
+	BRUSH_FLAG_DEPRECATED_17 = (1 << 17),  /* cleared */
 	BRUSH_SPACE_ATTEN = (1 << 18),
 	BRUSH_ADAPTIVE_SPACE = (1 << 19),
 	BRUSH_LOCK_SIZE = (1 << 20),
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 050110c14cb..eac8b82d6ea 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -428,12 +428,11 @@ enum {
 	OB_SPEAKER    = 12,
 	OB_LIGHTPROBE = 13,
 
-/*	OB_WAVE       = 21, */
 	OB_LATTICE    = 22,
 
-/* 23 and 24 are for life and sector (old file compat.) */
 	OB_ARMATURE   = 25,
-/* Grease Pencil object used in 3D view but not used for annotation in 2D */
+
+	/** Grease Pencil object used in 3D view but not used for annotation in 2D. */
 	OB_GPENCIL  = 26,
 
 	OB_TYPE_MAX,
@@ -464,35 +463,29 @@ enum {
 enum {
 	PARTYPE       = (1 << 4) - 1,
 	PAROBJECT     = 0,
-#ifdef DNA_DEPRECATED
-	PARCURVE      = 1,  /* Deprecated. */
-#endif
-	PARKEY        = 2,  /* XXX Unused, deprecated? */
-
 	PARSKEL       = 4,
 	PARVERT1      = 5,
 	PARVERT3      = 6,
 	PARBONE       = 7,
 
-	PAR_DEPRECATED = 16,
 };
 
 /* (short) transflag */
 enum {
-	OB_TRANSFLAG_DEPRECATED_0 = 1 << 0,
-	OB_TRANSFLAG_DEPRECATED_1 = 1 << 1,
+	OB_TRANSFLAG_DEPRECATED_0 = 1 << 0,  /* cleared */
+	OB_TRANSFLAG_DEPRECATED_1 = 1 << 1,  /* cleared */
 	OB_NEG_SCALE        = 1 << 2,
-	OB_TRANSFLAG_DEPRECATED_3 = 1 << 3,
+	OB_TRANSFLAG_DEPRECATED_3 = 1 << 3,  /* cleared */
 	OB_DUPLIVERTS       = 1 << 4,
 	OB_DUPLIROT         = 1 << 5,
-	OB_TRANSFLAG_DEPRECATED_4 = 1 << 6,
+	OB_TRANSFLAG_DEPRECATED_6 = 1 << 6,  /* cleared */
 	/* runtime, calculate derivedmesh for dupli before it's used */
 	OB_DUPLICALCDERIVED = 1 << 7,
 	OB_DUP

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list