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