diff options
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 380 |
1 files changed, 209 insertions, 171 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 300b0c6e4d9..44c1a0500be 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -326,23 +326,25 @@ typedef struct DupliObject { #define SELECT 1 /* type */ -#define OB_EMPTY 0 -#define OB_MESH 1 -#define OB_CURVE 2 -#define OB_SURF 3 -#define OB_FONT 4 -#define OB_MBALL 5 +enum { + OB_EMPTY = 0, + OB_MESH = 1, + OB_CURVE = 2, + OB_SURF = 3, + OB_FONT = 4, + OB_MBALL = 5, -#define OB_LAMP 10 -#define OB_CAMERA 11 + OB_LAMP = 10, + OB_CAMERA = 11, -#define OB_SPEAKER 12 + OB_SPEAKER = 12, -/* #define OB_WAVE 21 */ -#define OB_LATTICE 22 +/* OB_WAVE = 21, */ + OB_LATTICE = 22, /* 23 and 24 are for life and sector (old file compat.) */ -#define OB_ARMATURE 25 + OB_ARMATURE = 25, +}; /* check if the object type supports materials */ #define OB_TYPE_SUPPORT_MATERIAL(_type) \ @@ -360,36 +362,40 @@ typedef struct DupliObject { ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_CA: case ID_LT: case ID_AR /* partype: first 4 bits: type */ -#define PARTYPE ((1 << 4) - 1) -#define PAROBJECT 0 -#define PARCURVE 1 -#define PARKEY 2 - -#define PARSKEL 4 -#define PARVERT1 5 -#define PARVERT3 6 -#define PARBONE 7 - - /* slow parenting - is not threadsafe and/or may give errors after jumping */ -#define PARSLOW 16 +enum { + PARTYPE = (1 << 4) - 1, + PAROBJECT = 0, + PARCURVE = 1, + PARKEY = 2, + + PARSKEL = 4, + PARVERT1 = 5, + PARVERT3 = 6, + PARBONE = 7, + + /* slow parenting - is not threadsafe and/or may give errors after jumping */ + PARSLOW = 16, +}; /* (short) transflag */ /* flags 1 and 2 were unused or relics from past features */ -#define OB_NEG_SCALE (1 << 2) -#define OB_DUPLIFRAMES (1 << 3) -#define OB_DUPLIVERTS (1 << 4) -#define OB_DUPLIROT (1 << 5) -#define OB_DUPLINOSPEED (1 << 6) -/*#define OB_POWERTRACK (1 << 7)*/ /*UNUSED*/ -#define OB_DUPLIGROUP (1 << 8) -#define OB_DUPLIFACES (1 << 9) -#define OB_DUPLIFACES_SCALE (1 << 10) -#define OB_DUPLIPARTS (1 << 11) -#define OB_RENDER_DUPLI (1 << 12) -#define OB_NO_CONSTRAINTS (1 << 13) /* runtime constraints disable */ -#define OB_NO_PSYS_UPDATE (1 << 14) /* hack to work around particle issue */ - -#define OB_DUPLI (OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | OB_DUPLIFACES | OB_DUPLIPARTS) +enum { + OB_NEG_SCALE = 1 << 2, + OB_DUPLIFRAMES = 1 << 3, + OB_DUPLIVERTS = 1 << 4, + OB_DUPLIROT = 1 << 5, + OB_DUPLINOSPEED = 1 << 6, +/* OB_POWERTRACK = 1 << 7,*/ /*UNUSED*/ + OB_DUPLIGROUP = 1 << 8, + OB_DUPLIFACES = 1 << 9, + OB_DUPLIFACES_SCALE = 1 << 10, + OB_DUPLIPARTS = 1 << 11, + OB_RENDER_DUPLI = 1 << 12, + OB_NO_CONSTRAINTS = 1 << 13, /* runtime constraints disable */ + OB_NO_PSYS_UPDATE = 1 << 14, /* hack to work around particle issue */ + + OB_DUPLI = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | OB_DUPLIFACES | OB_DUPLIPARTS, +}; /* (short) ipoflag */ /* XXX: many old flags for features removed due to incompatibility @@ -399,58 +405,68 @@ typedef struct DupliObject { #define OB_DISABLE_PATH (1 << 10) /* (short) trackflag / upflag */ -#define OB_POSX 0 -#define OB_POSY 1 -#define OB_POSZ 2 -#define OB_NEGX 3 -#define OB_NEGY 4 -#define OB_NEGZ 5 +enum { + OB_POSX = 0, + OB_POSY = 1, + OB_POSZ = 2, + OB_NEGX = 3, + OB_NEGY = 4, + OB_NEGZ = 5, +}; /* gameflag in game.h */ /* dt: no flags */ -#define OB_BOUNDBOX 1 -#define OB_WIRE 2 -#define OB_SOLID 3 -#define OB_MATERIAL 4 -#define OB_TEXTURE 5 -#define OB_RENDER 6 - -#define OB_PAINT 100 /* temporary used in draw code */ +enum { + OB_BOUNDBOX = 1, + OB_WIRE = 2, + OB_SOLID = 3, + OB_MATERIAL = 4, + OB_TEXTURE = 5, + OB_RENDER = 6, + + OB_PAINT = 100, /* temporary used in draw code */ +}; /* dtx: flags (short) */ -#define OB_DRAWBOUNDOX (1 << 0) -#define OB_AXIS (1 << 1) -#define OB_TEXSPACE (1 << 2) -#define OB_DRAWNAME (1 << 3) -#define OB_DRAWIMAGE (1 << 4) +enum { + OB_DRAWBOUNDOX = 1 << 0, + OB_AXIS = 1 << 1, + OB_TEXSPACE = 1 << 2, + OB_DRAWNAME = 1 << 3, + OB_DRAWIMAGE = 1 << 4, /* for solid+wire display */ -#define OB_DRAWWIRE (1 << 5) + OB_DRAWWIRE = 1 << 5, /* for overdraw s*/ -#define OB_DRAWXRAY (1 << 6) + OB_DRAWXRAY = 1 << 6, /* enable transparent draw */ -#define OB_DRAWTRANSP (1 << 7) -#define OB_DRAW_ALL_EDGES (1 << 8) /* only for meshes currently */ + OB_DRAWTRANSP = 1 << 7, + OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */ +}; /* empty_drawtype: no flags */ -#define OB_ARROWS 1 -#define OB_PLAINAXES 2 -#define OB_CIRCLE 3 -#define OB_SINGLE_ARROW 4 -#define OB_CUBE 5 -#define OB_EMPTY_SPHERE 6 -#define OB_EMPTY_CONE 7 -#define OB_EMPTY_IMAGE 8 +enum { + OB_ARROWS = 1, + OB_PLAINAXES = 2, + OB_CIRCLE = 3, + OB_SINGLE_ARROW = 4, + OB_CUBE = 5, + OB_EMPTY_SPHERE = 6, + OB_EMPTY_CONE = 7, + OB_EMPTY_IMAGE = 8, +}; /* boundtype */ -#define OB_BOUND_BOX 0 -#define OB_BOUND_SPHERE 1 -#define OB_BOUND_CYLINDER 2 -#define OB_BOUND_CONE 3 -#define OB_BOUND_TRIANGLE_MESH 4 -#define OB_BOUND_CONVEX_HULL 5 -/* #define OB_BOUND_DYN_MESH 6 */ /*UNUSED*/ -#define OB_BOUND_CAPSULE 7 +enum { + OB_BOUND_BOX = 0, + OB_BOUND_SPHERE = 1, + OB_BOUND_CYLINDER = 2, + OB_BOUND_CONE = 3, + OB_BOUND_TRIANGLE_MESH = 4, + OB_BOUND_CONVEX_HULL = 5, +/* OB_BOUND_DYN_MESH = 6, */ /*UNUSED*/ + OB_BOUND_CAPSULE = 7, +}; /* **************** BASE ********************* */ @@ -482,12 +498,14 @@ typedef struct DupliObject { /* WARNING - when adding flags check on PSYS_RECALC */ /* ob->recalc (flag bits!) */ -#define OB_RECALC_OB (1 << 0) -#define OB_RECALC_DATA (1 << 1) +enum { + OB_RECALC_OB = 1 << 0, + OB_RECALC_DATA = 1 << 1, /* time flag is set when time changes need recalc, so baked systems can ignore it */ -#define OB_RECALC_TIME (1 << 2) + OB_RECALC_TIME = 1 << 2, /* only use for matching any flag, NOT as an argument since more flags may be added. */ -#define OB_RECALC_ALL (OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME) + OB_RECALC_ALL = OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME, +}; /* controller state */ #define OB_MAX_STATES 30 @@ -496,124 +514,144 @@ typedef struct DupliObject { #define OB_MAX_COL_MASKS 8 /* ob->gameflag */ -#define OB_DYNAMIC (1 << 0) -#define OB_CHILD (1 << 1) -#define OB_ACTOR (1 << 2) -#define OB_INERTIA_LOCK_X (1 << 3) -#define OB_INERTIA_LOCK_Y (1 << 4) -#define OB_INERTIA_LOCK_Z (1 << 5) -#define OB_DO_FH (1 << 6) -#define OB_ROT_FH (1 << 7) -#define OB_ANISOTROPIC_FRICTION (1 << 8) -#define OB_GHOST (1 << 9) -#define OB_RIGID_BODY (1 << 10) -#define OB_BOUNDS (1 << 11) - -#define OB_COLLISION_RESPONSE (1 << 12) -#define OB_SECTOR (1 << 13) -#define OB_PROP (1 << 14) -#define OB_MAINACTOR (1 << 15) - -#define OB_COLLISION (1 << 16) -#define OB_SOFT_BODY (1 << 17) -#define OB_OCCLUDER (1 << 18) -#define OB_SENSOR (1 << 19) -#define OB_NAVMESH (1 << 20) -#define OB_HASOBSTACLE (1 << 21) -#define OB_CHARACTER (1 << 22) +enum { + OB_DYNAMIC = 1 << 0, + OB_CHILD = 1 << 1, + OB_ACTOR = 1 << 2, + OB_INERTIA_LOCK_X = 1 << 3, + OB_INERTIA_LOCK_Y = 1 << 4, + OB_INERTIA_LOCK_Z = 1 << 5, + OB_DO_FH = 1 << 6, + OB_ROT_FH = 1 << 7, + OB_ANISOTROPIC_FRICTION = 1 << 8, + OB_GHOST = 1 << 9, + OB_RIGID_BODY = 1 << 10, + OB_BOUNDS = 1 << 11, + + OB_COLLISION_RESPONSE = 1 << 12, + OB_SECTOR = 1 << 13, + OB_PROP = 1 << 14, + OB_MAINACTOR = 1 << 15, + + OB_COLLISION = 1 << 16, + OB_SOFT_BODY = 1 << 17, + OB_OCCLUDER = 1 << 18, + OB_SENSOR = 1 << 19, + OB_NAVMESH = 1 << 20, + OB_HASOBSTACLE = 1 << 21, + OB_CHARACTER = 1 << 22, +}; /* ob->gameflag2 */ -#define OB_NEVER_DO_ACTIVITY_CULLING (1 << 0) -#define OB_LOCK_RIGID_BODY_X_AXIS (1 << 2) -#define OB_LOCK_RIGID_BODY_Y_AXIS (1 << 3) -#define OB_LOCK_RIGID_BODY_Z_AXIS (1 << 4) -#define OB_LOCK_RIGID_BODY_X_ROT_AXIS (1 << 5) -#define OB_LOCK_RIGID_BODY_Y_ROT_AXIS (1 << 6) -#define OB_LOCK_RIGID_BODY_Z_ROT_AXIS (1 << 7) - -/* #define OB_LIFE (OB_PROP | OB_DYNAMIC | OB_ACTOR | OB_MAINACTOR | OB_CHILD) */ +enum { + OB_NEVER_DO_ACTIVITY_CULLING = 1 << 0, + OB_LOCK_RIGID_BODY_X_AXIS = 1 << 2, + OB_LOCK_RIGID_BODY_Y_AXIS = 1 << 3, + OB_LOCK_RIGID_BODY_Z_AXIS = 1 << 4, + OB_LOCK_RIGID_BODY_X_ROT_AXIS = 1 << 5, + OB_LOCK_RIGID_BODY_Y_ROT_AXIS = 1 << 6, + OB_LOCK_RIGID_BODY_Z_ROT_AXIS = 1 << 7, + +/* OB_LIFE = OB_PROP | OB_DYNAMIC | OB_ACTOR | OB_MAINACTOR | OB_CHILD, */ +}; /* ob->body_type */ -#define OB_BODY_TYPE_NO_COLLISION 0 -#define OB_BODY_TYPE_STATIC 1 -#define OB_BODY_TYPE_DYNAMIC 2 -#define OB_BODY_TYPE_RIGID 3 -#define OB_BODY_TYPE_SOFT 4 -#define OB_BODY_TYPE_OCCLUDER 5 -#define OB_BODY_TYPE_SENSOR 6 -#define OB_BODY_TYPE_NAVMESH 7 -#define OB_BODY_TYPE_CHARACTER 8 +enum { + OB_BODY_TYPE_NO_COLLISION = 0, + OB_BODY_TYPE_STATIC = 1, + OB_BODY_TYPE_DYNAMIC = 2, + OB_BODY_TYPE_RIGID = 3, + OB_BODY_TYPE_SOFT = 4, + OB_BODY_TYPE_OCCLUDER = 5, + OB_BODY_TYPE_SENSOR = 6, + OB_BODY_TYPE_NAVMESH = 7, + OB_BODY_TYPE_CHARACTER = 8, +}; /* ob->depsflag */ -#define OB_DEPS_EXTRA_OB_RECALC (1 << 0) -#define OB_DEPS_EXTRA_DATA_RECALC (1 << 1) +enum { + OB_DEPS_EXTRA_OB_RECALC = 1 << 0, + OB_DEPS_EXTRA_DATA_RECALC = 1 << 1, +}; /* ob->scavisflag */ -#define OB_VIS_SENS (1 << 0) -#define OB_VIS_CONT (1 << 1) -#define OB_VIS_ACT (1 << 2) +enum { + OB_VIS_SENS = 1 << 0, + OB_VIS_CONT = 1 << 1, + OB_VIS_ACT = 1 << 2, +}; /* ob->scaflag */ -#define OB_SHOWSENS (1 << 6) -#define OB_SHOWACT (1 << 7) -#define OB_ADDSENS (1 << 8) -#define OB_ADDCONT (1 << 9) -#define OB_ADDACT (1 << 10) -#define OB_SHOWCONT (1 << 11) -#define OB_ALLSTATE (1 << 12) -#define OB_INITSTBIT (1 << 13) -#define OB_DEBUGSTATE (1 << 14) -#define OB_SHOWSTATE (1 << 15) +enum { + OB_SHOWSENS = 1 << 6, + OB_SHOWACT = 1 << 7, + OB_ADDSENS = 1 << 8, + OB_ADDCONT = 1 << 9, + OB_ADDACT = 1 << 10, + OB_SHOWCONT = 1 << 11, + OB_ALLSTATE = 1 << 12, + OB_INITSTBIT = 1 << 13, + OB_DEBUGSTATE = 1 << 14, + OB_SHOWSTATE = 1 << 15, +}; /* ob->restrictflag */ -#define OB_RESTRICT_VIEW (1 << 0) -#define OB_RESTRICT_SELECT (1 << 1) -#define OB_RESTRICT_RENDER (1 << 2) +enum { + OB_RESTRICT_VIEW = 1 << 0, + OB_RESTRICT_SELECT = 1 << 1, + OB_RESTRICT_RENDER = 1 << 2, +}; /* ob->shapeflag */ -#define OB_SHAPE_LOCK (1 << 0) -#define OB_SHAPE_TEMPLOCK (1 << 1) /* deprecated */ -#define OB_SHAPE_EDIT_MODE (1 << 2) +enum { + OB_SHAPE_LOCK = 1 << 0, + OB_SHAPE_TEMPLOCK = 1 << 1, /* deprecated */ + OB_SHAPE_EDIT_MODE = 1 << 2, +}; /* ob->nlaflag */ +enum { /* WARNING: flags (1 << 0) and (1 << 1) were from old animsys */ /* object-channel expanded status */ -#define OB_ADS_COLLAPSED (1 << 10) + OB_ADS_COLLAPSED = 1 << 10, /* object's ipo-block */ -#define OB_ADS_SHOWIPO (1 << 11) + OB_ADS_SHOWIPO = 1 << 11, /* object's constraint channels */ -#define OB_ADS_SHOWCONS (1 << 12) + OB_ADS_SHOWCONS = 1 << 12, /* object's material channels */ -#define OB_ADS_SHOWMATS (1 << 13) + OB_ADS_SHOWMATS = 1 << 13, /* object's marticle channels */ -#define OB_ADS_SHOWPARTS (1 << 14) + OB_ADS_SHOWPARTS = 1 << 14, +}; /* ob->protectflag */ -#define OB_LOCK_LOCX (1 << 0) -#define OB_LOCK_LOCY (1 << 1) -#define OB_LOCK_LOCZ (1 << 2) -#define OB_LOCK_LOC (OB_LOCK_LOCX | OB_LOCK_LOCY | OB_LOCK_LOCZ) -#define OB_LOCK_ROTX (1 << 3) -#define OB_LOCK_ROTY (1 << 4) -#define OB_LOCK_ROTZ (1 << 5) -#define OB_LOCK_ROT (OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ) -#define OB_LOCK_SCALEX (1 << 6) -#define OB_LOCK_SCALEY (1 << 7) -#define OB_LOCK_SCALEZ (1 << 8) -#define OB_LOCK_SCALE (OB_LOCK_SCALEX | OB_LOCK_SCALEY | OB_LOCK_SCALEZ) -#define OB_LOCK_ROTW (1 << 9) -#define OB_LOCK_ROT4D (1 << 10) +enum { + OB_LOCK_LOCX = 1 << 0, + OB_LOCK_LOCY = 1 << 1, + OB_LOCK_LOCZ = 1 << 2, + OB_LOCK_LOC = OB_LOCK_LOCX | OB_LOCK_LOCY | OB_LOCK_LOCZ, + OB_LOCK_ROTX = 1 << 3, + OB_LOCK_ROTY = 1 << 4, + OB_LOCK_ROTZ = 1 << 5, + OB_LOCK_ROT = OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ, + OB_LOCK_SCALEX = 1 << 6, + OB_LOCK_SCALEY = 1 << 7, + OB_LOCK_SCALEZ = 1 << 8, + OB_LOCK_SCALE = OB_LOCK_SCALEX | OB_LOCK_SCALEY | OB_LOCK_SCALEZ, + OB_LOCK_ROTW = 1 << 9, + OB_LOCK_ROT4D = 1 << 10, +}; /* ob->mode */ typedef enum ObjectMode { - OB_MODE_OBJECT = 0, - OB_MODE_EDIT = 1 << 0, - OB_MODE_SCULPT = 1 << 1, - OB_MODE_VERTEX_PAINT = 1 << 2, - OB_MODE_WEIGHT_PAINT = 1 << 3, + OB_MODE_OBJECT = 0, + OB_MODE_EDIT = 1 << 0, + OB_MODE_SCULPT = 1 << 1, + OB_MODE_VERTEX_PAINT = 1 << 2, + OB_MODE_WEIGHT_PAINT = 1 << 3, OB_MODE_TEXTURE_PAINT = 1 << 4, OB_MODE_PARTICLE_EDIT = 1 << 5, - OB_MODE_POSE = 1 << 6, + OB_MODE_POSE = 1 << 6, } ObjectMode; /* any mode where the brush system is used */ |