Blender  V2.93
DNA_ipo_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
29 #pragma once
30 
31 #include "DNA_curve_types.h"
32 #include "DNA_listBase.h"
33 #include "DNA_vec_types.h"
34 
35 #include "DNA_ID.h"
36 
37 #include "BLI_compiler_attrs.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /* -------------------------- Type Defines --------------------------- */
44 
45 /* --- IPO Curve Driver --- */
46 
47 /* IPO Curve Driver */
48 typedef struct IpoDriver {
50  struct Object *ob;
53 
55  short type, flag;
57  char name[128];
59 
60 /* --- IPO Curve --- */
61 
62 /* IPO Curve */
63 typedef struct IpoCurve {
64  struct IpoCurve *next, *prev;
65 
67  struct BPoint *bp;
69  struct BezTriple *bezt;
70 
73 
77  short totvert;
79  short ipo, extrap;
81  short flag, rt;
83  float ymin, ymax;
85  unsigned int bitmask;
86 
90  float curval;
91 
95 
96 /* --- ID-Datablock --- */
97 
98 /* IPO Data-Block */
99 typedef struct Ipo {
101 
106 
111  short muteipo;
112  char _pad[2];
113 } Ipo;
114 
115 /* ----------- adrcodes (for matching ipo-curves to data) ------------- */
116 
117 /* defines: are these duped or new? */
118 #define IPOBUTY 17
119 
120 #define TOB_IPO 1
121 #define TOB_IPODROT 2
122 
123 /* disptype */
124 #define IPO_DISPDEGR 1
125 #define IPO_DISPBITS 2
126 #define IPO_DISPTIME 3
127 
128 /* ********** Object (ID_OB) ********** */
129 
130 #define OB_TOTIPO 30
131 #define OB_TOTNAM 30
132 
133 #define OB_LOC_X 1
134 #define OB_LOC_Y 2
135 #define OB_LOC_Z 3
136 #define OB_DLOC_X 4
137 #define OB_DLOC_Y 5
138 #define OB_DLOC_Z 6
139 
140 #define OB_ROT_X 7
141 #define OB_ROT_Y 8
142 #define OB_ROT_Z 9
143 #define OB_DROT_X 10
144 #define OB_DROT_Y 11
145 #define OB_DROT_Z 12
146 
147 #define OB_SIZE_X 13
148 #define OB_SIZE_Y 14
149 #define OB_SIZE_Z 15
150 #define OB_DSIZE_X 16
151 #define OB_DSIZE_Y 17
152 #define OB_DSIZE_Z 18
153 
154 #define OB_LAY 19
155 
156 #define OB_TIME 20
157 
158 #define OB_COL_R 21
159 #define OB_COL_G 22
160 #define OB_COL_B 23
161 #define OB_COL_A 24
162 
163 #define OB_PD_FSTR 25
164 #define OB_PD_FFALL 26
165 #define OB_PD_SDAMP 27
166 #define OB_PD_RDAMP 28
167 #define OB_PD_PERM 29
168 #define OB_PD_FMAXD 30
169 
170 /* exception: driver channel, for bone driver only */
171 #define OB_ROT_DIFF 100
172 
173 /* ********** Material (ID_MA) ********** */
174 
175 #define MA_TOTIPO 40
176 #define MA_TOTNAM 26
177 
178 #define MA_COL_R 1
179 #define MA_COL_G 2
180 #define MA_COL_B 3
181 #define MA_SPEC_R 4
182 #define MA_SPEC_G 5
183 #define MA_SPEC_B 6
184 #define MA_MIR_R 7
185 #define MA_MIR_G 8
186 #define MA_MIR_B 9
187 #define MA_REF 10
188 #define MA_ALPHA 11
189 #define MA_EMIT 12
190 #define MA_AMB 13
191 #define MA_SPEC 14
192 #define MA_HARD 15
193 #define MA_SPTR 16
194 #define MA_IOR 17
195 #define MA_MODE 18
196 #define MA_HASIZE 19
197 #define MA_TRANSLU 20
198 #define MA_RAYM 21
199 #define MA_FRESMIR 22
200 #define MA_FRESMIRI 23
201 #define MA_FRESTRA 24
202 #define MA_FRESTRAI 25
203 #define MA_ADD 26
204 
205 #define MA_MAP1 (1 << 5)
206 #define MA_MAP2 (1 << 6)
207 #define MA_MAP3 (1 << 7)
208 #define MA_MAP4 (1 << 8)
209 #define MA_MAP5 (1 << 9)
210 #define MA_MAP6 (1 << 10)
211 #define MA_MAP7 (1 << 11)
212 #define MA_MAP8 (1 << 12)
213 #define MA_MAP9 (1 << 13)
214 #define MA_MAP10 (1 << 14)
215 #define MA_MAP11 (1 << 15)
216 #define MA_MAP12 (1 << 16)
217 #define MA_MAP13 (1 << 17)
218 #define MA_MAP14 (1 << 18)
219 #define MA_MAP15 (1 << 19)
220 #define MA_MAP16 (1 << 20)
221 #define MA_MAP17 (1 << 21)
222 #define MA_MAP18 (1 << 22)
223 
224 /* ********** Texture Slots (MTex) ********** */
225 
226 #define TEX_TOTNAM 14
227 
228 #define MAP_OFS_X 1
229 #define MAP_OFS_Y 2
230 #define MAP_OFS_Z 3
231 #define MAP_SIZE_X 4
232 #define MAP_SIZE_Y 5
233 #define MAP_SIZE_Z 6
234 #define MAP_R 7
235 #define MAP_G 8
236 #define MAP_B 9
237 
238 #define MAP_DVAR 10
239 #define MAP_COLF 11
240 #define MAP_NORF 12
241 #define MAP_VARF 13
242 #define MAP_DISP 14
243 
244 /* ********** Texture (ID_TE) ********** */
245 
246 #define TE_TOTIPO 26
247 #define TE_TOTNAM 26
248 
249 #define TE_NSIZE 1
250 #define TE_NDEPTH 2
251 #define TE_NTYPE 3
252 #define TE_TURB 4
253 
254 #define TE_VNW1 5
255 #define TE_VNW2 6
256 #define TE_VNW3 7
257 #define TE_VNW4 8
258 #define TE_VNMEXP 9
259 #define TE_VN_DISTM 10
260 #define TE_VN_COLT 11
261 
262 #define TE_ISCA 12
263 #define TE_DISTA 13
264 
265 #define TE_MG_TYP 14
266 #define TE_MGH 15
267 #define TE_MG_LAC 16
268 #define TE_MG_OCT 17
269 #define TE_MG_OFF 18
270 #define TE_MG_GAIN 19
271 
272 #define TE_N_BAS1 20
273 #define TE_N_BAS2 21
274 
275 #define TE_COL_R 22
276 #define TE_COL_G 23
277 #define TE_COL_B 24
278 #define TE_BRIGHT 25
279 #define TE_CONTRA 26
280 
281 /* ******** Sequence (ID_SEQ) ********** */
282 
283 #define SEQ_TOTIPO 1
284 #define SEQ_TOTNAM 1
285 
286 #define SEQ_FAC1 1
287 #define SEQ_FAC_SPEED 2
288 #define SEQ_FAC_OPACITY 3
289 
290 /* ********* Curve (ID_CU) *********** */
291 
292 #define CU_TOTIPO 1
293 #define CU_TOTNAM 1
294 
295 #define CU_SPEED 1
296 
297 /* ********* ShapeKey (ID_KE) *********** */
298 
299 #define KEY_TOTIPO 64
300 #define KEY_TOTNAM 64
301 
302 #define KEY_SPEED 0
303 #define KEY_NR 1
304 
305 /* ********* World (ID_WO) *********** */
306 
307 #define WO_TOTIPO 29
308 #define WO_TOTNAM 16
309 
310 #define WO_HOR_R 1
311 #define WO_HOR_G 2
312 #define WO_HOR_B 3
313 #define WO_ZEN_R 4
314 #define WO_ZEN_G 5
315 #define WO_ZEN_B 6
316 
317 #define WO_EXPOS 7
318 
319 #define WO_MISI 8
320 #define WO_MISTDI 9
321 #define WO_MISTSTA 10
322 #define WO_MISTHI 11
323 
324 /* Stars are deprecated */
325 #define WO_STAR_R 12
326 #define WO_STAR_G 13
327 #define WO_STAR_B 14
328 #define WO_STARDIST 15
329 #define WO_STARSIZE 16
330 
331 /* ********** Light (ID_LA) ********** */
332 
333 #define LA_TOTIPO 21
334 #define LA_TOTNAM 10
335 
336 #define LA_ENERGY 1
337 #define LA_COL_R 2
338 #define LA_COL_G 3
339 #define LA_COL_B 4
340 #define LA_DIST 5
341 #define LA_SPOTSI 6
342 #define LA_SPOTBL 7
343 #define LA_QUAD1 8
344 #define LA_QUAD2 9
345 #define LA_HALOINT 10
346 
347 /* ********* Camera (ID_CA) ************ */
348 
349 #define CAM_TOTIPO 7
350 #define CAM_TOTNAM 7
351 
352 #define CAM_LENS 1
353 #define CAM_STA 2
354 #define CAM_END 3
355 
356 /* yafray aperture & focal distance curves */
357 #define CAM_YF_APERT 4
358 #define CAM_YF_FDIST 5
359 
360 #define CAM_SHIFT_X 6
361 #define CAM_SHIFT_Y 7
362 
363 /* ********* Sound (ID_SO) *********** */
364 
365 #define SND_TOTIPO 4
366 #define SND_TOTNAM 4
367 
368 #define SND_VOLUME 1
369 #define SND_PITCH 2
370 #define SND_PANNING 3
371 #define SND_ATTEN 4
372 
373 /* ******* PoseChannel (ID_PO) ********* */
374 
375 #define AC_TOTIPO 13
376 #define AC_TOTNAM 13
377 
378 #define AC_LOC_X 1
379 #define AC_LOC_Y 2
380 #define AC_LOC_Z 3
381 
382 #define AC_SIZE_X 13
383 #define AC_SIZE_Y 14
384 #define AC_SIZE_Z 15
385 
386 #define AC_EUL_X 16
387 #define AC_EUL_Y 17
388 #define AC_EUL_Z 18
389 
390 #define AC_QUAT_W 25
391 #define AC_QUAT_X 26
392 #define AC_QUAT_Y 27
393 #define AC_QUAT_Z 28
394 
395 /* ******** Constraint (ID_CO) ********** */
396 
397 #define CO_TOTIPO 2
398 #define CO_TOTNAM 2
399 
400 #define CO_ENFORCE 1
401 #define CO_HEADTAIL 2
402 
403 /* ****** FluidSim (ID_FLUIDSIM) ****** */
404 
405 #define FLUIDSIM_TOTIPO 13
406 #define FLUIDSIM_TOTNAM 13
407 
408 #define FLUIDSIM_VISC 1
409 #define FLUIDSIM_TIME 2
410 
411 #define FLUIDSIM_GRAV_X 3
412 #define FLUIDSIM_GRAV_Y 4
413 #define FLUIDSIM_GRAV_Z 5
414 
415 #define FLUIDSIM_VEL_X 6
416 #define FLUIDSIM_VEL_Y 7
417 #define FLUIDSIM_VEL_Z 8
418 
419 #define FLUIDSIM_ACTIVE 9
420 
421 #define FLUIDSIM_ATTR_FORCE_STR 10
422 #define FLUIDSIM_ATTR_FORCE_RADIUS 11
423 #define FLUIDSIM_VEL_FORCE_STR 12
424 #define FLUIDSIM_VEL_FORCE_RADIUS 13
425 
426 /* ******************** */
427 /* particle ipos */
428 
429 /* ******* Particle (ID_PA) ******** */
430 #define PART_TOTIPO 25
431 #define PART_TOTNAM 25
432 
433 #define PART_EMIT_FREQ 1
434 /* #define PART_EMIT_LIFE 2 */ /*UNUSED*/
435 #define PART_EMIT_VEL 3
436 #define PART_EMIT_AVE 4
437 /* #define PART_EMIT_SIZE 5 */ /*UNUSED*/
438 
439 #define PART_AVE 6
440 #define PART_SIZE 7
441 #define PART_DRAG 8
442 #define PART_BROWN 9
443 #define PART_DAMP 10
444 #define PART_LENGTH 11
445 #define PART_CLUMP 12
446 
447 #define PART_GRAV_X 13
448 #define PART_GRAV_Y 14
449 #define PART_GRAV_Z 15
450 
451 #define PART_KINK_AMP 16
452 #define PART_KINK_FREQ 17
453 #define PART_KINK_SHAPE 18
454 
455 #define PART_BB_TILT 19
456 
457 #define PART_PD_FSTR 20
458 #define PART_PD_FFALL 21
459 #define PART_PD_FMAXD 22
460 
461 #define PART_PD2_FSTR 23
462 #define PART_PD2_FFALL 24
463 #define PART_PD2_FMAXD 25
464 
465 /* -------------------- Defines: Flags and Types ------------------ */
466 
467 /* ----- IPO Curve Defines ------- */
468 
469 /* icu->vartype */
470 #define IPO_CHAR 0
471 #define IPO_SHORT 1
472 #define IPO_INT 2
473 #define IPO_LONG 3
474 #define IPO_FLOAT 4
475 #define IPO_DOUBLE 5
476 #define IPO_FLOAT_DEGR 6
477 
478 /* very special case, in keys */
479 #define IPO_BEZTRIPLE 100
480 #define IPO_BPOINT 101
481 
482 /* icu->vartype */
483 #define IPO_BITS 16
484 #define IPO_CHAR_BIT 16
485 #define IPO_SHORT_BIT 17
486 #define IPO_INT_BIT 18
487 
488 /* icu->ipo: the type of curve */
489 #define IPO_CONST 0
490 #define IPO_LIN 1
491 #define IPO_BEZ 2
492 /* not used yet */
493 #define IPO_MIXED 3
494 
495 /* icu->extrap */
496 #define IPO_HORIZ 0
497 #define IPO_DIR 1
498 #define IPO_CYCL 2
499 #define IPO_CYCLX 3
500 
501 /* icu->flag */
502 #define IPO_VISIBLE 1
503 #define IPO_SELECT 2
504 #define IPO_EDIT 4
505 #define IPO_LOCK 8
506 #define IPO_AUTO_HORIZ 16
507 #define IPO_ACTIVE 32
508 #define IPO_PROTECT 64
509 #define IPO_MUTE 128
510 
511 /* ---------- IPO Drivers ----------- */
512 
513 /* offset in driver->name for finding second posechannel for rot-diff */
514 #define DRIVER_NAME_OFFS 32
515 
516 /* driver->type */
517 #define IPO_DRIVER_TYPE_NORMAL 0
518 #define IPO_DRIVER_TYPE_PYTHON 1
519 
520 /* driver->flag */
521 /* invalid flag: currently only used for buggy pydriver expressions */
522 #define IPO_DRIVER_FLAG_INVALID (1 << 0)
523 
524 #ifdef __cplusplus
525 }
526 #endif
ID and Library types, which are fundamental for sdna.
struct IpoDriver IpoDriver
struct IpoCurve IpoCurve
struct Ipo Ipo
These structs are the foundation for all linked lists in the library system.
Definition: DNA_ID.h:273
rctf maxrct
Definition: DNA_ipo_types.h:72
struct IpoCurve * prev
Definition: DNA_ipo_types.h:64
struct BezTriple * bezt
Definition: DNA_ipo_types.h:69
unsigned int bitmask
Definition: DNA_ipo_types.h:85
float ymax
Definition: DNA_ipo_types.h:83
IpoDriver * driver
Definition: DNA_ipo_types.h:93
float slide_min
Definition: DNA_ipo_types.h:88
short totvert
Definition: DNA_ipo_types.h:77
short blocktype
Definition: DNA_ipo_types.h:75
rctf totrct
Definition: DNA_ipo_types.h:72
struct BPoint * bp
Definition: DNA_ipo_types.h:67
short flag
Definition: DNA_ipo_types.h:81
short ipo
Definition: DNA_ipo_types.h:79
short rt
Definition: DNA_ipo_types.h:81
short extrap
Definition: DNA_ipo_types.h:79
short vartype
Definition: DNA_ipo_types.h:75
float ymin
Definition: DNA_ipo_types.h:83
short adrcode
Definition: DNA_ipo_types.h:75
float slide_max
Definition: DNA_ipo_types.h:88
float curval
Definition: DNA_ipo_types.h:90
struct IpoCurve * next
Definition: DNA_ipo_types.h:64
char name[128]
Definition: DNA_ipo_types.h:57
short blocktype
Definition: DNA_ipo_types.h:52
struct Object * ob
Definition: DNA_ipo_types.h:50
short flag
Definition: DNA_ipo_types.h:55
short type
Definition: DNA_ipo_types.h:55
short adrcode
Definition: DNA_ipo_types.h:52
short muteipo
ListBase curve
short showkey
rctf cur
short blocktype
char _pad[2]