Blender  V2.93
DNA_key_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 #pragma once
20 
29 #include "DNA_ID.h"
30 #include "DNA_defs.h"
31 #include "DNA_listBase.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 struct AnimData;
38 struct Ipo;
39 
40 typedef struct KeyBlock {
41  struct KeyBlock *next, *prev;
42 
48  float pos;
50  float curval;
51 
53  short type;
54  char _pad1[2];
55 
57  short relative;
58  short flag;
59 
61  int totelem;
63  int uid;
64 
66  void *data;
68  char name[64];
70  char vgroup[64];
71 
73  float slidermin;
74  float slidermax;
75 
77 
78 typedef struct Key {
79  ID id;
81  struct AnimData *adt;
82 
89 
94  char elemstr[32];
96  int elemsize;
97  char _pad[4];
98 
102  struct Ipo *ipo DNA_DEPRECATED;
103 
105 
107  int totkey;
108  short flag;
110  char type;
111  char _pad2;
112 
115  float ctime;
116 
121  int uidgen;
122 } Key;
123 
124 /* **************** KEY ********************* */
125 
126 /* Key->type: KeyBlocks are interpreted as... */
127 enum {
128  /* Sequential positions over time (using KeyBlock->pos and Key->ctime) */
130 
131  /* States to blend between (default) */
133 };
134 
135 /* Key->flag */
136 enum {
138 };
139 
140 /* KeyBlock->type */
141 enum {
146 };
147 
148 /* KeyBlock->flag */
149 enum {
150  KEYBLOCK_MUTE = (1 << 0),
151  KEYBLOCK_SEL = (1 << 1),
152  KEYBLOCK_LOCKED = (1 << 2),
153 };
154 
155 #define KEYELEM_FLOAT_LEN_COORD 3
156 
157 /* Curve key data layout constants */
158 #define KEYELEM_ELEM_SIZE_CURVE 3
159 
160 #define KEYELEM_ELEM_LEN_BPOINT 2
161 #define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
162 
163 #define KEYELEM_ELEM_LEN_BEZTRIPLE 4
164 #define KEYELEM_FLOAT_LEN_BEZTRIPLE (KEYELEM_ELEM_LEN_BEZTRIPLE * KEYELEM_ELEM_SIZE_CURVE)
165 
166 #ifdef __cplusplus
167 }
168 #endif
ID and Library types, which are fundamental for sdna.
struct KeyBlock KeyBlock
struct Key Key
@ KEY_DS_EXPAND
@ KEY_LINEAR
@ KEY_CARDINAL
@ KEY_BSPLINE
@ KEY_CATMULL_ROM
@ KEY_RELATIVE
@ KEY_NORMAL
@ KEYBLOCK_SEL
@ KEYBLOCK_MUTE
@ KEYBLOCK_LOCKED
These structs are the foundation for all linked lists in the library system.
Definition: DNA_ID.h:273
struct KeyBlock * prev
Definition: DNA_key_types.h:41
short flag
Definition: DNA_key_types.h:58
char name[64]
Definition: DNA_key_types.h:68
float pos
Definition: DNA_key_types.h:48
float slidermax
Definition: DNA_key_types.h:74
float slidermin
Definition: DNA_key_types.h:73
float curval
Definition: DNA_key_types.h:50
struct KeyBlock * next
Definition: DNA_key_types.h:41
char vgroup[64]
Definition: DNA_key_types.h:70
short relative
Definition: DNA_key_types.h:57
short type
Definition: DNA_key_types.h:53
char _pad1[2]
Definition: DNA_key_types.h:54
void * data
Definition: DNA_key_types.h:66
ID * from
int totkey
float ctime
char _pad2
struct Ipo *ipo DNA_DEPRECATED
short flag
char elemstr[32]
Definition: DNA_key_types.h:94
ID id
Definition: DNA_key_types.h:79
int uidgen
int elemsize
Definition: DNA_key_types.h:96
struct AnimData * adt
Definition: DNA_key_types.h:81
char type
ListBase block
KeyBlock * refkey
Definition: DNA_key_types.h:88
char _pad[4]
Definition: DNA_key_types.h:97