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;
43 typedef struct EditBone
45 struct EditBone *next, *prev;
46 struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
47 to parents. This is converted to a two-way link for
48 normal bones when leaving editmode. */
49 void *temp; /* Used to store temporary data */
52 float roll; /* Roll along axis. We'll ultimately use the axis/angle method
53 for determining the transformation matrix of the bone. The axis
54 is tail-head while roll provides the angle. Refer to Graphics
55 Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
57 float head[3]; /* Orientation and length is implicit during editing */
59 /* All joints are considered to have zero rotation with respect to
60 their parents. Therefore any rotations specified during the
61 animation are automatically relative to the bones' rest positions*/
64 int parNr; /* Used for retrieving values from the menu system */
67 float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
69 float rad_head, rad_tail;
70 short layer, segments;
72 float oldlength; /* for envelope scaling */
76 #define BONESEL_ROOT 0x10000000
77 #define BONESEL_TIP 0x20000000
78 #define BONESEL_BONE 0x40000000
79 #define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE)
81 #define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */
84 #define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
85 #define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
87 /* used in bone_select_hierachy() */
88 #define BONE_SELECT_PARENT 0
89 #define BONE_SELECT_CHILD 1
92 void ED_operatortypes_armature(void);
93 void ED_keymap_armature(struct wmWindowManager *wm);
96 void ED_armature_from_edit(struct Scene *scene, struct Object *obedit);
97 void ED_armature_to_edit(struct Object *ob);
98 void ED_armature_edit_free(struct Object *ob);
99 void ED_armature_edit_remake(struct Object *obedit);
100 int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
101 short hits, short extend);
102 void mouse_armature(struct bContext *C, short mval[2], int extend);
103 struct Bone *get_indexed_bone (struct Object *ob, int index);
104 float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]);
105 EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators
107 void add_primitive_bone(struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d);
109 void transform_armature_mirror_update(struct Object *obedit);
110 void clear_armature(struct Scene *scene, struct Object *ob, char mode);
111 void create_vgroups_from_armature(struct Scene *scene, struct Object *ob, struct Object *par);
112 void docenter_armature (struct Scene *scene, struct View3D *v3d, struct Object *ob, int centermode);
114 void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode);
115 void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */
116 void armature_bone_rename(struct Object *ob, char *oldnamep, char *newnamep);
118 void undo_push_armature(struct bContext *C, char *name);
121 void ED_armature_exit_posemode(struct bContext *C, struct Base *base);
122 void ED_armature_enter_posemode(struct bContext *C, struct Base *base);
123 int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
124 void ED_pose_deselectall(struct Object *ob, int test, int doundo);
128 int ED_operator_sketch_mode_active_stroke(struct bContext *C);
129 int ED_operator_sketch_full_mode(struct bContext *C);
130 int ED_operator_sketch_mode(struct bContext *C);
132 void BIF_freeSketch(struct bContext *C);
133 void BIF_convertSketch(struct bContext *C);
134 void BIF_deleteSketch(struct bContext *C);
135 void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */
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_drawSketch(struct bContext *vc);
146 int BDR_drawSketchNames(struct ViewContext *vc);
148 #endif /* ED_ARMATURE_H */