53
53
struct wmKeyConfig;
56
typedef struct EditBone
56
typedef struct EditBone {
58
57
struct EditBone *next, *prev;
59
struct IDProperty *prop;/* User-Defined Properties on this Bone */
60
struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
61
* to parents. This is converted to a two-way link for
62
* normal bones when leaving editmode. */
58
struct IDProperty *prop; /* User-Defined Properties on this Bone */
59
struct EditBone *parent; /* Editbones have a one-way link (i.e. children refer
60
* to parents. This is converted to a two-way link for
61
* normal bones when leaving editmode. */
63
62
void *temp; /* Used to store temporary data */
65
64
char name[64]; /* MAX_NAME */
68
67
* is tail-head while roll provides the angle. Refer to Graphics
69
68
* Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
71
float head[3]; /* Orientation and length is implicit during editing */
73
/* All joints are considered to have zero rotation with respect to
74
* their parents. Therefore any rotations specified during the
75
* animation are automatically relative to the bones' rest positions*/
70
float head[3]; /* Orientation and length is implicit during editing */
72
/* All joints are considered to have zero rotation with respect to
73
* their parents. Therefore any rotations specified during the
74
* animation are automatically relative to the bones' rest positions*/
79
78
float dist, weight;
80
79
float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
89
#define BONESEL_ROOT (1<<28)
90
#define BONESEL_TIP (1<<29)
91
#define BONESEL_BONE (1<<30)
92
#define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE)
88
#define BONESEL_ROOT (1 << 28)
89
#define BONESEL_TIP (1 << 29)
90
#define BONESEL_BONE (1 << 30)
91
#define BONESEL_ANY (BONESEL_TIP | BONESEL_ROOT | BONESEL_BONE)
94
#define BONESEL_NOSEL (1<<31) /* Indicates a negative number */
93
#define BONESEL_NOSEL (1 << 31) /* Indicates a negative number */
96
95
/* useful macros */
97
#define EBONE_VISIBLE(arm, ebone) (((arm)->layer & (ebone)->layer) && !((ebone)->flag & BONE_HIDDEN_A))
98
#define EBONE_EDITABLE(ebone) (((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & BONE_EDITMODE_LOCKED))
96
#define EBONE_VISIBLE(arm, ebone) ( \
97
CHECK_TYPE_INLINE(arm, bArmature), \
98
CHECK_TYPE_INLINE(ebone, EditBone), \
99
(((arm)->layer & (ebone)->layer) && !((ebone)->flag & BONE_HIDDEN_A)) \
102
#define EBONE_SELECTABLE(arm, ebone) (EBONE_VISIBLE(arm, ebone) && !(ebone->flag & BONE_UNSELECTABLE))
104
#define EBONE_EDITABLE(ebone) ( \
105
CHECK_TYPE_INLINE(ebone, EditBone), \
106
(((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & BONE_EDITMODE_LOCKED)) \
100
109
/* used in bone_select_hierachy() */
101
#define BONE_SELECT_PARENT 0
102
#define BONE_SELECT_CHILD 1
110
#define BONE_SELECT_PARENT 0
111
#define BONE_SELECT_CHILD 1
104
113
/* armature_ops.c */
105
114
void ED_operatortypes_armature(void);
114
123
void ED_armature_deselect_all_visible(struct Object *obedit);
116
125
int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
117
short hits, short extend);
118
int mouse_armature(struct bContext *C, const int mval[2], int extend);
126
short hits, short extend, short deselect, short toggle);
127
int mouse_armature(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
119
128
int join_armature_exec(struct bContext *C, struct wmOperator *op);
120
struct Bone *get_indexed_bone (struct Object *ob, int index);
129
struct Bone *get_indexed_bone(struct Object *ob, int index);
121
130
float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only);
122
131
EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators
123
132
void ED_armature_sync_selection(struct ListBase *edbo);
128
137
void ED_armature_edit_bone_remove(struct bArmature *arm, EditBone *exBone);
130
139
void transform_armature_mirror_update(struct Object *obedit);
131
void docenter_armature (struct Scene *scene, struct Object *ob, float cursor[3], int centermode, int around);
140
void docenter_armature(struct Scene *scene, struct Object *ob, float cursor[3], int centermode, int around);
133
142
void ED_armature_apply_transform(struct Object *ob, float mat[4][4]);
135
#define ARM_GROUPS_NAME 1
136
#define ARM_GROUPS_ENVELOPE 2
137
#define ARM_GROUPS_AUTO 3
144
#define ARM_GROUPS_NAME 1
145
#define ARM_GROUPS_ENVELOPE 2
146
#define ARM_GROUPS_AUTO 3
139
148
void create_vgroups_from_armature(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct Object *par, int mode, int mirror);
149
158
int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
150
159
void ED_pose_deselectall(struct Object *ob, int test);
151
160
void ED_pose_recalculate_paths(struct Scene *scene, struct Object *ob);
161
struct Object *ED_pose_object_from_context(struct bContext *C);
166
176
void BIF_freeTemplates(struct bContext *C);
167
177
void BIF_setTemplate(struct bContext *C, int index);
168
178
int BIF_nbJointsTemplate(const struct bContext *C);
169
const char * BIF_nameBoneTemplate(const struct bContext *C);
179
const char *BIF_nameBoneTemplate(const struct bContext *C);
171
181
void BDR_drawSketch(const struct bContext *vc);
172
182
int BDR_drawSketchNames(struct ViewContext *vc);
174
184
/* meshlaplacian.c */
175
185
void mesh_deform_bind(struct Scene *scene,
176
struct MeshDeformModifierData *mmd,
177
float *vertexcos, int totvert, float cagemat[][4]);
186
struct MeshDeformModifierData *mmd,
187
float *vertexcos, int totvert, float cagemat[4][4]);
179
189
#ifdef __cplusplus
183
193
#endif /* __ED_ARMATURE_H__ */