Blender
V5.3
source
blender
makesdna
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
19
namespace
blender
{
20
21
struct
AnimData
;
22
23
/* Key::type: KeyBlocks are interpreted as... */
24
enum
ShapekeyContainerType
:
char
{
25
/* Sequential positions over time (using KeyBlock::pos and Key::ctime) */
26
KEY_NORMAL
= 0,
27
28
/* States to blend between (default) */
29
KEY_RELATIVE
= 1,
30
};
31
32
/* Key::flag */
33
enum
ShapekeyContainerFlag
:
short
{
34
KEY_DS_EXPAND
= 1,
35
};
36
ENUM_OPERATORS
(
ShapekeyContainerFlag
)
37
38
/* The obvious name would be `KeyBlockType` but this enum is actually used in places outside of
39
* Shape Keys (NURBS, particles, etc.). */
40
enum
KeyInterpolationType
:
short
{
41
KEY_LINEAR
= 0,
42
KEY_CARDINAL
= 1,
43
KEY_BSPLINE
= 2,
44
KEY_CATMULL_ROM
= 3,
45
};
46
47
enum
KeyBlockFlag
:
short
{
48
KEYBLOCK_MUTE
= (1 << 0),
49
KEYBLOCK_SEL
= (1 << 1),
50
KEYBLOCK_LOCKED
= (1 << 2),
51
KEYBLOCK_LOCKED_SHAPE
= (1 << 3),
52
};
53
ENUM_OPERATORS
(
KeyBlockFlag
)
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
70
struct
KeyBlock
{
71
struct
KeyBlock
*
next
=
nullptr
, *
prev
=
nullptr
;
72
78
float
pos
= 0;
80
float
curval
= 0;
81
83
KeyInterpolationType
type
=
KEY_LINEAR
;
84
char
_pad1
[2] = {};
85
87
short
relative
= 0;
88
KeyBlockFlag
flag
= {};
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
108
struct
Key
{
109
#ifdef __cplusplus
111
static
constexpr
ID_Type
id_type =
ID_KE
;
112
#endif
113
114
ID
id
;
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;
141
ShapekeyContainerFlag
flag
= {};
143
ShapekeyContainerType
type
=
KEY_NORMAL
;
144
char
_pad2
= {};
145
148
float
ctime
= 0;
149
154
int
uidgen
= 0;
155
};
156
157
}
// namespace blender
BLI_enum_flags.hh
ENUM_OPERATORS
#define ENUM_OPERATORS(_enum_type)
Definition
BLI_enum_flags.hh:35
DNA_ID.h
ID and Library types, which are fundamental for SDNA.
DNA_listBase.h
These structs are the foundation for all linked lists in the library system.
blender
BMesh Iterators.
Definition
ANIM_action.hh:30
blender::ID_Type
ID_Type
Definition
DNA_ID_enums.h:136
blender::ID_KE
@ ID_KE
Definition
DNA_ID_enums.h:149
blender::KeyInterpolationType
KeyInterpolationType
Definition
DNA_key_types.h:40
blender::KEY_BSPLINE
@ KEY_BSPLINE
Definition
DNA_key_types.h:43
blender::KEY_CARDINAL
@ KEY_CARDINAL
Definition
DNA_key_types.h:42
blender::KEY_CATMULL_ROM
@ KEY_CATMULL_ROM
Definition
DNA_key_types.h:44
blender::KEY_LINEAR
@ KEY_LINEAR
Definition
DNA_key_types.h:41
blender::KeyBlockFlag
KeyBlockFlag
Definition
DNA_key_types.h:47
blender::KEYBLOCK_MUTE
@ KEYBLOCK_MUTE
Definition
DNA_key_types.h:48
blender::KEYBLOCK_LOCKED_SHAPE
@ KEYBLOCK_LOCKED_SHAPE
Definition
DNA_key_types.h:51
blender::KEYBLOCK_LOCKED
@ KEYBLOCK_LOCKED
Definition
DNA_key_types.h:50
blender::KEYBLOCK_SEL
@ KEYBLOCK_SEL
Definition
DNA_key_types.h:49
blender::ShapekeyContainerFlag
ShapekeyContainerFlag
Definition
DNA_key_types.h:33
blender::KEY_DS_EXPAND
@ KEY_DS_EXPAND
Definition
DNA_key_types.h:34
blender::ShapekeyContainerType
ShapekeyContainerType
Definition
DNA_key_types.h:24
blender::KEY_NORMAL
@ KEY_NORMAL
Definition
DNA_key_types.h:26
blender::KEY_RELATIVE
@ KEY_RELATIVE
Definition
DNA_key_types.h:29
blender::AnimData
Definition
DNA_anim_types.h:706
blender::ID
Definition
DNA_ID.h:415
blender::KeyBlock
Definition
DNA_key_types.h:70
blender::KeyBlock::totelem
int totelem
Definition
DNA_key_types.h:91
blender::KeyBlock::uid
int uid
Definition
DNA_key_types.h:93
blender::KeyBlock::data
void * data
Definition
DNA_key_types.h:97
blender::KeyBlock::name
char name[64]
Definition
DNA_key_types.h:99
blender::KeyBlock::prev
struct KeyBlock * prev
Definition
DNA_key_types.h:71
blender::KeyBlock::type
KeyInterpolationType type
Definition
DNA_key_types.h:83
blender::KeyBlock::slidermin
float slidermin
Definition
DNA_key_types.h:104
blender::KeyBlock::vgroup
char vgroup[64]
Definition
DNA_key_types.h:101
blender::KeyBlock::relative
short relative
Definition
DNA_key_types.h:87
blender::KeyBlock::_pad1
char _pad1[2]
Definition
DNA_key_types.h:84
blender::KeyBlock::slidermax
float slidermax
Definition
DNA_key_types.h:105
blender::KeyBlock::next
struct KeyBlock * next
Definition
DNA_key_types.h:71
blender::KeyBlock::flag
KeyBlockFlag flag
Definition
DNA_key_types.h:88
blender::KeyBlock::curval
float curval
Definition
DNA_key_types.h:80
blender::KeyBlock::pos
float pos
Definition
DNA_key_types.h:78
blender::Key
Definition
DNA_key_types.h:108
blender::Key::id
ID id
Definition
DNA_key_types.h:114
blender::Key::totkey
int totkey
Definition
DNA_key_types.h:140
blender::Key::from
ID * from
Definition
DNA_key_types.h:137
blender::Key::flag
ShapekeyContainerFlag flag
Definition
DNA_key_types.h:141
blender::Key::refkey
KeyBlock * refkey
Definition
DNA_key_types.h:123
blender::Key::elemstr
char elemstr[32]
Definition
DNA_key_types.h:129
blender::Key::_pad
char _pad[4]
Definition
DNA_key_types.h:132
blender::Key::elemsize
int elemsize
Definition
DNA_key_types.h:131
blender::Key::block
ListBaseT< KeyBlock > block
Definition
DNA_key_types.h:135
blender::Key::uidgen
int uidgen
Definition
DNA_key_types.h:154
blender::Key::_pad2
char _pad2
Definition
DNA_key_types.h:144
blender::Key::type
ShapekeyContainerType type
Definition
DNA_key_types.h:143
blender::Key::adt
struct AnimData * adt
Definition
DNA_key_types.h:116
blender::Key::ctime
float ctime
Definition
DNA_key_types.h:148
Generated on
for Blender by
doxygen
1.18.0