Blender V4.5
DNA_key_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
13
14#include "DNA_ID.h"
15#include "DNA_defs.h"
16#include "DNA_listBase.h"
17
18struct AnimData;
19struct Ipo;
20
25typedef struct KeyBlock {
26 struct KeyBlock *next, *prev;
27
33 float pos;
35 float curval;
36
38 short type;
39 char _pad1[2];
40
42 short relative;
43 /* KeyBlockFlag */
44 short flag;
45
49 int uid;
50
53 void *data;
55 char name[/*MAX_NAME*/ 64];
57 char vgroup[/*MAX_VGROUP_NAME*/ 64];
58
60 float slidermin;
61 float slidermax;
62
64
65typedef struct Key {
66#ifdef __cplusplus
68 static constexpr ID_Type id_type = ID_KE;
69#endif
70
73 struct AnimData *adt;
74
81
86 char elemstr[32];
89 char _pad[4];
90
94 struct Ipo *ipo DNA_DEPRECATED;
95
97
99 int totkey;
100 /* ShapekeyContainerFlag */
101 short flag;
103 char type;
104 char _pad2;
105
108 float ctime;
109
116
117/* **************** KEY ********************* */
118
119/* Key::type: KeyBlocks are interpreted as... */
121 /* Sequential positions over time (using KeyBlock::pos and Key::ctime) */
123
124 /* States to blend between (default) */
127
128/* Key::flag */
132
133/* The obvious name would be `KeyBlockType` but this enum is actually used in places outside of
134 * Shape Keys (NURBS, particles, etc.). */
141
148
149#define KEYELEM_FLOAT_LEN_COORD 3
150
151/* Curve key data layout constants */
152#define KEYELEM_ELEM_SIZE_CURVE 3
153
154#define KEYELEM_ELEM_LEN_BPOINT 2
155#define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
156
157#define KEYELEM_ELEM_LEN_BEZTRIPLE 4
158#define KEYELEM_FLOAT_LEN_BEZTRIPLE (KEYELEM_ELEM_LEN_BEZTRIPLE * KEYELEM_ELEM_SIZE_CURVE)
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_KE
ShapekeyContainerType
@ KEY_RELATIVE
@ KEY_NORMAL
KeyBlockFlag
@ KEYBLOCK_LOCKED_SHAPE
@ KEYBLOCK_SEL
@ KEYBLOCK_MUTE
@ KEYBLOCK_LOCKED
ShapekeyContainerFlag
@ KEY_DS_EXPAND
KeyInterpolationType
@ KEY_LINEAR
@ KEY_CARDINAL
@ KEY_BSPLINE
@ KEY_CATMULL_ROM
These structs are the foundation for all linked lists in the library system.
Definition DNA_ID.h:404
struct KeyBlock * prev
char name[64]
float slidermax
float slidermin
float curval
struct KeyBlock * next
char vgroup[64]
short relative
char _pad1[2]
void * data
ID * from
int totkey
float ctime
char _pad2
struct Ipo *ipo DNA_DEPRECATED
short flag
char elemstr[32]
int uidgen
int elemsize
struct AnimData * adt
char type
ListBase block
KeyBlock * refkey
char _pad[4]