Blender V2.61 - r43446

DNA_ipo_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): Joshua Leung
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027  
00036 #ifndef DNA_IPO_TYPES_H
00037 #define DNA_IPO_TYPES_H
00038 
00039 #include "DNA_listBase.h"
00040 #include "DNA_curve_types.h"
00041 #include "DNA_vec_types.h"
00042 
00043 #include "DNA_ID.h"
00044 
00045 /* -------------------------- Type Defines --------------------------- */
00046 
00047 /* sometimes used - mainly for GE/Ketsji */
00048 typedef short IPO_Channel;  
00049 
00050 
00051 /* --- IPO Curve Driver --- */
00052 
00053 /* IPO Curve Driver */
00054 typedef struct IpoDriver {
00055     struct Object *ob;          /* target/driver ob */
00056     short blocktype, adrcode;   /* sub-channel to use */
00057     
00058     short type, flag;           /* driver settings */
00059     char name[128];             /* bone, or python expression here */
00060 } IpoDriver;
00061 
00062 /* --- IPO Curve --- */
00063 
00064 /* IPO Curve */
00065 typedef struct IpoCurve {
00066     struct IpoCurve *next,  *prev;
00067     
00068     struct BPoint *bp;                  /* array of BPoints (sizeof(BPoint)*totvert) - i.e. baked/imported data */
00069     struct BezTriple *bezt;             /* array of BezTriples (sizeof(BezTriple)*totvert)  - i.e. user-editable keyframes  */
00070 
00071     rctf maxrct, totrct;                /* bounding boxes */
00072 
00073     short blocktype, adrcode, vartype;  /* blocktype= ipo-blocktype; adrcode= type of ipo-curve; vartype= 'format' of data */
00074     short totvert;                      /* total number of BezTriples (i.e. keyframes) on curve */
00075     short ipo, extrap;                  /* interpolation and extrapolation modes  */
00076     short flag, rt;                     /* flag= settings; rt= ??? */
00077     float ymin, ymax;                   /* minimum/maximum y-extents for curve */
00078     unsigned int bitmask;               /* ??? */
00079     
00080     float slide_min, slide_max;         /* minimum/maximum values for sliders (in action editor) */
00081     float curval;                       /* value of ipo-curve for current frame */
00082     
00083     IpoDriver *driver;                  /* pointer to ipo-driver for this curve */
00084 } IpoCurve;
00085 
00086 /* --- ID-Datablock --- */
00087 
00088 /* IPO Data-Block */
00089 typedef struct Ipo {
00090     ID id;
00091     
00092     ListBase curve;             /* A list of IpoCurve structs in a linked list. */
00093     rctf cur;                   /* Rect defining extents of keyframes? */
00094     
00095     short blocktype, showkey;   /* blocktype: self-explanatory; showkey: either 0 or 1 (show vertical yellow lines for editing) */
00096     short muteipo, pad;         /* muteipo: either 0 or 1 (whether ipo block is muted) */   
00097 } Ipo;
00098 
00099 /* ----------- adrcodes (for matching ipo-curves to data) ------------- */
00100 
00101 /* defines: are these duped or new? */
00102 #define IPOBUTY 17
00103 
00104 #define TOB_IPO 1
00105 #define TOB_IPODROT 2
00106 
00107 /* disptype */
00108 #define IPO_DISPDEGR    1
00109 #define IPO_DISPBITS    2
00110 #define IPO_DISPTIME    3
00111 
00112 /* ********** Object (ID_OB) ********** */
00113 
00114 #define OB_TOTIPO   30
00115 #define OB_TOTNAM   30
00116 
00117 #define OB_LOC_X    1
00118 #define OB_LOC_Y    2
00119 #define OB_LOC_Z    3
00120 #define OB_DLOC_X   4
00121 #define OB_DLOC_Y   5
00122 #define OB_DLOC_Z   6
00123 
00124 #define OB_ROT_X    7
00125 #define OB_ROT_Y    8
00126 #define OB_ROT_Z    9
00127 #define OB_DROT_X   10
00128 #define OB_DROT_Y   11
00129 #define OB_DROT_Z   12
00130 
00131 #define OB_SIZE_X   13
00132 #define OB_SIZE_Y   14
00133 #define OB_SIZE_Z   15
00134 #define OB_DSIZE_X  16
00135 #define OB_DSIZE_Y  17
00136 #define OB_DSIZE_Z  18
00137 
00138 #define OB_LAY      19
00139 
00140 #define OB_TIME     20
00141 
00142 #define OB_COL_R    21
00143 #define OB_COL_G    22
00144 #define OB_COL_B    23
00145 #define OB_COL_A    24
00146 
00147 #define OB_PD_FSTR  25
00148 #define OB_PD_FFALL 26
00149 #define OB_PD_SDAMP 27
00150 #define OB_PD_RDAMP 28
00151 #define OB_PD_PERM  29
00152 #define OB_PD_FMAXD 30
00153 
00154 /* exception: driver channel, for bone driver only */
00155 #define OB_ROT_DIFF 100
00156 
00157 
00158 /* ********** Material (ID_MA) ********** */
00159 
00160 #define MA_TOTIPO   40
00161 #define MA_TOTNAM   26
00162 
00163 #define MA_COL_R    1
00164 #define MA_COL_G    2
00165 #define MA_COL_B    3
00166 #define MA_SPEC_R   4
00167 #define MA_SPEC_G   5
00168 #define MA_SPEC_B   6
00169 #define MA_MIR_R    7
00170 #define MA_MIR_G    8
00171 #define MA_MIR_B    9
00172 #define MA_REF      10
00173 #define MA_ALPHA    11
00174 #define MA_EMIT     12
00175 #define MA_AMB      13
00176 #define MA_SPEC     14
00177 #define MA_HARD     15
00178 #define MA_SPTR     16
00179 #define MA_IOR      17
00180 #define MA_MODE     18
00181 #define MA_HASIZE   19
00182 #define MA_TRANSLU  20
00183 #define MA_RAYM     21
00184 #define MA_FRESMIR  22
00185 #define MA_FRESMIRI 23
00186 #define MA_FRESTRA  24
00187 #define MA_FRESTRAI 25
00188 #define MA_ADD      26
00189 
00190 #define MA_MAP1     (1<<5)
00191 #define MA_MAP2     (1<<6)
00192 #define MA_MAP3     (1<<7)
00193 #define MA_MAP4     (1<<8)
00194 #define MA_MAP5     (1<<9)
00195 #define MA_MAP6     (1<<10)
00196 #define MA_MAP7     (1<<11)
00197 #define MA_MAP8     (1<<12)
00198 #define MA_MAP9     (1<<13)
00199 #define MA_MAP10    (1<<14)
00200 #define MA_MAP11    (1<<15)
00201 #define MA_MAP12    (1<<16)
00202 #define MA_MAP13    (1<<17)
00203 #define MA_MAP14    (1<<18)
00204 #define MA_MAP15    (1<<19)
00205 #define MA_MAP16    (1<<20)
00206 #define MA_MAP17    (1<<21)
00207 #define MA_MAP18    (1<<22)
00208 
00209 /* ********** Texture Slots (MTex) ********** */
00210 
00211 #define TEX_TOTNAM  14
00212 
00213 #define MAP_OFS_X   1
00214 #define MAP_OFS_Y   2
00215 #define MAP_OFS_Z   3
00216 #define MAP_SIZE_X  4
00217 #define MAP_SIZE_Y  5
00218 #define MAP_SIZE_Z  6
00219 #define MAP_R       7
00220 #define MAP_G       8
00221 #define MAP_B       9
00222 
00223 #define MAP_DVAR    10
00224 #define MAP_COLF    11
00225 #define MAP_NORF    12
00226 #define MAP_VARF    13
00227 #define MAP_DISP    14
00228 
00229 /* ********** Texture (ID_TE) ********** */
00230 
00231 #define TE_TOTIPO   26
00232 #define TE_TOTNAM   26
00233 
00234 #define TE_NSIZE    1
00235 #define TE_NDEPTH   2
00236 #define TE_NTYPE    3
00237 #define TE_TURB     4
00238 
00239 #define TE_VNW1     5
00240 #define TE_VNW2     6
00241 #define TE_VNW3     7
00242 #define TE_VNW4     8
00243 #define TE_VNMEXP   9
00244 #define TE_VN_DISTM 10
00245 #define TE_VN_COLT  11
00246 
00247 #define TE_ISCA     12
00248 #define TE_DISTA    13
00249 
00250 #define TE_MG_TYP   14
00251 #define TE_MGH      15
00252 #define TE_MG_LAC   16
00253 #define TE_MG_OCT   17
00254 #define TE_MG_OFF   18
00255 #define TE_MG_GAIN  19
00256 
00257 #define TE_N_BAS1   20
00258 #define TE_N_BAS2   21
00259 
00260 #define TE_COL_R    22
00261 #define TE_COL_G    23
00262 #define TE_COL_B    24
00263 #define TE_BRIGHT   25
00264 #define TE_CONTRA   26
00265 
00266 /* ******** Sequence (ID_SEQ) ********** */
00267 
00268 #define SEQ_TOTIPO  1
00269 #define SEQ_TOTNAM  1
00270 
00271 #define SEQ_FAC1    1
00272 #define SEQ_FAC_SPEED   2
00273 #define SEQ_FAC_OPACITY 3
00274 
00275 /* ********* Curve (ID_CU) *********** */
00276 
00277 #define CU_TOTIPO   1
00278 #define CU_TOTNAM   1
00279 
00280 #define CU_SPEED    1
00281 
00282 /* ********* ShapeKey (ID_KE) *********** */
00283 
00284 #define KEY_TOTIPO  64
00285 #define KEY_TOTNAM  64
00286 
00287 #define KEY_SPEED   0
00288 #define KEY_NR      1
00289 
00290 /* ********* World (ID_WO) *********** */
00291 
00292 #define WO_TOTIPO   29
00293 #define WO_TOTNAM   16
00294 
00295 #define WO_HOR_R    1
00296 #define WO_HOR_G    2
00297 #define WO_HOR_B    3
00298 #define WO_ZEN_R    4
00299 #define WO_ZEN_G    5
00300 #define WO_ZEN_B    6
00301 
00302 #define WO_EXPOS    7
00303 
00304 #define WO_MISI     8
00305 #define WO_MISTDI   9
00306 #define WO_MISTSTA  10
00307 #define WO_MISTHI   11
00308 
00309 #define WO_STAR_R   12
00310 #define WO_STAR_G   13
00311 #define WO_STAR_B   14
00312 #define WO_STARDIST 15
00313 #define WO_STARSIZE 16
00314 
00315 /* ********** Lamp (ID_LA) ********** */
00316 
00317 #define LA_TOTIPO   21
00318 #define LA_TOTNAM   10
00319 
00320 #define LA_ENERGY   1
00321 #define LA_COL_R    2
00322 #define LA_COL_G    3
00323 #define LA_COL_B    4
00324 #define LA_DIST     5
00325 #define LA_SPOTSI   6
00326 #define LA_SPOTBL   7
00327 #define LA_QUAD1    8
00328 #define LA_QUAD2    9
00329 #define LA_HALOINT  10
00330 
00331 /* ********* Camera (ID_CA) ************ */
00332 
00333 #define CAM_TOTIPO  7
00334 #define CAM_TOTNAM  7
00335 
00336 #define CAM_LENS    1
00337 #define CAM_STA     2
00338 #define CAM_END     3
00339 
00340 /* yafray aperture & focal distance curves */
00341 #define CAM_YF_APERT    4
00342 #define CAM_YF_FDIST    5
00343 
00344 #define CAM_SHIFT_X     6
00345 #define CAM_SHIFT_Y     7
00346 
00347 /* ********* Sound (ID_SO) *********** */
00348 
00349 #define SND_TOTIPO  4
00350 #define SND_TOTNAM  4
00351 
00352 #define SND_VOLUME  1
00353 #define SND_PITCH   2
00354 #define SND_PANNING 3
00355 #define SND_ATTEN   4
00356 
00357 /* ******* PoseChannel (ID_PO) ********* */
00358 
00359 #define AC_TOTIPO   13
00360 #define AC_TOTNAM   13
00361 
00362 #define AC_LOC_X    1
00363 #define AC_LOC_Y    2
00364 #define AC_LOC_Z    3
00365 
00366 #define AC_SIZE_X   13
00367 #define AC_SIZE_Y   14
00368 #define AC_SIZE_Z   15
00369 
00370 #define AC_EUL_X    16
00371 #define AC_EUL_Y    17
00372 #define AC_EUL_Z    18
00373 
00374 #define AC_QUAT_W   25
00375 #define AC_QUAT_X   26
00376 #define AC_QUAT_Y   27
00377 #define AC_QUAT_Z   28
00378 
00379 /* ******** Constraint (ID_CO) ********** */
00380 
00381 #define CO_TOTIPO   2
00382 #define CO_TOTNAM   2
00383 
00384 #define CO_ENFORCE  1
00385 #define CO_HEADTAIL 2
00386 
00387 /* ****** FluidSim (ID_FLUIDSIM) ****** */
00388 
00389 #define FLUIDSIM_TOTIPO 13
00390 #define FLUIDSIM_TOTNAM 13
00391 
00392 #define FLUIDSIM_VISC   1
00393 #define FLUIDSIM_TIME   2
00394 
00395 #define FLUIDSIM_GRAV_X 3
00396 #define FLUIDSIM_GRAV_Y 4
00397 #define FLUIDSIM_GRAV_Z 5
00398 
00399 #define FLUIDSIM_VEL_X  6
00400 #define FLUIDSIM_VEL_Y  7
00401 #define FLUIDSIM_VEL_Z  8
00402 
00403 #define FLUIDSIM_ACTIVE 9
00404 
00405 #define FLUIDSIM_ATTR_FORCE_STR     10
00406 #define FLUIDSIM_ATTR_FORCE_RADIUS  11
00407 #define FLUIDSIM_VEL_FORCE_STR      12
00408 #define FLUIDSIM_VEL_FORCE_RADIUS   13
00409 
00410 /* ******************** */
00411 /* particle ipos */
00412 
00413 /* ******* Particle (ID_PA) ******** */
00414 #define PART_TOTIPO     25
00415 #define PART_TOTNAM     25
00416 
00417 #define PART_EMIT_FREQ  1
00418 /* #define PART_EMIT_LIFE   2 */ /*UNUSED*/
00419 #define PART_EMIT_VEL   3
00420 #define PART_EMIT_AVE   4
00421 /* #define PART_EMIT_SIZE   5 */ /*UNUSED*/
00422 
00423 #define PART_AVE        6
00424 #define PART_SIZE       7
00425 #define PART_DRAG       8
00426 #define PART_BROWN      9
00427 #define PART_DAMP       10
00428 #define PART_LENGTH     11
00429 #define PART_CLUMP      12
00430 
00431 #define PART_GRAV_X     13
00432 #define PART_GRAV_Y     14
00433 #define PART_GRAV_Z     15
00434 
00435 #define PART_KINK_AMP   16
00436 #define PART_KINK_FREQ  17
00437 #define PART_KINK_SHAPE 18
00438 
00439 #define PART_BB_TILT    19
00440 
00441 #define PART_PD_FSTR    20
00442 #define PART_PD_FFALL   21
00443 #define PART_PD_FMAXD   22
00444 
00445 #define PART_PD2_FSTR   23
00446 #define PART_PD2_FFALL  24
00447 #define PART_PD2_FMAXD  25
00448 
00449 
00450 /* -------------------- Defines: Flags and Types ------------------ */
00451 
00452 /* ----- IPO Curve Defines ------- */
00453 
00454 /* icu->vartype */
00455 #define IPO_CHAR        0
00456 #define IPO_SHORT       1
00457 #define IPO_INT         2
00458 #define IPO_LONG        3
00459 #define IPO_FLOAT       4
00460 #define IPO_DOUBLE      5
00461 #define IPO_FLOAT_DEGR  6
00462 
00463     /* very special case, in keys */
00464 #define IPO_BEZTRIPLE   100
00465 #define IPO_BPOINT      101
00466 
00467 /* icu->vartype */
00468 #define IPO_BITS        16
00469 #define IPO_CHAR_BIT    16
00470 #define IPO_SHORT_BIT   17
00471 #define IPO_INT_BIT     18
00472 
00473 /* icu->ipo:  the type of curve */
00474 #define IPO_CONST       0
00475 #define IPO_LIN         1
00476 #define IPO_BEZ         2
00477     /* not used yet */
00478 #define IPO_MIXED       3 
00479 
00480 /* icu->extrap */
00481 #define IPO_HORIZ       0
00482 #define IPO_DIR         1
00483 #define IPO_CYCL        2
00484 #define IPO_CYCLX       3
00485 
00486 /* icu->flag */
00487 #define IPO_VISIBLE     1
00488 #define IPO_SELECT      2
00489 #define IPO_EDIT        4
00490 #define IPO_LOCK        8
00491 #define IPO_AUTO_HORIZ  16
00492 #define IPO_ACTIVE      32
00493 #define IPO_PROTECT     64
00494 #define IPO_MUTE        128
00495 
00496 /* ---------- IPO Drivers ----------- */
00497 
00498 /* offset in driver->name for finding second posechannel for rot-diff  */
00499 #define DRIVER_NAME_OFFS    32 
00500 
00501 /* driver->type */
00502 #define IPO_DRIVER_TYPE_NORMAL      0
00503 #define IPO_DRIVER_TYPE_PYTHON      1
00504 
00505 /* driver->flag */
00506     /* invalid flag: currently only used for buggy pydriver expressions */
00507 #define IPO_DRIVER_FLAG_INVALID     (1<<0)
00508 
00509 #endif
00510 
00511 
00512