Blender V5.3
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_listBase.h"
16
17#include "BLI_enum_flags.hh"
18
19namespace blender {
20
21struct AnimData;
22
23/* Key::type: KeyBlocks are interpreted as... */
25 /* Sequential positions over time (using KeyBlock::pos and Key::ctime) */
27
28 /* States to blend between (default) */
30};
31
32/* Key::flag */
35};
37
38/* The obvious name would be `KeyBlockType` but this enum is actually used in places outside of
39 * Shape Keys (NURBS, particles, etc.). */
46
47enum KeyBlockFlag : short {
48 KEYBLOCK_MUTE = (1 << 0),
49 KEYBLOCK_SEL = (1 << 1),
50 KEYBLOCK_LOCKED = (1 << 2),
52};
54
55#define KEYELEM_FLOAT_LEN_COORD 3
56
57/* Curve key data layout constants */
58#define KEYELEM_ELEM_SIZE_CURVE 3
59
60#define KEYELEM_ELEM_LEN_BPOINT 2
61#define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
62
63#define KEYELEM_ELEM_LEN_BEZTRIPLE 4
64#define KEYELEM_FLOAT_LEN_BEZTRIPLE (KEYELEM_ELEM_LEN_BEZTRIPLE * KEYELEM_ELEM_SIZE_CURVE)
65
70struct KeyBlock {
71 struct KeyBlock *next = nullptr, *prev = nullptr;
72
78 float pos = 0;
80 float curval = 0;
81
84 char _pad1[2] = {};
85
87 short relative = 0;
89
91 int totelem = 0;
93 int uid = 0;
94
97 void *data = nullptr;
99 char name[/*MAX_NAME*/ 64] = "";
101 char vgroup[/*MAX_VGROUP_NAME*/ 64] = "";
102
104 float slidermin = 0;
105 float slidermax = 0;
106};
107
108struct Key {
109#ifdef __cplusplus
111 static constexpr ID_Type id_type = ID_KE;
112#endif
113
116 struct AnimData *adt = nullptr;
117
123 KeyBlock *refkey = nullptr;
124
129 char elemstr[32] = "";
131 int elemsize = 0;
132 char _pad[4] = {};
133
135 ListBaseT<KeyBlock> block = {nullptr, nullptr};
136
137 ID *from = nullptr;
138
140 int totkey = 0;
144 char _pad2 = {};
145
148 float ctime = 0;
149
154 int uidgen = 0;
155};
156
157} // namespace blender
#define ENUM_OPERATORS(_enum_type)
ID and Library types, which are fundamental for SDNA.
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
@ KEY_CATMULL_ROM
@ KEYBLOCK_LOCKED_SHAPE
@ KEYBLOCK_LOCKED
ShapekeyContainerFlag
ShapekeyContainerType
struct KeyBlock * prev
KeyInterpolationType type
struct KeyBlock * next
KeyBlockFlag flag
ShapekeyContainerFlag flag
KeyBlock * refkey
char elemstr[32]
ListBaseT< KeyBlock > block
ShapekeyContainerType type
struct AnimData * adt