Blender  V3.3
DNA_armature_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID.h"
11 #include "DNA_defs.h"
12 #include "DNA_listBase.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 struct AnimData;
19 
20 /* this system works on different transformation space levels;
21  *
22  * 1) Bone Space; with each Bone having own (0,0,0) origin
23  * 2) Armature Space; the rest position, in Object space, Bones Spaces are applied hierarchical
24  * 3) Pose Space; the animation position, in Object space
25  * 4) World Space; Object matrix applied to Pose or Armature space
26  */
27 
28 typedef struct Bone {
30  struct Bone *next, *prev;
34  struct Bone *parent;
38  char name[64];
39 
41  float roll;
42  float head[3];
44  float tail[3];
46  float bone_mat[3][3];
47 
48  int flag;
49 
51  char _pad[7];
52 
53  float arm_head[3];
55  float arm_tail[3];
57  float arm_mat[4][4];
59  float arm_roll;
60 
62  float dist, weight;
69  float xwidth, length, zwidth;
75 
77  float roll1, roll2;
81  float ease1, ease2;
82  float scale_in_x DNA_DEPRECATED, scale_in_z DNA_DEPRECATED;
83  float scale_out_x DNA_DEPRECATED, scale_out_z DNA_DEPRECATED;
84  float scale_in[3], scale_out[3];
85 
87  float size[3];
89  int layer;
91  short segments;
92 
101  struct Bone *bbone_prev;
102  struct Bone *bbone_next;
104 
105 typedef struct bArmature {
107  struct AnimData *adt;
108 
110 
112  struct GHash *bonehash;
113  void *_pad1;
114 
117 
118  /* active bones should work like active object where possible
119  * - active and selection are unrelated
120  * - active & hidden is not allowed
121  * - from the user perspective active == last selected
122  * - active should be ignored when not visible (hidden layer) */
123 
128 
131  char _pad0[3];
132 
133  int flag;
134  int drawtype;
135 
136  short deformflag;
137  short pathflag;
138 
140  unsigned int layer_used;
142  unsigned int layer, layer_protected;
143 
147 
148 /* armature->flag */
149 /* don't use bit 7, was saved in files to disable stuff */
150 typedef enum eArmature_Flag {
151  ARM_RESTPOS = (1 << 0),
153  ARM_FLAG_UNUSED_1 = (1 << 1), /* cleared */
154  ARM_DRAWAXES = (1 << 2),
155  ARM_DRAWNAMES = (1 << 3),
156  ARM_POSEMODE = (1 << 4),
157  ARM_FLAG_UNUSED_5 = (1 << 5), /* cleared */
158  ARM_FLAG_UNUSED_6 = (1 << 6), /* cleared */
159  ARM_FLAG_UNUSED_7 = (1 << 7),
160  ARM_MIRROR_EDIT = (1 << 8),
161  ARM_FLAG_UNUSED_9 = (1 << 9),
163  ARM_NO_CUSTOM = (1 << 10),
165  ARM_COL_CUSTOM = (1 << 11),
167  ARM_FLAG_UNUSED_12 = (1 << 12), /* cleared */
169  ARM_DS_EXPAND = (1 << 13),
171  ARM_HAS_VIZ_DEPS = (1 << 14),
173 
174 /* armature->drawtype */
175 typedef enum eArmature_Drawtype {
176  ARM_OCTA = 0,
177  ARM_LINE = 1,
180  ARM_WIRE = 4,
182 
183 /* armature->deformflag */
184 typedef enum eArmature_DeformFlag {
185  ARM_DEF_VGROUP = (1 << 0),
186  ARM_DEF_ENVELOPE = (1 << 1),
187  ARM_DEF_QUATERNION = (1 << 2),
189  ARM_DEF_B_BONE_REST = (1 << 3), /* deprecated */
190 #endif
193 
194 #ifdef DNA_DEPRECATED_ALLOW /* Old animation system (armature only viz). */
196 typedef enum eArmature_PathFlag {
197  ARM_PATH_FNUMS = (1 << 0),
198  ARM_PATH_KFRAS = (1 << 1),
199  ARM_PATH_HEADS = (1 << 2),
200  ARM_PATH_ACFRA = (1 << 3),
201  ARM_PATH_KFNOS = (1 << 4),
202 } eArmature_PathFlag;
203 #endif
204 
205 /* bone->flag */
206 typedef enum eBone_Flag {
207  BONE_SELECTED = (1 << 0),
208  BONE_ROOTSEL = (1 << 1),
209  BONE_TIPSEL = (1 << 2),
211  BONE_TRANSFORM = (1 << 3),
213  BONE_CONNECTED = (1 << 4),
214  /* 32 used to be quatrot, was always set in files, do not reuse unless you clear it always */
216  BONE_HIDDEN_P = (1 << 6),
218  BONE_DONE = (1 << 7),
220  BONE_DRAW_ACTIVE = (1 << 8),
222  BONE_HINGE = (1 << 9),
224  BONE_HIDDEN_A = (1 << 10),
226  BONE_MULT_VG_ENV = (1 << 11),
228  BONE_NO_DEFORM = (1 << 12),
229 #ifdef DNA_DEPRECATED_ALLOW
231  BONE_UNKEYED = (1 << 13),
232 #endif
235 #ifdef DNA_DEPRECATED_ALLOW
237  BONE_NO_SCALE = (1 << 15),
238 #endif
240  BONE_HIDDEN_PG = (1 << 16),
242  BONE_DRAWWIRE = (1 << 17),
244  BONE_NO_CYCLICOFFSET = (1 << 18),
246  BONE_EDITMODE_LOCKED = (1 << 19),
248  BONE_TRANSFORM_CHILD = (1 << 20),
250  BONE_UNSELECTABLE = (1 << 21),
257  BONE_ADD_PARENT_END_ROLL = (1 << 24),
258 #endif
264 
265 /* bone->inherit_scale_mode */
267  /* Inherit all scale and shear. */
269  /* Inherit scale, but remove final shear. */
271  /* Inherit average scale. */
273  /* Inherit no scale or shear. */
275  /* Inherit effects of shear on parent (same as old disabled Inherit Scale). */
277  /* Inherit parent X scale as child X scale etc. */
280 
281 /* bone->bbone_prev_type, bbone_next_type */
282 typedef enum eBone_BBoneHandleType {
283  BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
284  BBONE_HANDLE_ABSOLUTE = 1, /* Custom handle in absolute position mode. */
285  BBONE_HANDLE_RELATIVE = 2, /* Custom handle in relative position mode. */
286  BBONE_HANDLE_TANGENT = 3, /* Custom handle in tangent mode (use direction, not location). */
288 
289 /* bone->bbone_flag */
290 typedef enum eBone_BBoneFlag {
294  BBONE_SCALE_EASING = (1 << 1),
296 
297 /* bone->bbone_prev/next_flag */
298 typedef enum eBone_BBoneHandleFlag {
311 
312 #define MAXBONENAME 64
313 
314 #ifdef __cplusplus
315 }
316 #endif
ID and Library types, which are fundamental for sdna.
struct Bone Bone
eArmature_DeformFlag
@ ARM_DEF_VGROUP
@ ARM_DEF_QUATERNION
@ ARM_DEF_INVERT_VGROUP
@ ARM_DEF_ENVELOPE
eBone_BBoneHandleType
@ BBONE_HANDLE_AUTO
@ BBONE_HANDLE_TANGENT
@ BBONE_HANDLE_ABSOLUTE
@ BBONE_HANDLE_RELATIVE
@ BONE_DRAW_LOCKED_WEIGHT
@ BONE_ROOTSEL
@ BONE_DRAWWIRE
@ BONE_SELECTED
@ BONE_NO_CYCLICOFFSET
@ BONE_TRANSFORM
@ BONE_UNSELECTABLE
@ BONE_DONE
@ BONE_HIDDEN_A
@ BONE_EDITMODE_LOCKED
@ BONE_TRANSFORM_MIRROR
@ BONE_NO_LOCAL_LOCATION
@ BONE_TRANSFORM_CHILD
@ BONE_MULT_VG_ENV
@ BONE_HIDDEN_P
@ BONE_DRAW_ACTIVE
@ BONE_TIPSEL
@ BONE_NO_DEFORM
@ BONE_CONNECTED
@ BONE_RELATIVE_PARENTING
@ BONE_HIDDEN_PG
@ BONE_HINGE
@ BONE_HINGE_CHILD_TRANSFORM
eArmature_Flag
@ ARM_NO_CUSTOM
@ ARM_HAS_VIZ_DEPS
@ ARM_COL_CUSTOM
@ ARM_FLAG_UNUSED_5
@ ARM_POSEMODE
@ ARM_DRAWNAMES
@ ARM_DS_EXPAND
@ ARM_FLAG_UNUSED_12
@ ARM_FLAG_UNUSED_6
@ ARM_FLAG_UNUSED_7
@ ARM_FLAG_UNUSED_1
@ ARM_MIRROR_EDIT
@ ARM_DRAWAXES
@ ARM_FLAG_UNUSED_9
@ ARM_RESTPOS
struct bArmature bArmature
eArmature_Drawtype
@ ARM_OCTA
@ ARM_LINE
@ ARM_B_BONE
@ ARM_ENVELOPE
@ ARM_WIRE
eBone_BBoneFlag
@ BBONE_ADD_PARENT_END_ROLL
@ BBONE_SCALE_EASING
eBone_BBoneHandleFlag
@ BBONE_HANDLE_SCALE_EASE
@ BBONE_HANDLE_SCALE_Y
@ BBONE_HANDLE_SCALE_X
@ BBONE_HANDLE_SCALE_ANY
@ BBONE_HANDLE_SCALE_Z
eBone_InheritScaleMode
@ BONE_INHERIT_SCALE_FULL
@ BONE_INHERIT_SCALE_NONE
@ BONE_INHERIT_SCALE_FIX_SHEAR
@ BONE_INHERIT_SCALE_NONE_LEGACY
@ BONE_INHERIT_SCALE_ALIGNED
@ BONE_INHERIT_SCALE_AVERAGE
These structs are the foundation for all linked lists in the library system.
#define DNA_DEPRECATED_ALLOW
Definition: action.c:16
float curve_in_z
float scale_in_x DNA_DEPRECATED
float ease1
int bbone_flag
char _pad[7]
short bbone_next_flag
float roll
float zwidth
short bbone_prev_flag
struct Bone * parent
struct Bone * bbone_prev
float roll1
float arm_head[3]
float roll2
char name[64]
float xwidth
float tail[3]
float arm_tail[3]
struct Bone * bbone_next
char inherit_scale_mode
char bbone_prev_type
short segments
float curve_in_x
float scale_out[3]
float rad_head
float size[3]
IDProperty * prop
float curve_out_z
float length
float ease2
float arm_mat[4][4]
float rad_tail
float scale_out_x DNA_DEPRECATED
float bone_mat[3][3]
float scale_in[3]
float head[3]
char bbone_next_type
float dist
struct Bone * next
float curve_out_x
ListBase childbase
struct Bone * prev
float weight
float arm_roll
Definition: DNA_ID.h:368
struct AnimData * adt
unsigned int layer_used
ListBase bonebase
struct GHash * bonehash
struct EditBone * act_edbone
unsigned int layer
unsigned int layer_protected
ListBase * edbo