~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to source/blender/makesdna/DNA_armature_types.h

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: DNA_armature_types.h 15796 2008-07-27 04:19:56Z aligorith $
 
3
 *
 
4
 * ***** BEGIN GPL LICENSE BLOCK *****
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software Foundation,
 
18
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 
21
 * All rights reserved.
 
22
 *
 
23
 * Contributor(s): Full recode, Ton Roosendaal, Crete 2005
 
24
 *
 
25
 * ***** END GPL LICENSE BLOCK *****
 
26
 */
 
27
 
 
28
#ifndef DNA_ARMATURE_TYPES_H
 
29
#define DNA_ARMATURE_TYPES_H
 
30
 
 
31
#include "DNA_listBase.h"
 
32
#include "DNA_ID.h"
 
33
 
 
34
/* this system works on different transformation space levels;
 
35
 
 
36
1) Bone Space;          with each Bone having own (0,0,0) origin
 
37
2) Armature Space;  the rest position, in Object space, Bones Spaces are applied hierarchical
 
38
3) Pose Space;          the animation position, in Object space
 
39
4) World Space;         Object matrix applied to Pose or Armature space
 
40
 
 
41
*/
 
42
 
 
43
typedef struct Bone {
 
44
        struct Bone             *next, *prev;   /*      Next/prev elements within this list     */
 
45
        struct Bone             *parent;                /*      Parent (ik parent if appropriate flag is set            */
 
46
        ListBase                childbase;              /*      Children        */
 
47
        char                    name[32];               /*  Name of the bone - must be unique within the armature */
 
48
 
 
49
        float                   roll;   /*  roll is input for editmode, length calculated */
 
50
        float                   head[3];                
 
51
        float                   tail[3];                /*      head/tail and roll in Bone Space        */
 
52
        float                   bone_mat[3][3]; /*  rotation derived from head/tail/roll */
 
53
        
 
54
        int                             flag;
 
55
        
 
56
        float                   arm_head[3];            
 
57
        float                   arm_tail[3];    /*      head/tail and roll in Armature Space (rest pos) */
 
58
        float                   arm_mat[4][4];  /*  matrix: (bonemat(b)+head(b))*arm_mat(b-1), rest pos*/
 
59
        
 
60
        float                   dist, weight;                   /*  dist, weight: for non-deformgroup deforms */
 
61
        float                   xwidth, length, zwidth; /*  width: for block bones. keep in this order, transform! */
 
62
        float                   ease1, ease2;                   /*  length of bezier handles */
 
63
        float                   rad_head, rad_tail;     /* radius for head/tail sphere, defining deform as well, parent->rad_tip overrides rad_head*/
 
64
        
 
65
        float                   size[3];                /*  patch for upward compat, UNUSED! */
 
66
        short                   layer;
 
67
        short                   segments;               /*  for B-bones */
 
68
} Bone;
 
69
 
 
70
typedef struct bArmature {
 
71
        ID                      id;
 
72
        ListBase        bonebase;
 
73
        ListBase        chainbase;
 
74
        int                     flag;
 
75
        int                     drawtype;                       
 
76
        short           deformflag; 
 
77
        short           pathflag;
 
78
        short           layer, layer_protected;         /* for buttons to work, both variables in this order together */
 
79
        short           ghostep, ghostsize;             /* number of frames to ghosts to show, and step between them  */
 
80
        short           ghosttype, pathsize;            /* ghost drawing options and number of frames between points of path */
 
81
        int                     ghostsf, ghostef;               /* start and end frames of ghost-drawing range */
 
82
        int             pathsf, pathef;                 /* start and end frames of path-calculation range for all bones */
 
83
        int                     pathbc, pathac;                 /* number of frames before/after current frame of path-calculation for all bones  */
 
84
} bArmature;
 
85
 
 
86
/* armature->flag */
 
87
/* dont use bit 7, was saved in files to disable stuff */
 
88
typedef enum eArmature_Flag {
 
89
        ARM_RESTPOS                     = (1<<0),
 
90
        ARM_DRAWXRAY            = (1<<1),       /* XRAY is here only for backwards converting */
 
91
        ARM_DRAWAXES            = (1<<2),
 
92
        ARM_DRAWNAMES           = (1<<3), 
 
93
        ARM_POSEMODE            = (1<<4), 
 
94
        ARM_EDITMODE            = (1<<5), 
 
95
        ARM_DELAYDEFORM         = (1<<6), 
 
96
        ARM_DONT_USE            = (1<<7),
 
97
        ARM_MIRROR_EDIT         = (1<<8),
 
98
        ARM_AUTO_IK                     = (1<<9),
 
99
        ARM_NO_CUSTOM           = (1<<10),      /* made option negative, for backwards compat */
 
100
        ARM_COL_CUSTOM          = (1<<11),      /* draw custom colours  */
 
101
        ARM_GHOST_ONLYSEL       = (1<<12)       /* when ghosting, only show selected bones (this should belong to ghostflag instead) */
 
102
} eArmature_Flag;
 
