diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 33d1445fb93..64543709252 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -44,54 +44,65 @@ struct FileData; struct ID; struct PackedFile; struct GPUTexture; - + typedef struct IDPropertyData { void *pointer; ListBase group; - int val, val2; /*note, we actually fit a double into these two ints*/ + int val, val2; /* note, we actually fit a double into these two ints */ } IDPropertyData; typedef struct IDProperty { struct IDProperty *next, *prev; char type, subtype; short flag; - char name[64]; /* MAX_IDPROP_NAME */ - int saved; /* saved is used to indicate if this struct has been saved yet. - * seemed like a good idea as a pad var was needed anyway :)*/ - IDPropertyData data; /* note, alignment for 64 bits */ - int len; /* array length, also (this is important!) string length + 1. - * the idea is to be able to reuse array realloc functions on strings.*/ + char name[64]; /* MAX_IDPROP_NAME */ + + /* saved is used to indicate if this struct has been saved yet. + * seemed like a good idea as a pad var was needed anyway :) */ + int saved; + IDPropertyData data; /* note, alignment for 64 bits */ + + /* array length, also (this is important!) string length + 1. + * the idea is to be able to reuse array realloc functions on strings.*/ + int len; + + /* Strings and arrays are both buffered, though the buffer isn't saved. */ /* totallen is total length of allocated array/string, including a buffer. - * Note that the buffering is mild; the code comes from python's list implementation.*/ - int totallen; /*strings and arrays are both buffered, though the buffer isn't saved.*/ + * Note that the buffering is mild; the code comes from python's list implementation. */ + int totallen; } IDProperty; -#define MAX_IDPROP_NAME 64 -#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64 +#define MAX_IDPROP_NAME 64 +#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64 /*->type*/ -#define IDP_STRING 0 -#define IDP_INT 1 -#define IDP_FLOAT 2 -#define IDP_ARRAY 5 -#define IDP_GROUP 6 -/* the ID link property type hasn't been implemented yet, this will require - * some cleanup of blenkernel, most likely.*/ -#define IDP_ID 7 -#define IDP_DOUBLE 8 -#define IDP_IDPARRAY 9 -#define IDP_NUMTYPES 10 +enum { + IDP_STRING = 0, + IDP_INT = 1, + IDP_FLOAT = 2, + IDP_ARRAY = 5, + IDP_GROUP = 6, + /* the ID link property type hasn't been implemented yet, this will require + * some cleanup of blenkernel, most likely. */ + IDP_ID = 7, + IDP_DOUBLE = 8, + IDP_IDPARRAY = 9, + IDP_NUMTYPES = 10, +}; /*->subtype */ /* IDP_STRING */ -#define IDP_STRING_SUB_UTF8 0 /* default */ -#define IDP_STRING_SUB_BYTE 1 /* arbitrary byte array, _not_ null terminated */ -/*->flag*/ -#define IDP_FLAG_GHOST (1<<7) /* this means the property is set but RNA will return - * false when checking 'RNA_property_is_set', - * currently this is a runtime flag */ +enum { + IDP_STRING_SUB_UTF8 = 0, /* default */ + IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */ +}; +/*->flag*/ +enum { + IDP_FLAG_GHOST = 1 << 7, /* this means the property is set but RNA will return false when checking + * 'RNA_property_is_set', currently this is a runtime flag */ +}; /* add any future new id property types here.*/ @@ -102,7 +113,7 @@ typedef struct IDProperty { * */ /* 2 characters for ID code and 64 for actual name */ -#define MAX_ID_NAME 66 +#define MAX_ID_NAME 66 /* There's a nasty circular dependency here.... 'void *' to the rescue! I * really wonder why this is needed. */ @@ -129,14 +140,14 @@ typedef struct Library { ID id; ID *idblock; struct FileData *filedata; - char name[1024]; /* path name used for reading, can be relative and edited in the outliner */ - char filepath[1024]; /* absolute filepath, this is only for convenience, - * 'name' is the real path used on file read but in - * some cases its useful to access the absolute one, - * This is set on file read. - * Use BKE_library_filepath_set() rather than - * setting 'name' directly and it will be kept in - * sync - campbell */ + char name[1024]; /* path name used for reading, can be relative and edited in the outliner */ + + /* absolute filepath, this is only for convenience, 'name' is the real path used on file read but in + * some cases its useful to access the absolute one. + * This is set on file read. + * Use BKE_library_filepath_set() rather than setting 'name' directly and it will be kept in sync - campbell */ + char filepath[1024]; + struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */ struct PackedFile *packedfile; @@ -239,26 +250,28 @@ typedef struct PreviewImage { #define ID_NEW_US(a) if ( (a)->id.newid) { (a) = (void *)(a)->id.newid; (a)->id.us++; } #define ID_NEW_US2(a) if (((ID *)a)->newid) { (a) = ((ID *)a)->newid; ((ID *)a)->us++; } -/* id->flag: set frist 8 bits always at zero while reading */ -#define LIB_LOCAL 0 -#define LIB_EXTERN 1 -#define LIB_INDIRECT 2 -#define LIB_NEED_EXPAND 8 -#define LIB_TESTEXT (LIB_NEED_EXPAND | LIB_EXTERN) -#define LIB_TESTIND (LIB_NEED_EXPAND | LIB_INDIRECT) -#define LIB_READ 16 -#define LIB_NEED_LINK 32 +/* id->flag: set first 8 bits always at zero while reading */ +enum { + LIB_LOCAL = 0, + LIB_EXTERN = 1 << 0, + LIB_INDIRECT = 1 << 1, + LIB_NEED_EXPAND = 1 << 3, + LIB_TESTEXT = (LIB_NEED_EXPAND | LIB_EXTERN), + LIB_TESTIND = (LIB_NEED_EXPAND | LIB_INDIRECT), + LIB_READ = 1 << 4, + LIB_NEED_LINK = 1 << 5, -#define LIB_NEW 256 -#define LIB_FAKEUSER 512 -/* free test flag */ -#define LIB_DOIT 1024 -/* tag existing data before linking so we know what is new */ -#define LIB_PRE_EXISTING 2048 -/* runtime */ -#define LIB_ID_RECALC 4096 -#define LIB_ID_RECALC_DATA 8192 -#define LIB_ANIM_NO_RECALC 16384 + LIB_NEW = 1 << 8, + LIB_FAKEUSER = 1 << 9, + /* free test flag */ + LIB_DOIT = 1 << 10, + /* tag existing data before linking so we know what is new */ + LIB_PRE_EXISTING = 1 << 11, + /* runtime */ + LIB_ID_RECALC = 1 << 12, + LIB_ID_RECALC_DATA = 1 << 13, + LIB_ANIM_NO_RECALC = 1 << 14, +}; #ifdef __cplusplus } diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 87496fb491f..288743d5e2f 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -270,86 +270,101 @@ typedef struct Curve { /* **************** CURVE ********************* */ -/* texflag */ -#define CU_AUTOSPACE 1 - -/* drawflag */ -#define CU_HIDE_HANDLES (1 << 0) -#define CU_HIDE_NORMALS (1 << 1) - -/* flag */ -#define CU_3D 1 -#define CU_FRONT 2 -#define CU_BACK 4 -#define CU_PATH 8 -#define CU_FOLLOW 16 -#define CU_UV_ORCO 32 -#define CU_DEFORM_BOUNDS_OFF 64 -#define CU_STRETCH 128 -/* #define CU_OFFS_PATHDIST 256 */ /* DEPRECATED */ -#define CU_FAST 512 /* Font: no filling inside editmode */ -/* #define CU_RETOPO 1024 */ /* DEPRECATED */ -#define CU_DS_EXPAND 2048 -#define CU_PATH_RADIUS 4096 /* make use of the path radius if this is enabled (default for new curves) */ -#define CU_DEFORM_FILL 8192 /* fill 2d curve after deformation */ -#define CU_FILL_CAPS 16384 /* fill bevel caps */ -#define CU_MAP_TAPER 32768 /* map taper object to beveled area */ - -/* twist mode */ -#define CU_TWIST_Z_UP 0 -// #define CU_TWIST_Y_UP 1 // not used yet -// #define CU_TWIST_X_UP 2 -#define CU_TWIST_MINIMUM 3 -#define CU_TWIST_TANGENT 4 - -/* bevel factor mapping */ +/* Curve.texflag */ enum { - CU_BEVFAC_MAP_RESOLU = 0, - CU_BEVFAC_MAP_SEGMENT = 1, - CU_BEVFAC_MAP_SPLINE = 2 + CU_AUTOSPACE = 1, }; -/* spacemode */ -#define CU_LEFT 0 -#define CU_MIDDLE 1 -#define CU_RIGHT 2 -#define CU_JUSTIFY 3 -#define CU_FLUSH 4 +/* Curve.drawflag */ +enum { + CU_HIDE_HANDLES = 1 << 0, + CU_HIDE_NORMALS = 1 << 1, +}; -/* flag (nurb) */ -#define CU_SMOOTH 1 -#define CU_2D 8 /* moved from type since 2.4x */ +/* Curve.flag */ +enum { + CU_3D = 1 << 0, + CU_FRONT = 1 << 1, + CU_BACK = 1 << 2, + CU_PATH = 1 << 3, + CU_FOLLOW = 1 << 4, + CU_UV_ORCO = 1 << 5, + CU_DEFORM_BOUNDS_OFF = 1 << 6, + CU_STRETCH = 1 << 7, + /* CU_OFFS_PATHDIST = 1 << 8, */ /* DEPRECATED */ + CU_FAST = 1 << 9, /* Font: no filling inside editmode */ + /* CU_RETOPO = 1 << 10, */ /* DEPRECATED */ + CU_DS_EXPAND = 1 << 11, + CU_PATH_RADIUS = 1 << 12, /* make use of the path radius if this is enabled (default for new curves) */ + CU_DEFORM_FILL = 1 << 13, /* fill 2d curve after deformation */ + CU_FILL_CAPS = 1 << 14, /* fill bevel caps */ + CU_MAP_TAPER = 1 << 15, /* map taper object to beveled area */ +}; -/* type (nurb) */ -#define CU_POLY 0 -#define CU_BEZIER 1 -#define CU_BSPLINE 2 -#define CU_CARDINAL 3 -#define CU_NURBS 4 -#define CU_TYPE (CU_POLY|CU_BEZIER|CU_BSPLINE|CU_CARDINAL|CU_NURBS) +/* Curve.twist_mode */ +enum { + CU_TWIST_Z_UP = 0, + /* CU_TWIST_Y_UP = 1, */ /* not used yet */ + /* CU_TWIST_X_UP = 2, */ + CU_TWIST_MINIMUM = 3, + CU_TWIST_TANGENT = 4, +}; - /* only for adding */ -#define CU_PRIMITIVE 0xF00 +/* Curve.bevfac1_mapping, Curve.bevfac2_mapping, bevel factor mapping */ +enum { + CU_BEVFAC_MAP_RESOLU = 0, + CU_BEVFAC_MAP_SEGMENT = 1, + CU_BEVFAC_MAP_SPLINE = 2, +}; - /* 2 or 4 points */ -#define CU_PRIM_CURVE 0x100 - /* 8 points circle */ -#define CU_PRIM_CIRCLE 0x200 - /* 4x4 patch Nurb */ -#define CU_PRIM_PATCH 0x300 -#define CU_PRIM_TUBE 0x400 -#define CU_PRIM_SPHERE 0x500 -#define CU_PRIM_DONUT 0x600 - /* 5 points, 5th order straight line (for anim path) */ -#define CU_PRIM_PATH 0x700 +/* Curve.spacemode */ +enum { + CU_LEFT = 0, + CU_MIDDLE = 1, + CU_RIGHT = 2, + CU_JUSTIFY = 3, + CU_FLUSH = 4, +}; +/* Nurb.flag */ +enum { + CU_SMOOTH = 1 << 0, + CU_2D = 1 << 3, /* moved from type since 2.4x */ +}; -/* flagu flagv (nurb) */ -#define CU_NURB_CYCLIC 1 -#define CU_NURB_ENDPOINT 2 -#define CU_NURB_BEZIER 4 +/* Nurb.type */ +enum { + CU_POLY = 0, + CU_BEZIER = 1, + CU_BSPLINE = 2, + CU_CARDINAL = 3, + CU_NURBS = 4, + CU_TYPE = (CU_POLY | CU_BEZIER | CU_BSPLINE | CU_CARDINAL | CU_NURBS), -#define CU_ACT_NONE -1 + /* only for adding */ + CU_PRIMITIVE = 0xF00, + + /* 2 or 4 points */ + CU_PRIM_CURVE = 0x100, + /* 8 points circle */ + CU_PRIM_CIRCLE = 0x200, + /* 4x4 patch Nurb */ + CU_PRIM_PATCH = 0x300, + CU_PRIM_TUBE = 0x400, + CU_PRIM_SPHERE = 0x500, + CU_PRIM_DONUT = 0x600, + /* 5 points, 5th order straight line (for anim path) */ + CU_PRIM_PATH = 0x700, +}; + +/* Nurb.flagu, Nurb.flagv */ +enum { + CU_NURB_CYCLIC = 1 << 0, + CU_NURB_ENDPOINT = 1 << 1, + CU_NURB_BEZIER = 1 << 2, +}; + +#define CU_ACT_NONE -1 /* *************** BEZTRIPLE **************** */ @@ -366,9 +381,9 @@ typedef enum eBezTriple_Handle { /* interpolation modes (used only for BezTriple->ipo) */ typedef enum eBezTriple_Interpolation { /* traditional interpolation */ - BEZT_IPO_CONST = 0, /* constant interpolation */ - BEZT_IPO_LIN = 1, /* linear interpolation */ - BEZT_IPO_BEZ = 2, /* bezier interpolation */ + BEZT_IPO_CONST = 0, /* constant interpolation */ + BEZT_IPO_LIN = 1, /* linear interpolation */ + BEZT_IPO_BEZ = 2, /* bezier interpolation */ /* easing equations */ BEZT_IPO_BACK = 3, @@ -380,7 +395,7 @@ typedef enum eBezTriple_Interpolation { BEZT_IPO_QUAD = 9, BEZT_IPO_QUART = 10, BEZT_IPO_QUINT = 11, - BEZT_IPO_SINE = 12 + BEZT_IPO_SINE = 12, } eBezTriple_Interpolation; /* easing modes (used only for Keyframes - BezTriple->easing) */ @@ -389,15 +404,15 @@ typedef enum eBezTriple_Easing { BEZT_IPO_EASE_IN = 1, BEZT_IPO_EASE_OUT = 2, - BEZT_IPO_EASE_IN_OUT = 3 + BEZT_IPO_EASE_IN_OUT = 3, } eBezTriple_Easing; /* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */ typedef enum eBezTriple_KeyframeType { - BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */ - BEZT_KEYTYPE_EXTREME = 1, /* 'extreme' keyframe */ - BEZT_KEYTYPE_BREAKDOWN = 2, /* 'breakdown' keyframe */ - BEZT_KEYTYPE_JITTER = 3, /* 'jitter' keyframe (for adding 'filler' secondary motion) */ + BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */ + BEZT_KEYTYPE_EXTREME = 1, /* 'extreme' keyframe */ + BEZT_KEYTYPE_BREAKDOWN = 2, /* 'breakdown' keyframe */ + BEZT_KEYTYPE_JITTER = 3, /* 'jitter' keyframe (for adding 'filler' secondary motion) */ } eBezTriple_KeyframeType; /* checks if the given BezTriple is selected */ @@ -406,14 +421,16 @@ typedef enum eBezTriple_KeyframeType { /* *************** CHARINFO **************** */ -/* flag */ -/* note: CU_CHINFO_WRAP and CU_CHINFO_SMALLCAPS_TEST are set dynamically */ -#define CU_CHINFO_BOLD (1<<0) -#define CU_CHINFO_ITALIC (1<<1) -#define CU_CHINFO_UNDERLINE (1<<2) -#define CU_CHINFO_WRAP (1<<3) /* wordwrap occurred here */ -#define CU_CHINFO_SMALLCAPS (1<<4) -#define CU_CHINFO_SMALLCAPS_CHECK (1<<5) /* set at runtime, checks if case switching is needed */ +/* CharInfo.flag */ +enum { + /* note: CU_CHINFO_WRAP and CU_CHINFO_SMALLCAPS_TEST are set dynamically */ + CU_CHINFO_BOLD = 1 << 0, + CU_CHINFO_ITALIC = 1 << 1, + CU_CHINFO_UNDERLINE = 1 << 2, + CU_CHINFO_WRAP = 1 << 3, /* wordwrap occurred here */ + CU_CHINFO_SMALLCAPS = 1 << 4, + CU_CHINFO_SMALLCAPS_CHECK = 1 << 5, /* set at runtime, checks if case switching is needed */ +}; /* mixed with KEY_LINEAR but define here since only curve supports */ #define KEY_CU_EASE 3 diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h index d2b95c959b3..dece93af122 100644 --- a/source/blender/makesdna/DNA_dynamicpaint_types.h +++ b/source/blender/makesdna/DNA_dynamicpaint_types.h @@ -33,55 +33,71 @@ struct CurveMapping; struct PaintSurfaceData; /* surface format */ -#define MOD_DPAINT_SURFACE_F_PTEX 0 -#define MOD_DPAINT_SURFACE_F_VERTEX 1 -#define MOD_DPAINT_SURFACE_F_IMAGESEQ 2 +enum { + MOD_DPAINT_SURFACE_F_PTEX = 0, + MOD_DPAINT_SURFACE_F_VERTEX = 1, + MOD_DPAINT_SURFACE_F_IMAGESEQ = 2, +}; /* surface type */ -#define MOD_DPAINT_SURFACE_T_PAINT 0 -#define MOD_DPAINT_SURFACE_T_DISPLACE 1 -#define MOD_DPAINT_SURFACE_T_WEIGHT 2 -#define MOD_DPAINT_SURFACE_T_WAVE 3 +enum { + MOD_DPAINT_SURFACE_T_PAINT = 0, + MOD_DPAINT_SURFACE_T_DISPLACE = 1, + MOD_DPAINT_SURFACE_T_WEIGHT = 2, + MOD_DPAINT_SURFACE_T_WAVE = 3, +}; /* surface flags */ -#define MOD_DPAINT_ACTIVE (1<<0) /* Is surface enabled */ +enum { + MOD_DPAINT_ACTIVE = 1 << 0, /* Is surface enabled */ -#define MOD_DPAINT_ANTIALIAS (1<<1) /* do antialiasing */ -#define MOD_DPAINT_DISSOLVE (1<<2) /* do dissolve */ -#define MOD_DPAINT_MULALPHA (1<<3) /* Multiply color by alpha when saving image */ -#define MOD_DPAINT_DISSOLVE_LOG (1<<4) /* Use 1/x for surface dissolve */ -#define MOD_DPAINT_DRY_LOG (1<<5) /* Use 1/x for drying paint */ -#define MOD_DPAINT_PREVIEW (1<<6) /* preview this surface on viewport*/ + MOD_DPAINT_ANTIALIAS = 1 << 1, /* do antialiasing */ + MOD_DPAINT_DISSOLVE = 1 << 2, /* do dissolve */ + MOD_DPAINT_MULALPHA = 1 << 3, /* Multiply color by alpha when saving image */ + MOD_DPAINT_DISSOLVE_LOG = 1 << 4, /* Use 1/x for surface dissolve */ + MOD_DPAINT_DRY_LOG = 1 << 5, /* Use 1/x for drying paint */ + MOD_DPAINT_PREVIEW = 1 << 6, /* preview this surface on viewport*/ -#define MOD_DPAINT_WAVE_OPEN_BORDERS (1<<7) /* passes waves through mesh edges */ -#define MOD_DPAINT_DISP_INCREMENTAL (1<<8) /* builds displace on top of earlier values */ -#define MOD_DPAINT_USE_DRYING (1<<9) /* use drying */ + MOD_DPAINT_WAVE_OPEN_BORDERS = 1 << 7, /* passes waves through mesh edges */ + MOD_DPAINT_DISP_INCREMENTAL = 1 << 8, /* builds displace on top of earlier values */ + MOD_DPAINT_USE_DRYING = 1 << 9, /* use drying */ -#define MOD_DPAINT_OUT1 (1<<10) /* output primary surface */ -#define MOD_DPAINT_OUT2 (1<<11) /* output secondary surface */ + MOD_DPAINT_OUT1 = 1 << 10, /* output primary surface */ + MOD_DPAINT_OUT2 = 1 << 11, /* output secondary surface */ +}; /* image_fileformat */ -#define MOD_DPAINT_IMGFORMAT_PNG 0 -#define MOD_DPAINT_IMGFORMAT_OPENEXR 1 +enum { + MOD_DPAINT_IMGFORMAT_PNG = 0, + MOD_DPAINT_IMGFORMAT_OPENEXR = 1, +}; /* disp_format */ -#define MOD_DPAINT_DISP_DISPLACE 0 /* displacement output displace map */ -#define MOD_DPAINT_DISP_DEPTH 1 /* displacement output depth data */ +enum { + MOD_DPAINT_DISP_DISPLACE = 0, /* displacement output displace map */ + MOD_DPAINT_DISP_DEPTH = 1, /* displacement output depth data */ +}; /* effect */ -#define MOD_DPAINT_EFFECT_DO_SPREAD (1<<0) /* do spread effect */ -#define MOD_DPAINT_EFFECT_DO_DRIP (1<<1) /* do drip effect */ -#define MOD_DPAINT_EFFECT_DO_SHRINK (1<<2) /* do shrink effect */ +enum { + MOD_DPAINT_EFFECT_DO_SPREAD = 1 << 0, /* do spread effect */ + MOD_DPAINT_EFFECT_DO_DRIP = 1 << 1, /* do drip effect */ + MOD_DPAINT_EFFECT_DO_SHRINK = 1 << 2, /* do shrink effect */ +}; /* preview_id */ -#define MOD_DPAINT_SURFACE_PREV_PAINT 0 -#define MOD_DPAINT_SURFACE_PREV_WETMAP 1 +enum { + MOD_DPAINT_SURFACE_PREV_PAINT = 0, + MOD_DPAINT_SURFACE_PREV_WETMAP = 1, +}; /* init_color_type */ -#define MOD_DPAINT_INITIAL_NONE 0 -#define MOD_DPAINT_INITIAL_COLOR 1 -#define MOD_DPAINT_INITIAL_TEXTURE 2 -#define MOD_DPAINT_INITIAL_VERTEXCOLOR 3 +enum { + MOD_DPAINT_INITIAL_NONE = 0, + MOD_DPAINT_INITIAL_COLOR = 1, + MOD_DPAINT_INITIAL_TEXTURE = 2, + MOD_DPAINT_INITIAL_VERTEXCOLOR = 3, +}; typedef struct DynamicPaintSurface { @@ -136,11 +152,14 @@ typedef struct DynamicPaintSurface { } DynamicPaintSurface; /* canvas flags */ -#if 0 /* This should not be needed, having a valid WEIGHT_MCOL layer should be enough. - * And if not, should be a general flag. But seems unnecessary for now... */ -#define MOD_DPAINT_PREVIEW_READY (1<<0) /* if viewport preview is ready */ +enum { + /* This should not be needed, having a valid WEIGHT_MCOL layer should be enough. + * And if not, should be a general flag. But seems unnecessary for now... */ +#if 0 + MOD_DPAINT_PREVIEW_READY = 1 << 0, /* if viewport preview is ready */ #endif -#define MOD_DPAINT_BAKING (1<<1) /* surface is already baking, so it wont get updated (loop) */ + MOD_DPAINT_BAKING = 1 << 1, /* surface is already baking, so it wont get updated (loop) */ +}; /* Canvas settings */ typedef struct DynamicPaintCanvasSettings { @@ -157,47 +176,56 @@ typedef struct DynamicPaintCanvasSettings { /* flags */ -#define MOD_DPAINT_PART_RAD (1<<0) /* use particle radius */ -#define MOD_DPAINT_USE_MATERIAL (1<<1) /* use object material */ -#define MOD_DPAINT_ABS_ALPHA (1<<2) /* don't increase alpha unless - * paint alpha is higher than existing */ -#define MOD_DPAINT_ERASE (1<<3) /* removes paint */ +enum { + MOD_DPAINT_PART_RAD = 1 << 0, /* use particle radius */ + MOD_DPAINT_USE_MATERIAL = 1 << 1, /* use object material */ + MOD_DPAINT_ABS_ALPHA = 1 << 2, /* don't increase alpha unless paint alpha is higher than existing */ + MOD_DPAINT_ERASE = 1 << 3, /* removes paint */ -#define MOD_DPAINT_RAMP_ALPHA (1<<4) /* only read falloff ramp alpha */ -#define MOD_DPAINT_PROX_PROJECT (1<<5) /* do proximity check only in defined dir */ -#define MOD_DPAINT_INVERSE_PROX (1<<6) /* inverse proximity painting */ -#define MOD_DPAINT_NEGATE_VOLUME (1<<7) /* negates volume influence on "volume + prox" mode */ + MOD_DPAINT_RAMP_ALPHA = 1 << 4, /* only read falloff ramp alpha */ + MOD_DPAINT_PROX_PROJECT = 1 << 5, /* do proximity check only in defined dir */ + MOD_DPAINT_INVERSE_PROX = 1 << 6, /* inverse proximity painting */ + MOD_DPAINT_NEGATE_VOLUME = 1 << 7, /* negates volume influence on "volume + prox" mode */ -#define MOD_DPAINT_DO_SMUDGE (1<<8) /* brush smudges existing paint */ -#define MOD_DPAINT_VELOCITY_ALPHA (1<<9) /* multiply brush influence by velocity */ -#define MOD_DPAINT_VELOCITY_COLOR (1<<10) /* replace brush color by velocity color ramp */ -#define MOD_DPAINT_VELOCITY_DEPTH (1<<11) /* multiply brush intersection depth by velocity */ + MOD_DPAINT_DO_SMUDGE = 1 << 8, /* brush smudges existing paint */ + MOD_DPAINT_VELOCITY_ALPHA = 1 << 9, /* multiply brush influence by velocity */ + MOD_DPAINT_VELOCITY_COLOR = 1 << 10, /* replace brush color by velocity color ramp */ + MOD_DPAINT_VELOCITY_DEPTH = 1 << 11, /* multiply brush intersection depth by velocity */ -#define MOD_DPAINT_USES_VELOCITY ((1<<8)|(1<<9)|(1<<10)|(1<<11)) + MOD_DPAINT_USES_VELOCITY = (MOD_DPAINT_DO_SMUDGE | MOD_DPAINT_VELOCITY_ALPHA | + MOD_DPAINT_VELOCITY_COLOR | MOD_DPAINT_VELOCITY_DEPTH), +}; /* collision type */ -#define MOD_DPAINT_COL_VOLUME 0 /* paint with mesh volume */ -#define MOD_DPAINT_COL_DIST 1 /* paint using distance to mesh surface */ -#define MOD_DPAINT_COL_VOLDIST 2 /* use both volume and distance */ -#define MOD_DPAINT_COL_PSYS 3 /* use particle system */ -#define MOD_DPAINT_COL_POINT 4 /* use distance to object center point */ +enum { + MOD_DPAINT_COL_VOLUME = 0, /* paint with mesh volume */ + MOD_DPAINT_COL_DIST = 1, /* paint using distance to mesh surface */ + MOD_DPAINT_COL_VOLDIST = 2, /* use both volume and distance */ + MOD_DPAINT_COL_PSYS = 3, /* use particle system */ + MOD_DPAINT_COL_POINT = 4, /* use distance to object center point */ +}; /* proximity_falloff */ -#define MOD_DPAINT_PRFALL_CONSTANT 0 /* no-falloff */ -#define MOD_DPAINT_PRFALL_SMOOTH 1 /* smooth, linear falloff */ -#define MOD_DPAINT_PRFALL_RAMP 2 /* use color ramp */ +enum { + MOD_DPAINT_PRFALL_CONSTANT = 0, /* no-falloff */ + MOD_DPAINT_PRFALL_SMOOTH = 1, /* smooth, linear falloff */ + MOD_DPAINT_PRFALL_RAMP = 2, /* use color ramp */ +}; /* wave_brush_type */ -#define MOD_DPAINT_WAVEB_DEPTH 0 /* use intersection depth */ -#define MOD_DPAINT_WAVEB_FORCE 1 /* act as a force on intersection area */ -#define MOD_DPAINT_WAVEB_REFLECT 2 /* obstacle that reflects waves */ -#define MOD_DPAINT_WAVEB_CHANGE 3 /* use change of intersection depth from previous frame */ +enum { + MOD_DPAINT_WAVEB_DEPTH = 0, /* use intersection depth */ + MOD_DPAINT_WAVEB_FORCE = 1, /* act as a force on intersection area */ + MOD_DPAINT_WAVEB_REFLECT = 2, /* obstacle that reflects waves */ + MOD_DPAINT_WAVEB_CHANGE = 3, /* use change of intersection depth from previous frame */ +}; /* brush ray_dir */ -#define MOD_DPAINT_RAY_CANVAS 0 -#define MOD_DPAINT_RAY_BRUSH_AVG 1 -#define MOD_DPAINT_RAY_ZPLUS 2 - +enum { + MOD_DPAINT_RAY_CANVAS = 0, + MOD_DPAINT_RAY_BRUSH_AVG = 1, + MOD_DPAINT_RAY_ZPLUS = 2, +}; /* Brush settings */ typedef struct DynamicPaintBrushSettings { diff --git a/source/blender/makesdna/DNA_freestyle_types.h b/source/blender/makesdna/DNA_freestyle_types.h index d099511a088..2359d1e9738 100644 --- a/source/blender/makesdna/DNA_freestyle_types.h +++ b/source/blender/makesdna/DNA_freestyle_types.h @@ -44,60 +44,74 @@ struct Group; struct Text; /* FreestyleConfig::flags */ -#define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG (1 << 0) -#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG (1 << 1) -#define FREESTYLE_MATERIAL_BOUNDARIES_FLAG (1 << 2) -#define FREESTYLE_FACE_SMOOTHNESS_FLAG (1 << 3) -#define FREESTYLE_ADVANCED_OPTIONS_FLAG (1 << 4) -#define FREESTYLE_CULLING (1 << 5) -#define FREESTYLE_VIEW_MAP_CACHE (1 << 6) +enum { + FREESTYLE_SUGGESTIVE_CONTOURS_FLAG = 1 << 0, + FREESTYLE_RIDGES_AND_VALLEYS_FLAG = 1 << 1, + FREESTYLE_MATERIAL_BOUNDARIES_FLAG = 1 << 2, + FREESTYLE_FACE_SMOOTHNESS_FLAG = 1 << 3, + FREESTYLE_ADVANCED_OPTIONS_FLAG = 1 << 4, + FREESTYLE_CULLING = 1 << 5, + FREESTYLE_VIEW_MAP_CACHE = 1 << 6, +}; /* FreestyleConfig::mode */ -#define FREESTYLE_CONTROL_SCRIPT_MODE 1 -#define FREESTYLE_CONTROL_EDITOR_MODE 2 +enum { + FREESTYLE_CONTROL_SCRIPT_MODE = 1, + FREESTYLE_CONTROL_EDITOR_MODE = 2, +}; /* FreestyleLineSet::flags */ -#define FREESTYLE_LINESET_CURRENT (1 << 0) -#define FREESTYLE_LINESET_ENABLED (1 << 1) -#define FREESTYLE_LINESET_FE_NOT (1 << 2) -#define FREESTYLE_LINESET_FE_AND (1 << 3) -#define FREESTYLE_LINESET_GR_NOT (1 << 4) -#define FREESTYLE_LINESET_FM_NOT (1 << 5) -#define FREESTYLE_LINESET_FM_BOTH (1 << 6) +enum { + FREESTYLE_LINESET_CURRENT = 1 << 0, + FREESTYLE_LINESET_ENABLED = 1 << 1, + FREESTYLE_LINESET_FE_NOT = 1 << 2, + FREESTYLE_LINESET_FE_AND = 1 << 3, + FREESTYLE_LINESET_GR_NOT = 1 << 4, + FREESTYLE_LINESET_FM_NOT = 1 << 5, + FREESTYLE_LINESET_FM_BOTH = 1 << 6, +}; /* FreestyleLineSet::selection */ -#define FREESTYLE_SEL_VISIBILITY (1 << 0) -#define FREESTYLE_SEL_EDGE_TYPES (1 << 1) -#define FREESTYLE_SEL_GROUP (1 << 2) -#define FREESTYLE_SEL_IMAGE_BORDER (1 << 3) -#define FREESTYLE_SEL_FACE_MARK (1 << 4) +enum { + FREESTYLE_SEL_VISIBILITY = 1 << 0, + FREESTYLE_SEL_EDGE_TYPES = 1 << 1, + FREESTYLE_SEL_GROUP = 1 << 2, + FREESTYLE_SEL_IMAGE_BORDER = 1 << 3, + FREESTYLE_SEL_FACE_MARK = 1 << 4, +}; /* FreestyleLineSet::edge_types, exclude_edge_types */ -#define FREESTYLE_FE_SILHOUETTE (1 << 0) -#define FREESTYLE_FE_BORDER (1 << 1) -#define FREESTYLE_FE_CREASE (1 << 2) -#define FREESTYLE_FE_RIDGE_VALLEY (1 << 3) -/* Note: FREESTYLE_FE_VALLEY = (1 << 4) is no longer used */ -#define FREESTYLE_FE_SUGGESTIVE_CONTOUR (1 << 5) -#define FREESTYLE_FE_MATERIAL_BOUNDARY (1 << 6) -#define FREESTYLE_FE_CONTOUR (1 << 7) -#define FREESTYLE_FE_EXTERNAL_CONTOUR (1 << 8) -#define FREESTYLE_FE_EDGE_MARK (1 << 9) +enum { + FREESTYLE_FE_SILHOUETTE = 1 << 0, + FREESTYLE_FE_BORDER = 1 << 1, + FREESTYLE_FE_CREASE = 1 << 2, + FREESTYLE_FE_RIDGE_VALLEY = 1 << 3, + /* FREESTYLE_FE_VALLEY = 1 << 4, */ /* No longer used */ + FREESTYLE_FE_SUGGESTIVE_CONTOUR = 1 << 5, + FREESTYLE_FE_MATERIAL_BOUNDARY = 1 << 6, + FREESTYLE_FE_CONTOUR = 1 << 7, + FREESTYLE_FE_EXTERNAL_CONTOUR = 1 << 8, + FREESTYLE_FE_EDGE_MARK = 1 << 9, +}; /* FreestyleLineSet::qi */ -#define FREESTYLE_QI_VISIBLE 1 -#define FREESTYLE_QI_HIDDEN 2 -#define FREESTYLE_QI_RANGE 3 +enum { + FREESTYLE_QI_VISIBLE = 1, + FREESTYLE_QI_HIDDEN = 2, + FREESTYLE_QI_RANGE = 3, +}; /* FreestyleConfig::raycasting_algorithm */ /* Defines should be replaced with ViewMapBuilder::visibility_algo */ -#define FREESTYLE_ALGO_REGULAR 1 -#define FREESTYLE_ALGO_FAST 2 -#define FREESTYLE_ALGO_VERYFAST 3 -#define FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL 4 -#define FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL 5 -#define FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE 6 -#define FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE 7 +enum { + FREESTYLE_ALGO_REGULAR = 1, + FREESTYLE_ALGO_FAST = 2, + FREESTYLE_ALGO_VERYFAST = 3, + FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL = 4, + FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL = 5, + FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE = 6, + FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE = 7, +}; typedef struct FreestyleLineSet { struct FreestyleLineSet *next, *prev;