4 * ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * Contributor(s): Blender Foundation
25 * ***** END GPL LICENSE BLOCK *****
37 struct wmWindowManager;
42 typedef struct EditBone
44 struct EditBone *next, *prev;
45 struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
46 to parents. This is converted to a two-way link for
47 normal bones when leaving editmode. */
48 void *temp; /* Used to store temporary data */
51 float roll; /* Roll along axis. We'll ultimately use the axis/angle method
52 for determining the transformation matrix of the bone. The axis
53 is tail-head while roll provides the angle. Refer to Graphics
54 Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
56 float head[3]; /* Orientation and length is implicit during editing */
58 /* All joints are considered to have zero rotation with respect to
59 their parents. Therefore any rotations specified during the
60 animation are automatically relative to the bones' rest positions*/
63 int parNr; /* Used for retrieving values from the menu system */
66 float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
68 float rad_head, rad_tail;
69 short layer, segments;
71 float oldlength; /* for envelope scaling */
75 #define BONESEL_ROOT 0x10000000
76 #define BONESEL_TIP 0x20000000
77 #define BONESEL_BONE 0x40000000
78 #define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE)
80 #define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */
83 #define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
84 #define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
86 /* used in bone_select_hierachy() */
87 #define BONE_SELECT_PARENT 0
88 #define BONE_SELECT_CHILD 1
91 void ED_operatortypes_armature(void);
92 void ED_keymap_armature(struct wmWindowManager *wm);
95 void ED_armature_from_edit(struct Scene *scene, struct Object *obedit);
96 void ED_armature_to_edit(struct Object *ob);
97 void ED_armature_edit_free(struct Object *ob);
98 void ED_armature_edit_remake(struct Object *obedit);
99 int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
100 short hits, short extend);
101 void mouse_armature(struct bContext *C, short mval[2], int extend);
102 struct Bone *get_indexed_bone (struct Object *ob, int index);
103 float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]);
104 EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators
106 void add_primitive_bone(struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d);
108 void transform_armature_mirror_update(struct Object *obedit);
109 void clear_armature(struct Scene *scene, struct Object *ob, char mode);
110 void create_vgroups_from_armature(struct Scene *scene, struct Object *ob, struct Object *par);
111 void docenter_armature (struct Scene *scene, struct View3D *v3d, struct Object *ob, int centermode);
113 void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode);
114 void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */
115 void armature_bone_rename(struct Object *ob, char *oldnamep, char *newnamep);
117 void undo_push_armature(struct bContext *C, char *name);
120 void ED_armature_exit_posemode(struct bContext *C, struct Base *base);
121 void ED_armature_enter_posemode(struct bContext *C, struct Base *base);
122 int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
123 void ED_pose_deselectall(struct Object *ob, int test, int doundo);
127 int BIF_paintSketch(struct bContext *C, short mbut);
128 void BIF_endStrokeSketch(struct bContext *C);
129 void BIF_convertSketch(struct bContext *C);
130 void BIF_deleteSketch(struct bContext *C);
131 void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */
132 int BIF_validSketchMode(struct bContext *C);
133 int BIF_fullSketchMode(struct bContext *C); /* full sketch turned on (not Quick) */
134 void BIF_cancelStrokeSketch(struct bContext *C);
135 void BIF_sk_selectStroke(struct bContext *C, short mval[2], int extend);
137 void BIF_makeListTemplates(struct bContext *C);
138 char *BIF_listTemplates(struct bContext *C);
139 int BIF_currentTemplate(struct bContext *C);
140 void BIF_freeTemplates(struct bContext *C);
141 void BIF_setTemplate(struct bContext *C, int index);
142 int BIF_nbJointsTemplate(struct bContext *C);
143 char * BIF_nameBoneTemplate(struct bContext *C);
145 void BDR_queueDrawSketch(struct bContext *C);
146 void BDR_drawSketch(struct bContext *C);
147 void BDR_drawSketchNames(struct bContext *C);
149 #endif /* ED_ARMATURE_H */