LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
6 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
7 * of the License, or (at your option) any later version. | 7 * of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 23 matching lines...) Expand all Loading... |
34 #define __DNA_OBJECT_TYPES_H__ | 34 #define __DNA_OBJECT_TYPES_H__ |
35 | 35 |
36 #include "DNA_defs.h" | 36 #include "DNA_defs.h" |
37 #include "DNA_listBase.h" | 37 #include "DNA_listBase.h" |
38 #include "DNA_ID.h" | 38 #include "DNA_ID.h" |
39 #include "DNA_action_types.h" /* bAnimVizSettings */ | 39 #include "DNA_action_types.h" /* bAnimVizSettings */ |
40 | 40 |
41 #ifdef __cplusplus | 41 #ifdef __cplusplus |
42 extern "C" { | 42 extern "C" { |
43 #endif | 43 #endif |
44 | 44 » |
45 struct Object; | 45 struct Object; |
46 struct AnimData; | 46 struct AnimData; |
47 struct Ipo; | 47 struct Ipo; |
48 struct BoundBox; | 48 struct BoundBox; |
49 struct Path; | 49 struct Path; |
50 struct Material; | 50 struct Material; |
51 struct bConstraintChannel; | 51 struct bConstraintChannel; |
52 struct PartDeflect; | 52 struct PartDeflect; |
53 struct SoftBody; | 53 struct SoftBody; |
54 struct FluidsimSettings; | 54 struct FluidsimSettings; |
55 struct ParticleSystem; | 55 struct ParticleSystem; |
56 struct DerivedMesh; | 56 struct DerivedMesh; |
57 struct SculptSession; | 57 struct SculptSession; |
58 struct bGPdata; | 58 struct bGPdata; |
59 struct RigidBodyOb; | |
60 | 59 |
61 | 60 |
62 /* Vertex Groups - Name Info */ | 61 /* Vertex Groups - Name Info */ |
63 typedef struct bDeformGroup { | 62 typedef struct bDeformGroup { |
64 struct bDeformGroup *next, *prev; | 63 struct bDeformGroup *next, *prev; |
65 char name[64]; /* MAX_VGROUP_NAME */ | 64 char name[64]; /* MAX_VGROUP_NAME */ |
66 /* need this flag for locking weights */ | 65 /* need this flag for locking weights */ |
67 char flag, pad[7]; | 66 char flag, pad[7]; |
68 } bDeformGroup; | 67 } bDeformGroup; |
69 #define MAX_VGROUP_NAME 64 | 68 #define MAX_VGROUP_NAME 64 |
70 | 69 |
71 /* bDeformGroup->flag */ | 70 /* bDeformGroup->flag */ |
72 #define DG_LOCK_WEIGHT 1 | 71 #define DG_LOCK_WEIGHT 1 |
73 | 72 |
74 /** | 73 /** |
75 * The following illustrates the orientation of the | 74 * The following illustrates the orientation of the |
76 * bounding box in local space | 75 * bounding box in local space |
77 * | 76 * |
78 * <pre> | 77 * |
79 * | |
80 * Z Y | 78 * Z Y |
81 * | / | 79 * | / |
82 * |/ | 80 * |/ |
83 * .-----X | 81 * .-----X |
84 * | 82 * |
85 * | 83 * |
86 * 2----------6 | 84 * 2----------6 |
87 * /| /| | 85 * /| /| |
88 * / | / | | 86 * / | / | |
89 * 1----------5 | | 87 * 1----------5 | |
90 * | | | | | 88 * | | | | |
91 * | 3-------|--7 | 89 * | 3-------|--7 |
92 * | / | / | 90 * | / | / |
93 * |/ |/ | 91 * |/ |/ |
94 * 0----------4 | 92 * 0----------4 |
95 * </pre> | |
96 */ | 93 */ |
97 typedef struct BoundBox { | 94 typedef struct BoundBox { |
98 float vec[8][3]; | 95 float vec[8][3]; |
99 int flag, pad; | 96 int flag, pad; |
100 } BoundBox; | 97 } BoundBox; |
101 | 98 |
102 /* boundbox flag */ | 99 /* boundbox flag */ |
103 enum { | 100 #define OB_BB_DISABLED» 1 |
104 » BOUNDBOX_DISABLED = (1 << 0), | |
105 » BOUNDBOX_DIRTY = (1 << 1), | |
106 }; | |
107 | 101 |
108 typedef struct Object { | 102 typedef struct Object { |
109 ID id; | 103 ID id; |
110 struct AnimData *adt; /* animation data (must be immediately a
fter id for utilities to use it) */· | 104 struct AnimData *adt; /* animation data (must be immediately a
fter id for utilities to use it) */· |
111 | 105 |
112 struct SculptSession *sculpt; | 106 struct SculptSession *sculpt; |
113 ········ | 107 ········ |
114 short type, partype; | 108 short type, partype; |
115 int par1, par2, par3; /* can be vertexnrs */ | 109 int par1, par2, par3; /* can be vertexnrs */ |
116 char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME
-2 */ | 110 char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME
-2 */ |
117 struct Object *parent, *track; | 111 struct Object *parent, *track; |
118 /* if ob->proxy (or proxy_group), this object is proxy for object ob->pr
oxy */ | 112 /* if ob->proxy (or proxy_group), this object is proxy for object ob->pr
oxy */ |
119 /* proxy_from is set in target back to the proxy. */ | 113 /* proxy_from is set in target back to the proxy. */ |
120 struct Object *proxy, *proxy_group, *proxy_from; | 114 struct Object *proxy, *proxy_group, *proxy_from; |
121 struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated fo
r 2.5 */ | 115 struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated fo
r 2.5 */ |
122 /* struct Path *path; */ | 116 /* struct Path *path; */ |
123 struct BoundBox *bb; | 117 struct BoundBox *bb; |
124 » struct bAction *action DNA_DEPRECATED;» // XXX deprecated... old animat
ion system | 118 » struct bAction *action DNA_DEPRECATED;» // XXX depreceated... old anima
tion system |
125 struct bAction *poselib; | 119 struct bAction *poselib; |
126 struct bPose *pose; /* pose data, armature objects only */ | 120 struct bPose *pose; /* pose data, armature objects only */ |
127 void *data; /* pointer to objects data - an 'ID' or NULL */ | 121 void *data; /* pointer to objects data - an 'ID' or NULL */ |
128 ········ | 122 ········ |
129 struct bGPdata *gpd; /* Grease Pencil data */ | 123 struct bGPdata *gpd; /* Grease Pencil data */ |
130 ········ | 124 ········ |
131 bAnimVizSettings avs; /* settings for visualization of object-transfor
m animation */ | 125 bAnimVizSettings avs; /* settings for visualization of object-transfor
m animation */ |
132 bMotionPath *mpath; /* motion path cache for this object */ | 126 bMotionPath *mpath; /* motion path cache for this object */ |
133 ········ | 127 ········ |
134 » ListBase constraintChannels DNA_DEPRECATED; // XXX deprecated... old an
imation system | 128 » ListBase constraintChannels DNA_DEPRECATED; // XXX depreceated... old a
nimation system |
135 » ListBase effect DNA_DEPRECATED; // XXX deprecated... keep f
or readfile | 129 » ListBase effect DNA_DEPRECATED; // XXX depreceated... keep
for readfile |
| 130 » ListBase disp; /* list of DispList, used by lattice, metaballs curv
e & surfaces */ |
136 ListBase defbase; /* list of bDeformGroup (vertex groups) names and fl
ag only */ | 131 ListBase defbase; /* list of bDeformGroup (vertex groups) names and fl
ag only */ |
137 ListBase modifiers; /* list of ModifierData structures */ | 132 ListBase modifiers; /* list of ModifierData structures */ |
138 | 133 |
139 int mode; /* Local object mode */ | 134 int mode; /* Local object mode */ |
140 int restore_mode; /* Keep track of what mode to return to after toggli
ng a mode */ | 135 int restore_mode; /* Keep track of what mode to return to after toggli
ng a mode */ |
141 | 136 |
142 /* materials */ | 137 /* materials */ |
143 struct Material **mat; /* material slots */ | 138 struct Material **mat; /* material slots */ |
144 char *matbits; /* a boolean field, with each byte 1 if
corresponding material is linked to object */ | 139 char *matbits; /* a boolean field, with each byte 1 if
corresponding material is linked to object */ |
145 » int totcol;» » » » /* copy of mesh, curve & meta st
ruct member of same name (keep in sync) */ | 140 » int totcol;» » » » /* copy of mesh or curve or meta
*/ |
146 int actcol; /* currently selected material i
n the UI */ | 141 int actcol; /* currently selected material i
n the UI */ |
147 ········ | 142 ········ |
148 /* rot en drot have to be together! (transform('r' en 's')) */ | 143 /* rot en drot have to be together! (transform('r' en 's')) */ |
149 float loc[3], dloc[3], orig[3]; | 144 float loc[3], dloc[3], orig[3]; |
150 float size[3]; /* scale in fact */ | 145 float size[3]; /* scale in fact */ |
151 float dsize[3] DNA_DEPRECATED ; /* DEPRECATED, 2.60 and older only */ | 146 float dsize[3] DNA_DEPRECATED ; /* DEPRECATED, 2.60 and older only */ |
152 float dscale[3]; /* ack!, changing */ | 147 float dscale[3]; /* ack!, changing */ |
153 float rot[3], drot[3]; /* euler rotation */ | 148 float rot[3], drot[3]; /* euler rotation */ |
154 float quat[4], dquat[4]; /* quaternion rotation */ | 149 float quat[4], dquat[4]; /* quaternion rotation */ |
155 float rotAxis[3], drotAxis[3]; /* axis angle rotation - axis part */ | 150 float rotAxis[3], drotAxis[3]; /* axis angle rotation - axis part */ |
(...skipping 10 matching lines...) Expand all Loading... |
166 * the interactive ui of 2.5 creates problems. So now only 'imat_ren' sh
ould | 161 * the interactive ui of 2.5 creates problems. So now only 'imat_ren' sh
ould |
167 * be used when ever the inverse of ob->obmat * re->viewmat is needed! -
jahka | 162 * be used when ever the inverse of ob->obmat * re->viewmat is needed! -
jahka |
168 */ | 163 */ |
169 float imat_ren[4][4]; | 164 float imat_ren[4][4]; |
170 ········ | 165 ········ |
171 unsigned int lay; /* copy of Base's layer in the scene */ | 166 unsigned int lay; /* copy of Base's layer in the scene */ |
172 ········ | 167 ········ |
173 float sf; /* sf is time-offset */ | 168 float sf; /* sf is time-offset */ |
174 | 169 |
175 short flag; /* copy of Base */ | 170 short flag; /* copy of Base */ |
176 » short colbits DNA_DEPRECATED;» » /* deprecated, use 'matbits' */ | 171 » short colbits DNA_DEPRECATED;» » /* deprecated */ |
177 ········ | 172 ········ |
178 short transflag, protectflag; /* transformation settings and transform
locks */ | 173 short transflag, protectflag; /* transformation settings and transform
locks */ |
179 short trackflag, upflag; | 174 short trackflag, upflag; |
180 short nlaflag; /* used for DopeSheet filtering
settings (expanded/collapsed) */ | 175 short nlaflag; /* used for DopeSheet filtering
settings (expanded/collapsed) */ |
181 » short ipoflag;» » » » // xxx deprecated... old animati
on system | 176 » short ipoflag;» » » » // xxx depreceated... old animat
ion system |
182 short scaflag; /* ui state for game logic */ | 177 short scaflag; /* ui state for game logic */ |
183 char scavisflag; /* more display settings for gam
e logic */ | 178 char scavisflag; /* more display settings for gam
e logic */ |
184 » char depsflag; | 179 » char pad5; |
185 | 180 |
186 int dupon, dupoff, dupsta, dupend; | 181 int dupon, dupoff, dupsta, dupend; |
187 | 182 |
188 /* during realtime */ | 183 /* during realtime */ |
189 | 184 |
190 /* note that inertia is only called inertia for historical reasons | 185 /* note that inertia is only called inertia for historical reasons |
191 * and is not changed to avoid DNA surgery. It actually reflects the· | 186 * and is not changed to avoid DNA surgery. It actually reflects the· |
192 * Size value in the GameButtons (= radius) */ | 187 * Size value in the GameButtons (= radius) */ |
193 | 188 |
194 float mass, damping, inertia; | 189 float mass, damping, inertia; |
(...skipping 10 matching lines...) Expand all Loading... |
205 float margin; | 200 float margin; |
206 float max_vel; /* clamp the maximum velocity 0.0 is disabled */ | 201 float max_vel; /* clamp the maximum velocity 0.0 is disabled */ |
207 float min_vel; /* clamp the minimum velocity 0.0 is disabled */ | 202 float min_vel; /* clamp the minimum velocity 0.0 is disabled */ |
208 float m_contactProcessingThreshold; | 203 float m_contactProcessingThreshold; |
209 float obstacleRad; | 204 float obstacleRad; |
210 ········ | 205 ········ |
211 /* "Character" physics properties */ | 206 /* "Character" physics properties */ |
212 float step_height; | 207 float step_height; |
213 float jump_speed; | 208 float jump_speed; |
214 float fall_speed; | 209 float fall_speed; |
215 | 210 » char pad1[4]; |
216 » /** Collision mask settings */ | |
217 » unsigned short col_group, col_mask; | |
218 | 211 |
219 short rotmode; /* rotation mode - uses defines set out in DNA_a
ction_types.h for PoseChannel rotations... */ | 212 short rotmode; /* rotation mode - uses defines set out in DNA_a
ction_types.h for PoseChannel rotations... */ |
220 | 213 |
221 char boundtype; /* bounding box use for drawing */ | 214 char boundtype; /* bounding box use for drawing */ |
222 char collision_boundtype; /* bounding box type used for collision */ | 215 char collision_boundtype; /* bounding box type used for collision */ |
223 | 216 |
224 » short dtx;» » » /* viewport draw extra settings */ | 217 » char restrictflag;» /* for restricting view, select, render etc. acc
essible in outliner */ |
| 218 |
225 char dt; /* viewport draw type */ | 219 char dt; /* viewport draw type */ |
| 220 char dtx; /* viewport draw extra settings */ |
226 char empty_drawtype; | 221 char empty_drawtype; |
227 float empty_drawsize; | 222 float empty_drawsize; |
228 float dupfacesca; /* dupliface scale */ | 223 float dupfacesca; /* dupliface scale */ |
229 ········ | 224 ········ |
230 ListBase prop; /* game logic property list (not to be c
onfused with IDProperties) */ | 225 ListBase prop; /* game logic property list (not to be c
onfused with IDProperties) */ |
231 ListBase sensors; /* game logic sensors */ | 226 ListBase sensors; /* game logic sensors */ |
232 ListBase controllers; /* game logic controllers */ | 227 ListBase controllers; /* game logic controllers */ |
233 ListBase actuators; /* game logic actuators */ | 228 ListBase actuators; /* game logic actuators */ |
234 | 229 |
235 float bbsize[3] DNA_DEPRECATED; | 230 float bbsize[3] DNA_DEPRECATED; |
236 short index; /* custom index, for renderpasses */ | 231 short index; /* custom index, for renderpasses */ |
237 unsigned short actdef; /* current deformation group, note: index starts
at 1 */ | 232 unsigned short actdef; /* current deformation group, note: index starts
at 1 */ |
238 float col[4]; /* object color */ | 233 float col[4]; /* object color */ |
239 | 234 |
240 int gameflag; | 235 int gameflag; |
241 int gameflag2; | 236 int gameflag2; |
242 | 237 |
243 struct BulletSoftBody *bsoft; /* settings for game engine bullet soft
body */ | 238 struct BulletSoftBody *bsoft; /* settings for game engine bullet soft
body */ |
244 | 239 |
245 char restrictflag; /* for restricting view, select, render
etc. accessible in outliner */ | |
246 char recalc; /* dependency flag */ | |
247 short softflag; /* softbody settings */ | 240 short softflag; /* softbody settings */ |
| 241 short recalc; /* dependency flag */ |
248 float anisotropicFriction[3]; | 242 float anisotropicFriction[3]; |
249 | 243 |
250 ListBase constraints; /* object constraints */ | 244 ListBase constraints; /* object constraints */ |
251 » ListBase nlastrips DNA_DEPRECATED;» » » // XXX deprecate
d... old animation system | 245 » ListBase nlastrips DNA_DEPRECATED;» » » // XXX depreceat
ed... old animation system |
252 » ListBase hooks DNA_DEPRECATED;»» » » // XXX deprecate
d... old animation system | 246 » ListBase hooks DNA_DEPRECATED;»» » » // XXX depreceat
ed... old animation system |
253 ListBase particlesystem; /* particle systems */ | 247 ListBase particlesystem; /* particle systems */ |
254 ········ | 248 ········ |
255 struct PartDeflect *pd; /* particle deflector/attractor/collisio
n data */ | 249 struct PartDeflect *pd; /* particle deflector/attractor/collisio
n data */ |
256 struct SoftBody *soft; /* if exists, saved in file */ | 250 struct SoftBody *soft; /* if exists, saved in file */ |
257 struct Group *dup_group; /* object duplicator for group */ | 251 struct Group *dup_group; /* object duplicator for group */ |
258 | 252 |
259 char body_type; /* for now used to temporarily h
olds the type of collision object */ | 253 char body_type; /* for now used to temporarily h
olds the type of collision object */ |
260 char shapeflag; /* flag for pinning */ | 254 char shapeflag; /* flag for pinning */ |
261 short shapenr; /* current shape key for menu or
pinned */ | 255 short shapenr; /* current shape key for menu or
pinned */ |
262 float smoothresh; /* smoothresh is phong interpola
tion ray_shadow correction in render */ | 256 float smoothresh; /* smoothresh is phong interpola
tion ray_shadow correction in render */ |
263 | 257 |
264 struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store
additional settings */ | 258 struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store
additional settings */ |
265 | 259 |
266 struct DerivedMesh *derivedDeform, *derivedFinal; | 260 struct DerivedMesh *derivedDeform, *derivedFinal; |
267 int *pad; | 261 int *pad; |
268 uint64_t lastDataMask; /* the custom data layer mask that was last use
d to calculate derivedDeform and derivedFinal */ | 262 uint64_t lastDataMask; /* the custom data layer mask that was last use
d to calculate derivedDeform and derivedFinal */ |
269 uint64_t customdata_mask; /* (extra) custom data layer mask to use for c
reating derivedmesh, set by depsgraph */ | 263 uint64_t customdata_mask; /* (extra) custom data layer mask to use for c
reating derivedmesh, set by depsgraph */ |
270 unsigned int state; /* bit masks of game controllers
that are active */ | 264 unsigned int state; /* bit masks of game controllers
that are active */ |
271 unsigned int init_state; /* bit masks of initial state as recorde
d by the users */ | 265 unsigned int init_state; /* bit masks of initial state as recorde
d by the users */ |
272 | 266 |
273 ListBase gpulamp; /* runtime, for glsl lamp display only *
/ | 267 ListBase gpulamp; /* runtime, for glsl lamp display only *
/ |
274 ListBase pc_ids; | 268 ListBase pc_ids; |
275 ListBase *duplilist; /* for temporary dupli list storage, only for us
e by RNA API */ | 269 ListBase *duplilist; /* for temporary dupli list storage, only for us
e by RNA API */ |
276 ········ | |
277 struct RigidBodyOb *rigidbody_object; /* settings for Bullet r
igid body */ | |
278 struct RigidBodyCon *rigidbody_constraint; /* settings for Bullet c
onstraint */ | |
279 | 270 |
280 float ima_ofs[2]; /* offset for image empties */ | 271 float ima_ofs[2]; /* offset for image empties */ |
281 | |
282 /* Runtime valuated curve-specific data, not stored in the file */ | |
283 struct CurveCache *curve_cache; | |
284 } Object; | 272 } Object; |
285 | 273 |
286 /* Warning, this is not used anymore because hooks are now modifiers */ | 274 /* Warning, this is not used anymore because hooks are now modifiers */ |
287 typedef struct ObHook { | 275 typedef struct ObHook { |
288 struct ObHook *next, *prev; | 276 struct ObHook *next, *prev; |
289 ········ | 277 ········ |
290 struct Object *parent; | 278 struct Object *parent; |
291 float parentinv[4][4]; /* matrix making current transform unmodified */ | 279 float parentinv[4][4]; /* matrix making current transform unmodified */ |
292 float mat[4][4]; /* temp matrix while hooking */ | 280 float mat[4][4]; /* temp matrix while hooking */ |
293 float cent[3]; /* visualization of hook */ | 281 float cent[3]; /* visualization of hook */ |
294 float falloff; /* if not zero, falloff is distance wher
e influence zero */ | 282 float falloff; /* if not zero, falloff is distance wher
e influence zero */ |
295 ········ | 283 ········ |
296 char name[64]; /* MAX_NAME */ | 284 char name[64]; /* MAX_NAME */ |
297 | 285 |
298 int *indexar; | 286 int *indexar; |
299 int totindex, curindex; /* curindex is cache for fast lookup */ | 287 int totindex, curindex; /* curindex is cache for fast lookup */ |
300 short type, active; /* active is only first hook, for button
menu */ | 288 short type, active; /* active is only first hook, for button
menu */ |
301 float force; | 289 float force; |
302 } ObHook; | 290 } ObHook; |
303 | 291 |
304 /* runtime only, but include here for rna access */ | 292 /* runtime only, but include here for rna access */ |
305 typedef struct DupliObject { | 293 typedef struct DupliObject { |
306 struct DupliObject *next, *prev; | 294 struct DupliObject *next, *prev; |
307 struct Object *ob; | 295 struct Object *ob; |
308 » unsigned int origlay, pad; | 296 » unsigned int origlay; |
| 297 » int index; |
309 float mat[4][4], omat[4][4]; | 298 float mat[4][4], omat[4][4]; |
310 float orco[3], uv[2]; | 299 float orco[3], uv[2]; |
311 | 300 |
| 301 |
312 short type; /* from Object.transflag */ | 302 short type; /* from Object.transflag */ |
313 char no_draw, animated; | 303 char no_draw, animated; |
314 | |
315 /* persistent identifier for a dupli object, for inter-frame matching of | |
316 * objects with motion blur, or inter-update matching for syncing */ | |
317 int persistent_id[8]; /* MAX_DUPLI_RECUR */ | |
318 | |
319 /* particle this dupli was generated from */ | |
320 struct ParticleSystem *particle_system; | |
321 } DupliObject; | 304 } DupliObject; |
322 | 305 |
323 /* **************** OBJECT ********************* */ | 306 /* **************** OBJECT ********************* */ |
324 | |
325 /* used many places... should be specialized */ | |
326 #define SELECT 1 | |
327 | |
328 /* type */ | |
329 enum { | |
330 OB_EMPTY = 0, | |
331 OB_MESH = 1, | |
332 OB_CURVE = 2, | |
333 OB_SURF = 3, | |
334 OB_FONT = 4, | |
335 OB_MBALL = 5, | |
336 | |
337 OB_LAMP = 10, | |
338 OB_CAMERA = 11, | |
339 | |
340 OB_SPEAKER = 12, | |
341 | |
342 /* OB_WAVE = 21, */ | |
343 OB_LATTICE = 22, | |
344 | |
345 /* 23 and 24 are for life and sector (old file compat.) */ | |
346 OB_ARMATURE = 25, | |
347 }; | |
348 | |
349 /* check if the object type supports materials */ | |
350 #define OB_TYPE_SUPPORT_MATERIAL(_type) \ | |
351 ((_type) >= OB_MESH && (_type) <= OB_MBALL) | |
352 #define OB_TYPE_SUPPORT_VGROUP(_type) \ | |
353 (ELEM(_type, OB_MESH, OB_LATTICE)) | |
354 #define OB_TYPE_SUPPORT_EDITMODE(_type) \ | |
355 (ELEM7(_type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE,
OB_ARMATURE)) | |
356 #define OB_TYPE_SUPPORT_PARVERT(_type) \ | |
357 (ELEM4(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE)) | |
358 | |
359 /* is this ID type used as object data */ | |
360 #define OB_DATA_SUPPORT_ID(_id_type) \ | |
361 (ELEM8(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_CA, ID_LT, ID_AR
)) | |
362 | |
363 #define OB_DATA_SUPPORT_ID_CASE \ | |
364 ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_CA: case
ID_LT: case ID_AR | |
365 | |
366 /* partype: first 4 bits: type */ | |
367 enum { | |
368 PARTYPE = (1 << 4) - 1, | |
369 PAROBJECT = 0, | |
370 PARCURVE = 1, | |
371 PARKEY = 2, | |
372 | |
373 PARSKEL = 4, | |
374 PARVERT1 = 5, | |
375 PARVERT3 = 6, | |
376 PARBONE = 7, | |
377 | |
378 /* slow parenting - is not threadsafe and/or may give errors after jumpi
ng */ | |
379 PARSLOW = 16, | |
380 }; | |
381 | |
382 /* (short) transflag */ | |
383 /* flags 1 and 2 were unused or relics from past features */ | |
384 enum { | |
385 OB_NEG_SCALE = 1 << 2, | |
386 OB_DUPLIFRAMES = 1 << 3, | |
387 OB_DUPLIVERTS = 1 << 4, | |
388 OB_DUPLIROT = 1 << 5, | |
389 OB_DUPLINOSPEED = 1 << 6, | |
390 /* OB_POWERTRACK = 1 << 7,*/ /*UNUSED*/ | |
391 OB_DUPLIGROUP = 1 << 8, | |
392 OB_DUPLIFACES = 1 << 9, | |
393 OB_DUPLIFACES_SCALE = 1 << 10, | |
394 OB_DUPLIPARTS = 1 << 11, | |
395 OB_RENDER_DUPLI = 1 << 12, | |
396 OB_NO_CONSTRAINTS = 1 << 13, /* runtime constraints disable */ | |
397 OB_NO_PSYS_UPDATE = 1 << 14, /* hack to work around particle issue */ | |
398 | |
399 OB_DUPLI = OB_DUPLIFRAMES | OB_DUPLIVERTS | OB_DUPLIGROUP | O
B_DUPLIFACES | OB_DUPLIPARTS, | |
400 }; | |
401 | |
402 /* (short) ipoflag */ | |
403 /* XXX: many old flags for features removed due to incompatibility | |
404 * with new system and/or other design issues were here· | |
405 */ | |
406 /* for stride/path editing (XXX: NEEDS REVIEW) */ | |
407 #define OB_DISABLE_PATH (1 << 10) | |
408 | |
409 /* (short) trackflag / upflag */ | |
410 enum { | |
411 OB_POSX = 0, | |
412 OB_POSY = 1, | |
413 OB_POSZ = 2, | |
414 OB_NEGX = 3, | |
415 OB_NEGY = 4, | |
416 OB_NEGZ = 5, | |
417 }; | |
418 | |
419 /* gameflag in game.h */ | |
420 | |
421 /* dt: no flags */ | |
422 enum { | |
423 OB_BOUNDBOX = 1, | |
424 OB_WIRE = 2, | |
425 OB_SOLID = 3, | |
426 OB_MATERIAL = 4, | |
427 OB_TEXTURE = 5, | |
428 OB_RENDER = 6, | |
429 | |
430 OB_PAINT = 100, /* temporary used in draw code */ | |
431 }; | |
432 | |
433 /* dtx: flags (short) */ | |
434 enum { | |
435 OB_DRAWBOUNDOX = 1 << 0, | |
436 OB_AXIS = 1 << 1, | |
437 OB_TEXSPACE = 1 << 2, | |
438 OB_DRAWNAME = 1 << 3, | |
439 OB_DRAWIMAGE = 1 << 4, | |
440 /* for solid+wire display */ | |
441 OB_DRAWWIRE = 1 << 5, | |
442 /* for overdraw s*/ | |
443 OB_DRAWXRAY = 1 << 6, | |
444 /* enable transparent draw */ | |
445 OB_DRAWTRANSP = 1 << 7, | |
446 OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */ | |
447 }; | |
448 | |
449 /* empty_drawtype: no flags */ | |
450 enum { | |
451 OB_ARROWS = 1, | |
452 OB_PLAINAXES = 2, | |
453 OB_CIRCLE = 3, | |
454 OB_SINGLE_ARROW = 4, | |
455 OB_CUBE = 5, | |
456 OB_EMPTY_SPHERE = 6, | |
457 OB_EMPTY_CONE = 7, | |
458 OB_EMPTY_IMAGE = 8, | |
459 }; | |
460 | |
461 /* boundtype */ | |
462 enum { | |
463 OB_BOUND_BOX = 0, | |
464 OB_BOUND_SPHERE = 1, | |
465 OB_BOUND_CYLINDER = 2, | |
466 OB_BOUND_CONE = 3, | |
467 OB_BOUND_TRIANGLE_MESH = 4, | |
468 OB_BOUND_CONVEX_HULL = 5, | |
469 /* OB_BOUND_DYN_MESH = 6, */ /*UNUSED*/ | |
470 OB_BOUND_CAPSULE = 7, | |
471 }; | |
472 | |
473 | |
474 /* **************** BASE ********************* */ | |
475 | |
476 /* also needed for base!!!!! or rather, they interfere....*/ | |
477 /* base->flag and ob->flag */ | |
478 #define BA_WAS_SEL (1 << 1) | |
479 #define BA_HAS_RECALC_OB (1 << 2) | |
480 #define BA_HAS_RECALC_DATA (1 << 3) | |
481 | |
482 /* NOTE: this was used as a proper setting in past, so nullify before us
ing */ | |
483 #define BA_TEMP_TAG (1 << 5) | |
484 | |
485 /* #define BA_FROMSET (1 << 7) */ /*UNUSED*/ | |
486 | |
487 #define BA_TRANSFORM_CHILD (1 << 8) /* child of a transformed object */ | |
488 #define BA_TRANSFORM_PARENT (1 << 13) /* parent of a transformed object */ | |
489 | |
490 | |
491 /* an initial attempt as making selection more specific! */ | |
492 #define BA_DESELECT 0 | |
493 #define BA_SELECT 1 | |
494 | |
495 | |
496 #define OB_FROMDUPLI (1 << 9) | |
497 #define OB_DONE (1 << 10) | |
498 /* #define OB_RADIO (1 << 11) */ /* deprecated */ | |
499 #define OB_FROMGROUP (1 << 12) | |
500 | |
501 /* WARNING - when adding flags check on PSYS_RECALC */ | |
502 /* ob->recalc (flag bits!) */ | |
503 enum { | |
504 OB_RECALC_OB = 1 << 0, | |
505 OB_RECALC_DATA = 1 << 1, | |
506 /* time flag is set when time changes need recalc, so baked systems can ignore i
t */ | |
507 OB_RECALC_TIME = 1 << 2, | |
508 /* only use for matching any flag, NOT as an argument since more flags may be ad
ded. */ | |
509 OB_RECALC_ALL = OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME, | |
510 }; | |
511 | |
512 /* controller state */ | |
513 #define OB_MAX_STATES 30 | |
514 | |
515 /* collision masks */ | |
516 #define OB_MAX_COL_MASKS 8 | |
517 | |
518 /* ob->gameflag */ | |
519 enum { | |
520 OB_DYNAMIC = 1 << 0, | |
521 OB_CHILD = 1 << 1, | |
522 OB_ACTOR = 1 << 2, | |
523 OB_INERTIA_LOCK_X = 1 << 3, | |
524 OB_INERTIA_LOCK_Y = 1 << 4, | |
525 OB_INERTIA_LOCK_Z = 1 << 5, | |
526 OB_DO_FH = 1 << 6, | |
527 OB_ROT_FH = 1 << 7, | |
528 OB_ANISOTROPIC_FRICTION = 1 << 8, | |
529 OB_GHOST = 1 << 9, | |
530 OB_RIGID_BODY = 1 << 10, | |
531 OB_BOUNDS = 1 << 11, | |
532 | |
533 OB_COLLISION_RESPONSE = 1 << 12, | |
534 OB_SECTOR = 1 << 13, | |
535 OB_PROP = 1 << 14, | |
536 OB_MAINACTOR = 1 << 15, | |
537 | |
538 OB_COLLISION = 1 << 16, | |
539 OB_SOFT_BODY = 1 << 17, | |
540 OB_OCCLUDER = 1 << 18, | |
541 OB_SENSOR = 1 << 19, | |
542 OB_NAVMESH = 1 << 20, | |
543 OB_HASOBSTACLE = 1 << 21, | |
544 OB_CHARACTER = 1 << 22, | |
545 }; | |
546 | |
547 /* ob->gameflag2 */ | |
548 enum { | |
549 OB_NEVER_DO_ACTIVITY_CULLING = 1 << 0, | |
550 OB_LOCK_RIGID_BODY_X_AXIS = 1 << 2, | |
551 OB_LOCK_RIGID_BODY_Y_AXIS = 1 << 3, | |
552 OB_LOCK_RIGID_BODY_Z_AXIS = 1 << 4, | |
553 OB_LOCK_RIGID_BODY_X_ROT_AXIS = 1 << 5, | |
554 OB_LOCK_RIGID_BODY_Y_ROT_AXIS = 1 << 6, | |
555 OB_LOCK_RIGID_BODY_Z_ROT_AXIS = 1 << 7, | |
556 | |
557 /* OB_LIFE = OB_PROP | OB_DYNAMIC | OB_ACTOR | OB_MAINACTOR | OB_CHILD,
*/ | |
558 }; | |
559 | |
560 /* ob->body_type */ | |
561 enum { | |
562 OB_BODY_TYPE_NO_COLLISION = 0, | |
563 OB_BODY_TYPE_STATIC = 1, | |
564 OB_BODY_TYPE_DYNAMIC = 2, | |
565 OB_BODY_TYPE_RIGID = 3, | |
566 OB_BODY_TYPE_SOFT = 4, | |
567 OB_BODY_TYPE_OCCLUDER = 5, | |
568 OB_BODY_TYPE_SENSOR = 6, | |
569 OB_BODY_TYPE_NAVMESH = 7, | |
570 OB_BODY_TYPE_CHARACTER = 8, | |
571 }; | |
572 | |
573 /* ob->depsflag */ | |
574 enum { | |
575 OB_DEPS_EXTRA_OB_RECALC = 1 << 0, | |
576 OB_DEPS_EXTRA_DATA_RECALC = 1 << 1, | |
577 }; | |
578 | |
579 /* ob->scavisflag */ | |
580 enum { | |
581 OB_VIS_SENS = 1 << 0, | |
582 OB_VIS_CONT = 1 << 1, | |
583 OB_VIS_ACT = 1 << 2, | |
584 }; | |
585 | |
586 /* ob->scaflag */ | |
587 enum { | |
588 OB_SHOWSENS = 1 << 6, | |
589 OB_SHOWACT = 1 << 7, | |
590 OB_ADDSENS = 1 << 8, | |
591 OB_ADDCONT = 1 << 9, | |
592 OB_ADDACT = 1 << 10, | |
593 OB_SHOWCONT = 1 << 11, | |
594 OB_ALLSTATE = 1 << 12, | |
595 OB_INITSTBIT = 1 << 13, | |
596 OB_DEBUGSTATE = 1 << 14, | |
597 OB_SHOWSTATE = 1 << 15, | |
598 }; | |
599 | |
600 /* ob->restrictflag */ | |
601 enum { | |
602 OB_RESTRICT_VIEW = 1 << 0, | |
603 OB_RESTRICT_SELECT = 1 << 1, | |
604 OB_RESTRICT_RENDER = 1 << 2, | |
605 }; | |
606 | |
607 /* ob->shapeflag */ | |
608 enum { | |
609 OB_SHAPE_LOCK = 1 << 0, | |
610 OB_SHAPE_TEMPLOCK = 1 << 1, /* deprecated */ | |
611 OB_SHAPE_EDIT_MODE = 1 << 2, | |
612 }; | |
613 | |
614 /* ob->nlaflag */ | |
615 enum { | |
616 /* WARNING: flags (1 << 0) and (1 << 1) were from old animsys */ | |
617 /* object-channel expanded status */ | |
618 OB_ADS_COLLAPSED = 1 << 10, | |
619 /* object's ipo-block */ | |
620 OB_ADS_SHOWIPO = 1 << 11, | |
621 /* object's constraint channels */ | |
622 OB_ADS_SHOWCONS = 1 << 12, | |
623 /* object's material channels */ | |
624 OB_ADS_SHOWMATS = 1 << 13, | |
625 /* object's marticle channels */ | |
626 OB_ADS_SHOWPARTS = 1 << 14, | |
627 }; | |
628 | |
629 /* ob->protectflag */ | |
630 enum { | |
631 OB_LOCK_LOCX = 1 << 0, | |
632 OB_LOCK_LOCY = 1 << 1, | |
633 OB_LOCK_LOCZ = 1 << 2, | |
634 OB_LOCK_LOC = OB_LOCK_LOCX | OB_LOCK_LOCY | OB_LOCK_LOCZ, | |
635 OB_LOCK_ROTX = 1 << 3, | |
636 OB_LOCK_ROTY = 1 << 4, | |
637 OB_LOCK_ROTZ = 1 << 5, | |
638 OB_LOCK_ROT = OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ, | |
639 OB_LOCK_SCALEX = 1 << 6, | |
640 OB_LOCK_SCALEY = 1 << 7, | |
641 OB_LOCK_SCALEZ = 1 << 8, | |
642 OB_LOCK_SCALE = OB_LOCK_SCALEX | OB_LOCK_SCALEY | OB_LOCK_SCALEZ, | |
643 OB_LOCK_ROTW = 1 << 9, | |
644 OB_LOCK_ROT4D = 1 << 10, | |
645 }; | |
646 | |
647 /* ob->mode */ | |
648 typedef enum ObjectMode { | |
649 OB_MODE_OBJECT = 0, | |
650 OB_MODE_EDIT = 1 << 0, | |
651 OB_MODE_SCULPT = 1 << 1, | |
652 OB_MODE_VERTEX_PAINT = 1 << 2, | |
653 OB_MODE_WEIGHT_PAINT = 1 << 3, | |
654 OB_MODE_TEXTURE_PAINT = 1 << 4, | |
655 OB_MODE_PARTICLE_EDIT = 1 << 5, | |
656 OB_MODE_POSE = 1 << 6, | |
657 } ObjectMode; | |
658 | |
659 /* any mode where the brush system is used */ | |
660 #define OB_MODE_ALL_PAINT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGH
T_PAINT | OB_MODE_TEXTURE_PAINT) | |
661 | |
662 #define MAX_DUPLI_RECUR 8 | |
663 | |
664 #ifdef __cplusplus | |
665 } | |
666 #endif | |
667 | |
668 #endif | |
669 | |
LEFT | RIGHT |