Blender V5.0
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;
19
24typedef struct KeyBlock {
25 struct KeyBlock *next, *prev;
26
32 float pos;
34 float curval;
35
37 short type;
38 char _pad1[2];
39
41 short relative;
42 /* KeyBlockFlag */
43 short flag;
44
48 int uid;
49
52 void *data;
54 char name[/*MAX_NAME*/ 64];
56 char vgroup[/*MAX_VGROUP_NAME*/ 64];
57
59 float slidermin;
60 float slidermax;
61
63
64typedef struct Key {
65#ifdef __cplusplus
67 static constexpr ID_Type id_type = ID_KE;
68#endif
69
72 struct AnimData *adt;
73
80
85 char elemstr[32];
88 char _pad[4];
89
92
94
96 int totkey;
97 /* ShapekeyContainerFlag */
98 short flag;
100 char type;
101 char _pad2;
102
105 float ctime;
106
113
114/* **************** KEY ********************* */
115
116/* Key::type: KeyBlocks are interpreted as... */
118 /* Sequential positions over time (using KeyBlock::pos and Key::ctime) */
120
121 /* States to blend between (default) */
124
125/* Key::flag */
129
130/* The obvious name would be `KeyBlockType` but this enum is actually used in places outside of
131 * Shape Keys (NURBS, particles, etc.). */
138
145
146#define KEYELEM_FLOAT_LEN_COORD 3
147
148/* Curve key data layout constants */
149#define KEYELEM_ELEM_SIZE_CURVE 3
150
151#define KEYELEM_ELEM_LEN_BPOINT 2
152#define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
153
154#define KEYELEM_ELEM_LEN_BEZTRIPLE 4
155#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:414
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
short flag
char elemstr[32]
int uidgen
int elemsize
struct AnimData * adt
char type
ListBase block
KeyBlock * refkey
char _pad[4]