[Bf-blender-cvs] [d4ffd1d91f8] master: Cleanup: declare values for enum types

Campbell Barton noreply at git.blender.org
Fri Apr 24 07:52:29 CEST 2020


Commit: d4ffd1d91f84e956c1f9832700b0f42cd150c2f1
Author: Campbell Barton
Date:   Fri Apr 24 15:49:25 2020 +1000
Branches: master
https://developer.blender.org/rBd4ffd1d91f84e956c1f9832700b0f42cd150c2f1

Cleanup: declare values for enum types

Avoids accidents when adding/removing items from an enum.

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

M	source/blender/makesdna/DNA_armature_types.h
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesdna/DNA_constraint_types.h
M	source/blender/makesdna/DNA_gpencil_modifier_types.h
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesdna/DNA_material_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_object_force_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/DNA_screen_types.h
M	source/blender/makesdna/DNA_sequence_types.h
M	source/blender/makesdna/DNA_shader_fx_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesdna/DNA_volume_types.h

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

diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index b29816c735b..635c155dec6 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -261,23 +261,23 @@ typedef enum eBone_InheritScaleMode {
   /* Inherit all scale and shear. */
   BONE_INHERIT_SCALE_FULL = 0,
   /* Inherit scale, but remove final shear. */
-  BONE_INHERIT_SCALE_FIX_SHEAR,
+  BONE_INHERIT_SCALE_FIX_SHEAR = 1,
   /* Inherit average scale. */
-  BONE_INHERIT_SCALE_AVERAGE,
+  BONE_INHERIT_SCALE_AVERAGE = 2,
   /* Inherit no scale or shear. */
-  BONE_INHERIT_SCALE_NONE,
+  BONE_INHERIT_SCALE_NONE = 3,
   /* Inherit effects of shear on parent (same as old disabled Inherit Scale). */
-  BONE_INHERIT_SCALE_NONE_LEGACY,
+  BONE_INHERIT_SCALE_NONE_LEGACY = 4,
   /* Inherit parent X scale as child X scale etc. */
-  BONE_INHERIT_SCALE_ALIGNED,
+  BONE_INHERIT_SCALE_ALIGNED = 5,
 } eBone_InheritScaleMode;
 
 /* bone->bbone_prev_type, bbone_next_type */
 typedef enum eBone_BBoneHandleType {
-  BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
-  BBONE_HANDLE_ABSOLUTE, /* Custom handle in absolute position mode. */
-  BBONE_HANDLE_RELATIVE, /* Custom handle in relative position mode. */
-  BBONE_HANDLE_TANGENT,  /* Custom handle in tangent mode (use direction, not location). */
+  BBONE_HANDLE_AUTO = 0,     /* Default mode based on parents & children. */
+  BBONE_HANDLE_ABSOLUTE = 1, /* Custom handle in absolute position mode. */
+  BBONE_HANDLE_RELATIVE = 2, /* Custom handle in relative position mode. */
+  BBONE_HANDLE_TANGENT = 3,  /* Custom handle in tangent mode (use direction, not location). */
 } eBone_BBoneHandleType;
 
 #define MAXBONENAME 64
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 041943bc5e4..0e16abf76f7 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -805,8 +805,8 @@ typedef enum {
 
 /* blur kernel types, Brush.blur_mode */
 typedef enum eBlurKernelType {
-  KERNEL_GAUSSIAN,
-  KERNEL_BOX,
+  KERNEL_GAUSSIAN = 0,
+  KERNEL_BOX = 1,
 } eBlurKernelType;
 
 /* Brush.falloff_shape */
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 9efd2116601..65087a6d459 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -735,11 +735,11 @@ typedef enum eConstraint_EulerOrder {
 
   /** Explicit euler rotation modes - must sync with BLI_math_rotation.h defines. */
   CONSTRAINT_EULER_XYZ = 1,
-  CONSTRAINT_EULER_XZY,
-  CONSTRAINT_EULER_YXZ,
-  CONSTRAINT_EULER_YZX,
-  CONSTRAINT_EULER_ZXY,
-  CONSTRAINT_EULER_ZYX,
+  CONSTRAINT_EULER_XZY = 2,
+  CONSTRAINT_EULER_YXZ = 3,
+  CONSTRAINT_EULER_YZX = 4,
+  CONSTRAINT_EULER_ZXY = 5,
+  CONSTRAINT_EULER_ZYX = 6,
 } eConstraint_EulerOrder;
 
 /* -------------------------------------- */
@@ -762,13 +762,13 @@ typedef enum eCopyRotation_MixMode {
   /* Replace rotation channel values. */
   ROTLIKE_MIX_REPLACE = 0,
   /* Legacy Offset mode - don't use. */
-  ROTLIKE_MIX_OFFSET,
+  ROTLIKE_MIX_OFFSET = 1,
   /* Add Euler components together. */
-  ROTLIKE_MIX_ADD,
+  ROTLIKE_MIX_ADD = 2,
   /* Multiply the copied rotation on the left. */
-  ROTLIKE_MIX_BEFORE,
+  ROTLIKE_MIX_BEFORE = 3,
   /* Multiply the copied rotation on the right. */
-  ROTLIKE_MIX_AFTER,
+  ROTLIKE_MIX_AFTER = 4,
 } eCopyRotation_MixMode;
 
 /* bLocateLikeConstraint.flag */
@@ -799,9 +799,9 @@ typedef enum eCopyTransforms_MixMode {
   /* Replace rotation channel values. */
   TRANSLIKE_MIX_REPLACE = 0,
   /* Multiply the copied transformation on the left, with anti-shear scale handling. */
-  TRANSLIKE_MIX_BEFORE,
+  TRANSLIKE_MIX_BEFORE = 1,
   /* Multiply the copied transformation on the right, with anti-shear scale handling. */
-  TRANSLIKE_MIX_AFTER,
+  TRANSLIKE_MIX_AFTER = 2,
 } eCopyTransforms_MixMode;
 
 /* bTransformConstraint.to/from */
@@ -816,7 +816,7 @@ typedef enum eTransform_MixModeLoc {
   /* Add component values together (default). */
   TRANS_MIXLOC_ADD = 0,
   /* Replace component values. */
-  TRANS_MIXLOC_REPLACE,
+  TRANS_MIXLOC_REPLACE = 1,
 } eTransform_MixModeLoc;
 
 /* bTransformConstraint.mix_mode_rot */
@@ -824,11 +824,11 @@ typedef enum eTransform_MixModeRot {
   /* Add component values together (default). */
   TRANS_MIXROT_ADD = 0,
   /* Replace component values. */
-  TRANS_MIXROT_REPLACE,
+  TRANS_MIXROT_REPLACE = 1,
   /* Multiply the generated rotation on the left. */
-  TRANS_MIXROT_BEFORE,
+  TRANS_MIXROT_BEFORE = 2,
   /* Multiply the generated rotation on the right. */
-  TRANS_MIXROT_AFTER,
+  TRANS_MIXROT_AFTER = 3,
 } eTransform_MixModeRot;
 
 /* bTransformConstraint.mix_mode_scale */
@@ -836,7 +836,7 @@ typedef enum eTransform_MixModeScale {
   /* Replace component values (default). */
   TRANS_MIXSCALE_REPLACE = 0,
   /* Multiply component values together. */
-  TRANS_MIXSCALE_MULTIPLY,
+  TRANS_MIXSCALE_MULTIPLY = 1,
 } eTransform_MixModeScale;
 
 /* bSameVolumeConstraint.free_axis */
@@ -867,9 +867,9 @@ typedef enum eActionConstraint_MixMode {
   /* Multiply the action transformation on the right. */
   ACTCON_MIX_AFTER_FULL = 0,
   /* Multiply the action transformation on the right, with anti-shear scale handling. */
-  ACTCON_MIX_AFTER,
+  ACTCON_MIX_AFTER = 1,
   /* Multiply the action transformation on the left, with anti-shear scale handling. */
-  ACTCON_MIX_BEFORE,
+  ACTCON_MIX_BEFORE = 2,
 } eActionConstraint_MixMode;
 
 /* Locked-Axis Values (Locked Track) */
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 1265ce0983c..deb955f5551 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -48,6 +48,7 @@ typedef enum GpencilModifierType {
   eGpencilModifierType_Time = 16,
   eGpencilModifierType_Multiply = 17,
   eGpencilModifierType_Texture = 18,
+  /* Keep last. */
   NUM_GREASEPENCIL_MODIFIER_TYPES,
 } GpencilModifierType;
 
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index d3d7ca1cc3b..bf9f228b53f 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -276,6 +276,7 @@ typedef enum eGPDstroke_Caps {
   GP_STROKE_CAP_ROUND = 0,
   GP_STROKE_CAP_FLAT = 1,
 
+  /* Keeo last. */
   GP_STROKE_CAP_MAX,
 } GPDstroke_Caps;
 
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 10a549edc17..357c3260121 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -324,35 +324,35 @@ enum {
 /* blend_shadow */
 enum {
   MA_BS_NONE = 0,
-  MA_BS_SOLID,
-  MA_BS_CLIP,
-  MA_BS_HASHED,
+  MA_BS_SOLID = 1,
+  MA_BS_CLIP = 2,
+  MA_BS_HASHED = 3,
 };
 
 /* Grease Pencil Stroke styles */
 enum {
   GP_MATERIAL_STROKE_STYLE_SOLID = 0,
-  GP_MATERIAL_STROKE_STYLE_TEXTURE,
+  GP_MATERIAL_STROKE_STYLE_TEXTURE = 1,
 };
 
 /* Grease Pencil Fill styles */
 enum {
   GP_MATERIAL_FILL_STYLE_SOLID = 0,
-  GP_MATERIAL_FILL_STYLE_GRADIENT,
-  GP_MATERIAL_FILL_STYLE_CHECKER, /* DEPRECATED (only for convert old files) */
-  GP_MATERIAL_FILL_STYLE_TEXTURE,
+  GP_MATERIAL_FILL_STYLE_GRADIENT = 1,
+  GP_MATERIAL_FILL_STYLE_CHECKER = 2, /* DEPRECATED (only for convert old files) */
+  GP_MATERIAL_FILL_STYLE_TEXTURE = 3,
 };
 
 /* Grease Pencil Gradient Types */
 enum {
   GP_MATERIAL_GRADIENT_LINEAR = 0,
-  GP_MATERIAL_GRADIENT_RADIAL,
+  GP_MATERIAL_GRADIENT_RADIAL = 1,
 };
 
 /* Grease Pencil Follow Drawing Modes */
 enum {
   GP_MATERIAL_FOLLOW_PATH = 0,
-  GP_MATERIAL_FOLLOW_OBJ,
-  GP_MATERIAL_FOLLOW_FIXED,
+  GP_MATERIAL_FOLLOW_OBJ = 1,
+  GP_MATERIAL_FOLLOW_FIXED = 2,
 };
 #endif
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 9e58d7df042..8e7dc1fa266 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -452,23 +452,23 @@ enum {
 
 /* BevelModifierData->face_str_mode */
 enum {
-  MOD_BEVEL_FACE_STRENGTH_NONE,
-  MOD_BEVEL_FACE_STRENGTH_NEW,
-  MOD_BEVEL_FACE_STRENGTH_AFFECTED,
-  MOD_BEVEL_FACE_STRENGTH_ALL,
+  MOD_BEVEL_FACE_STRENGTH_NONE = 0,
+  MOD_BEVEL_FACE_STRENGTH_NEW = 1,
+  MOD_BEVEL_FACE_STRENGTH_AFFECTED = 2,
+  MOD_BEVEL_FACE_STRENGTH_ALL = 3,
 };
 
 /* BevelModifier->miter_inner and ->miter_outer */
 enum {
-  MOD_BEVEL_MITER_SHARP,
-  MOD_BEVEL_MITER_PATCH,
-  MOD_BEVEL_MITER_ARC,
+  MOD_BEVEL_MITER_SHARP = 0,
+  MOD_BEVEL_MITER_PATCH = 1,
+  MOD_BEVEL_MITER_ARC = 2,
 };
 
 /* BevelModifier->vmesh_method */
 enum {
-  MOD_BEVEL_VMESH_ADJ,
-  MOD_BEVEL_VMESH_CUTOFF,
+  MOD_BEVEL_VMESH_ADJ = 0,
+  MOD_BEVEL_VMESH_CUTOFF = 1,
 };
 
 typedef struct FluidModifierData {
@@ -594,10 +594,10 @@ enum {
 };
 
 enum {
-  MOD_DECIM_MODE_COLLAPSE,
-  MOD_DECIM_MODE_UNSUBDIV,
+  MOD_DECIM_MODE_COLLAPSE = 0,
+  MOD_DECIM_MODE_UNSUBDIV = 1,
   /** called planar in the UI */
-  MOD_DECIM_MODE_DISSOLVE,
+  MOD_DECIM_MODE_DISSOLVE = 2,
 };
 
 typedef struct SmoothModifierData {
@@ -1694,15 +1694,15 @@ enum {
 /* Triangulate methods - NGons */
 enum {
   MOD_TRIANGULATE_NGON_BEAUTY = 0,
-  MOD_TRIANGULATE_NGON_EARCLIP,
+  MOD_TRIANGULATE_NGON_EARCLIP = 1,
 };
 
 /* Triangulate methods - Quads */
 enum {
   MOD_TRIANGULATE_QUAD_BEAUTY = 0,
-  MOD_TRIANGULATE_QUAD_FIXED,
-  MOD_TRIANGULATE_QUAD_ALTERNATE,
-  MOD_TRIANGULATE_QUAD_SHORTEDGE,
+  MOD_TRIANGULATE_QUAD_FIXED = 1,
+  MOD_TRIANGULATE_QUAD_ALTERNATE = 2,
+  MOD_TRIANGULATE_QUAD_SHORTEDGE = 3,
 };
 
 typedef struct LaplacianSmoothModifierData {
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index 88c712b5b28..daa3a629d27 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -62,6 +62,7 @@ typedef enum ePFieldType {
   /** Force based on smoke simulation air flow. */
   PFIELD_SMOKEFLOW = 13,
 
+  /* Keep last

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list