103
 
 
104
/* armature->drawtype */
 
105
typedef enum eArmature_Drawtype {
 
106
        ARM_OCTA = 0,
 
107
        ARM_LINE,
 
108
        ARM_B_BONE,
 
109
        ARM_ENVELOPE
 
110
} eArmature_Drawtype;
 
111
 
 
112
/* armature->deformflag */
 
113
typedef enum eArmature_DeformFlag {
 
114
        ARM_DEF_VGROUP                  = (1<<0),
 
115
        ARM_DEF_ENVELOPE                = (1<<1),
 
116
        ARM_DEF_QUATERNION              = (1<<2),
 
117
        ARM_DEF_B_BONE_REST             = (1<<3),
 
118
        ARM_DEF_INVERT_VGROUP   = (1<<4)
 
119
} eArmature_DeformFlag;
 
120
 
 
121
/* armature->pathflag */
 
122
typedef enum eArmature_PathFlag {
 
123
        ARM_PATH_FNUMS          = (1<<0),
 
124
        ARM_PATH_KFRAS          = (1<<1),
 
125
        ARM_PATH_HEADS          = (1<<2),
 
126
        ARM_PATH_ACFRA          = (1<<3),
 
127
        ARM_PATH_KFNOS          = (1<<4)
 
128
} eArmature_PathFlag;
 
129
 
 
130
/* armature->ghosttype */
 
131
typedef enum eArmature_GhostType {
 
132
        ARM_GHOST_CUR = 0,
 
133
        ARM_GHOST_RANGE,
 
134
        ARM_GHOST_KEYS
 
135
} eArmature_GhostType;
 
136
 
 
137
/* bone->flag */
 
138
typedef enum eBone_Flag {
 
139
        BONE_SELECTED                           = (1<<0),
 
140
        BONE_ROOTSEL                            = (1<<1),
 
141
        BONE_TIPSEL                                     = (1<<2),
 
142
        BONE_TRANSFORM                          = (1<<3),       /* Used instead of BONE_SELECTED during transform */
 
143
        BONE_CONNECTED                          = (1<<4),       /* when bone has a parent, connect head of bone to parent's tail*/
 
144
        /* 32 used to be quatrot, was always set in files, do not reuse unless you clear it always */   
 
145
        BONE_HIDDEN_P                           = (1<<6),       /* hidden Bones when drawing PoseChannels */    
 
146
        BONE_DONE                                       = (1<<7),       /* For detecting cyclic dependancies */
 
147
        BONE_ACTIVE                                     = (1<<8),       /* active is on mouse clicks only */
 
148
        BONE_HINGE                                      = (1<<9),       /* No parent rotation or scale */
 
149
        BONE_HIDDEN_A                           = (1<<10),      /* hidden Bones when drawing Armature Editmode */
 
150
        BONE_MULT_VG_ENV                        = (1<<11),      /* multiplies vgroup with envelope */
 
151
        BONE_NO_DEFORM                          = (1<<12),      /* bone doesn't deform geometry */
 
152
        BONE_UNKEYED                            = (1<<13),      /* set to prevent destruction of its unkeyframed pose (after transform) */              
 
153
        BONE_HINGE_CHILD_TRANSFORM      = (1<<14),      /* set to prevent hinge child bones from influencing the transform center */
 
154
        BONE_NO_SCALE                           = (1<<15),      /* No parent scale */
 
155
        BONE_HIDDEN_PG                          = (1<<16),      /* hidden bone when drawing PoseChannels (for ghost drawing) */
 
156
        BONE_DRAWWIRE                           = (1<<17),      /* bone should be drawn as OB_WIRE, regardless of draw-types of view+armature */
 
157
        BONE_NO_CYCLICOFFSET            = (1<<18),      /* when no parent, bone will not get cyclic offset */
 
158
        BONE_EDITMODE_LOCKED            = (1<<19),      /* bone transforms are locked in EditMode */
 
159
} eBone_Flag;
 
160
 
 
161
#endif