Blender  V2.93
DNA_armature_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_ID.h"
27 #include "DNA_defs.h"
28 #include "DNA_listBase.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 struct AnimData;
35 
36 /* this system works on different transformation space levels;
37  *
38  * 1) Bone Space; with each Bone having own (0,0,0) origin
39  * 2) Armature Space; the rest position, in Object space, Bones Spaces are applied hierarchical
40  * 3) Pose Space; the animation position, in Object space
41  * 4) World Space; Object matrix applied to Pose or Armature space
42  */
43 
44 typedef struct Bone {
46  struct Bone *next, *prev;
50  struct Bone *parent;
54  char name[64];
55 
57  float roll;
58  float head[3];
60  float tail[3];
62  float bone_mat[3][3];
63 
64  int flag;
65 
67  char _pad[7];
68 
69  float arm_head[3];
71  float arm_tail[3];
73  float arm_mat[4][4];
75  float arm_roll;
76 
78  float dist, weight;
80  float xwidth, length, zwidth;
86 
88  float roll1, roll2;
92  float ease1, ease2;
95 
97  float size[3];
99  int layer;
101  short segments;
102 
107  struct Bone *bbone_prev;
108  struct Bone *bbone_next;
110 
111 typedef struct bArmature {
113  struct AnimData *adt;
114 
116 
118  struct GHash *bonehash;
119  void *_pad1;
120 
123 
124  /* active bones should work like active object where possible
125  * - active and selection are unrelated
126  * - active & hidden is not allowed
127  * - from the user perspective active == last selected
128  * - active should be ignored when not visible (hidden layer) */
129 
134 
137  char _pad0[3];
138 
139  int flag;
140  int drawtype;
141 
142  short deformflag;
143  short pathflag;
144 
146  unsigned int layer_used;
148  unsigned int layer, layer_protected;
149 
153 
154 /* armature->flag */
155 /* don't use bit 7, was saved in files to disable stuff */
156 typedef enum eArmature_Flag {
157  ARM_RESTPOS = (1 << 0),
159  ARM_FLAG_UNUSED_1 = (1 << 1), /* cleared */
160  ARM_DRAWAXES = (1 << 2),
161  ARM_DRAWNAMES = (1 << 3),
162  ARM_POSEMODE = (1 << 4),
163  ARM_FLAG_UNUSED_5 = (1 << 5), /* cleared */
164  ARM_FLAG_UNUSED_6 = (1 << 6), /* cleared */
165  ARM_FLAG_UNUSED_7 = (1 << 7),
166  ARM_MIRROR_EDIT = (1 << 8),
167  ARM_FLAG_UNUSED_9 = (1 << 9),
169  ARM_NO_CUSTOM = (1 << 10),
171  ARM_COL_CUSTOM = (1 << 11),
173  ARM_FLAG_UNUSED_12 = (1 << 12), /* cleared */
175  ARM_DS_EXPAND = (1 << 13),
177  ARM_HAS_VIZ_DEPS = (1 << 14),
179 
180 /* armature->drawtype */
181 typedef enum eArmature_Drawtype {
182  ARM_OCTA = 0,
183  ARM_LINE = 1,
186  ARM_WIRE = 4,
188 
189 /* armature->deformflag */
190 typedef enum eArmature_DeformFlag {
191  ARM_DEF_VGROUP = (1 << 0),
192  ARM_DEF_ENVELOPE = (1 << 1),
193  ARM_DEF_QUATERNION = (1 << 2),
195  ARM_DEF_B_BONE_REST = (1 << 3), /* deprecated */
196 #endif
199 
200 /* armature->pathflag */
201 // XXX deprecated... old animation system (armature only viz)
202 #ifdef DNA_DEPRECATED_ALLOW
203 typedef enum eArmature_PathFlag {
204  ARM_PATH_FNUMS = (1 << 0),
205  ARM_PATH_KFRAS = (1 << 1),
206  ARM_PATH_HEADS = (1 << 2),
207  ARM_PATH_ACFRA = (1 << 3),
208  ARM_PATH_KFNOS = (1 << 4),
209 } eArmature_PathFlag;
210 #endif
211 
212 /* bone->flag */
213 typedef enum eBone_Flag {
214  BONE_SELECTED = (1 << 0),
215  BONE_ROOTSEL = (1 << 1),
216  BONE_TIPSEL = (1 << 2),
218  BONE_TRANSFORM = (1 << 3),
220  BONE_CONNECTED = (1 << 4),
221  /* 32 used to be quatrot, was always set in files, do not reuse unless you clear it always */
223  BONE_HIDDEN_P = (1 << 6),
225  BONE_DONE = (1 << 7),
227  BONE_DRAW_ACTIVE = (1 << 8),
229  BONE_HINGE = (1 << 9),
231  BONE_HIDDEN_A = (1 << 10),
233  BONE_MULT_VG_ENV = (1 << 11),
235  BONE_NO_DEFORM = (1 << 12),
236 #ifdef DNA_DEPRECATED_ALLOW
238  BONE_UNKEYED = (1 << 13),
239 #endif
242 #ifdef DNA_DEPRECATED_ALLOW
244  BONE_NO_SCALE = (1 << 15),
245 #endif
247  BONE_HIDDEN_PG = (1 << 16),
249  BONE_DRAWWIRE = (1 << 17),
251  BONE_NO_CYCLICOFFSET = (1 << 18),
253  BONE_EDITMODE_LOCKED = (1 << 19),
255  BONE_TRANSFORM_CHILD = (1 << 20),
257  BONE_UNSELECTABLE = (1 << 21),
269 
270 /* bone->inherit_scale_mode */
272  /* Inherit all scale and shear. */
274  /* Inherit scale, but remove final shear. */
276  /* Inherit average scale. */
278  /* Inherit no scale or shear. */
280  /* Inherit effects of shear on parent (same as old disabled Inherit Scale). */
282  /* Inherit parent X scale as child X scale etc. */
285 
286 /* bone->bbone_prev_type, bbone_next_type */
287 typedef enum eBone_BBoneHandleType {
288  BBONE_HANDLE_AUTO = 0, /* Default mode based on parents & children. */
289  BBONE_HANDLE_ABSOLUTE = 1, /* Custom handle in absolute position mode. */
290  BBONE_HANDLE_RELATIVE = 2, /* Custom handle in relative position mode. */
291  BBONE_HANDLE_TANGENT = 3, /* Custom handle in tangent mode (use direction, not location). */
293 
294 #define MAXBONENAME 64
295 
296 #ifdef __cplusplus
297 }
298 #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_ADD_PARENT_END_ROLL
@ 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_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:32
float curve_out_y
float ease1
char _pad[7]
float roll
float zwidth
float curve_in_y
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
float scale_in_x
float scale_in_y
short segments
float curve_in_x
float rad_head
float size[3]
IDProperty * prop
float length
float scale_out_x
float ease2
float arm_mat[4][4]
float rad_tail
float bone_mat[3][3]
float head[3]
float scale_out_y
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:273
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