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 *****
38 struct wmWindowManager;
44 typedef struct EditBone
46 struct EditBone *next, *prev;
47 struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
48 to parents. This is converted to a two-way link for
49 normal bones when leaving editmode. */
50 void *temp; /* Used to store temporary data */
53 float roll; /* Roll along axis. We'll ultimately use the axis/angle method
54 for determining the transformation matrix of the bone. The axis
55 is tail-head while roll provides the angle. Refer to Graphics
56 Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
58 float head[3]; /* Orientation and length is implicit during editing */
60 /* All joints are considered to have zero rotation with respect to
61 their parents. Therefore any rotations specified during the
62 animation are automatically relative to the bones' rest positions*/
65 int parNr; /* Used for retrieving values from the menu system */
68 float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
70 float rad_head, rad_tail;
71 short layer, segments;
73 float oldlength; /* for envelope scaling */
77 #define BONESEL_ROOT 0x10000000
78 #define BONESEL_TIP 0x20000000
79 #define BONESEL_BONE 0x40000000
80 #define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE)
82 #define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */
85 #define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
86 #define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
88 /* used in bone_select_hierachy() */
89 #define BONE_SELECT_PARENT 0
90 #define BONE_SELECT_CHILD 1
93 void ED_operatortypes_armature(void);
94 void ED_keymap_armature(struct wmWindowManager *wm);
97 void ED_armature_from_edit(struct Scene *scene, struct Object *obedit);
98 void ED_armature_to_edit(struct Object *ob);
99 void ED_armature_edit_free(struct Object *ob);
100 void ED_armature_edit_remake(struct Object *obedit);
101 int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
102 short hits, short extend);
103 void mouse_armature(struct bContext *C, short mval[2], int extend);
104 int join_armature_exec(struct bContext *C, struct wmOperator *op);
105 struct Bone *get_indexed_bone (struct Object *ob, int index);
106 float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]);
107 EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators
108 void ED_armature_sync_selection(struct ListBase *edbo);
110 void add_primitive_bone(struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d);
112 void transform_armature_mirror_update(struct Object *obedit);
113 void clear_armature(struct Scene *scene, struct Object *ob, char mode);
114 void create_vgroups_from_armature(struct Scene *scene, struct Object *ob, struct Object *par);
115 void docenter_armature (struct Scene *scene, struct View3D *v3d, struct Object *ob, int centermode);
117 void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode);
118 void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */
119 void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep);
121 void undo_push_armature(struct bContext *C, char *name);
124 void ED_armature_exit_posemode(struct bContext *C, struct Base *base);
125 void ED_armature_enter_posemode(struct bContext *C, struct Base *base);
126 int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
127 void ED_pose_deselectall(struct Object *ob, int test, int doundo);
131 int ED_operator_sketch_mode_active_stroke(struct bContext *C);
132 int ED_operator_sketch_full_mode(struct bContext *C);
133 int ED_operator_sketch_mode(const struct bContext *C);
135 void BIF_freeSketch(struct bContext *C);
136 void BIF_convertSketch(struct bContext *C);
137 void BIF_deleteSketch(struct bContext *C);
138 void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */
140 void BIF_makeListTemplates(const struct bContext *C);
141 char *BIF_listTemplates(const struct bContext *C);
142 int BIF_currentTemplate(const struct bContext *C);
143 void BIF_freeTemplates(struct bContext *C);
144 void BIF_setTemplate(struct bContext *C, int index);
145 int BIF_nbJointsTemplate(const struct bContext *C);
146 char * BIF_nameBoneTemplate(const struct bContext *C);
148 void BDR_drawSketch(const struct bContext *vc);
149 int BDR_drawSketchNames(struct ViewContext *vc);
151 #endif /* ED_ARMATURE_H */