2009-01-05 15:19:31 +00:00
|
|
|
/**
|
|
|
|
|
* $Id:
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
#ifndef ED_ARMATURE_H
|
|
|
|
|
#define ED_ARMATURE_H
|
|
|
|
|
|
2009-01-05 19:32:04 +00:00
|
|
|
struct bContext;
|
2009-01-05 15:19:31 +00:00
|
|
|
struct Scene;
|
|
|
|
|
struct Object;
|
|
|
|
|
struct Base;
|
|
|
|
|
struct Bone;
|
|
|
|
|
struct bArmature;
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
struct bPoseChannel;
|
2009-02-01 17:33:10 +00:00
|
|
|
struct wmWindowManager;
|
2009-01-05 15:19:31 +00:00
|
|
|
struct ListBase;
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
struct View3D;
|
2009-03-22 00:30:18 +00:00
|
|
|
struct ViewContext;
|
2009-02-25 14:50:40 +00:00
|
|
|
struct RegionView3D;
|
2009-01-05 15:19:31 +00:00
|
|
|
|
|
|
|
|
typedef struct EditBone
|
|
|
|
|
{
|
|
|
|
|
struct EditBone *next, *prev;
|
|
|
|
|
struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
|
|
|
|
|
to parents. This is converted to a two-way link for
|
|
|
|
|
normal bones when leaving editmode. */
|
|
|
|
|
void *temp; /* Used to store temporary data */
|
|
|
|
|
|
|
|
|
|
char name[32];
|
|
|
|
|
float roll; /* Roll along axis. We'll ultimately use the axis/angle method
|
|
|
|
|
for determining the transformation matrix of the bone. The axis
|
|
|
|
|
is tail-head while roll provides the angle. Refer to Graphics
|
|
|
|
|
Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
|
|
|
|
|
|
|
|
|
|
float head[3]; /* Orientation and length is implicit during editing */
|
|
|
|
|
float tail[3];
|
|
|
|
|
/* All joints are considered to have zero rotation with respect to
|
|
|
|
|
their parents. Therefore any rotations specified during the
|
|
|
|
|
animation are automatically relative to the bones' rest positions*/
|
|
|
|
|
int flag;
|
|
|
|
|
|
|
|
|
|
int parNr; /* Used for retrieving values from the menu system */
|
|
|
|
|
|
|
|
|
|
float dist, weight;
|
|
|
|
|
float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
|
|
|
|
|
float ease1, ease2;
|
|
|
|
|
float rad_head, rad_tail;
|
|
|
|
|
short layer, segments;
|
|
|
|
|
|
|
|
|
|
float oldlength; /* for envelope scaling */
|
|
|
|
|
|
|
|
|
|
} EditBone;
|
|
|
|
|
|
|
|
|
|
#define BONESEL_ROOT 0x10000000
|
|
|
|
|
#define BONESEL_TIP 0x20000000
|
|
|
|
|
#define BONESEL_BONE 0x40000000
|
|
|
|
|
#define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE)
|
|
|
|
|
|
|
|
|
|
#define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */
|
|
|
|
|
|
|
|
|
|
/* useful macros */
|
|
|
|
|
#define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
|
|
|
|
|
#define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
|
|
|
|
|
|
|
|
|
|
/* used in bone_select_hierachy() */
|
|
|
|
|
#define BONE_SELECT_PARENT 0
|
|
|
|
|
#define BONE_SELECT_CHILD 1
|
|
|
|
|
|
2009-02-01 17:33:10 +00:00
|
|
|
/* armature_ops.c */
|
|
|
|
|
void ED_operatortypes_armature(void);
|
|
|
|
|
void ED_keymap_armature(struct wmWindowManager *wm);
|
|
|
|
|
|
2009-01-05 16:15:23 +00:00
|
|
|
/* editarmature.c */
|
2009-01-05 15:19:31 +00:00
|
|
|
void ED_armature_from_edit(struct Scene *scene, struct Object *obedit);
|
|
|
|
|
void ED_armature_to_edit(struct Object *ob);
|
|
|
|
|
void ED_armature_edit_free(struct Object *ob);
|
|
|
|
|
void ED_armature_edit_remake(struct Object *obedit);
|
2009-01-05 19:32:04 +00:00
|
|
|
int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
|
|
|
|
|
short hits, short extend);
|
|
|
|
|
void mouse_armature(struct bContext *C, short mval[2], int extend);
|
2009-01-10 14:19:14 +00:00
|
|
|
struct Bone *get_indexed_bone (struct Object *ob, int index);
|
2009-01-08 17:12:50 +00:00
|
|
|
float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]);
|
2009-02-06 10:48:00 +00:00
|
|
|
EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators
|
2009-01-08 17:12:50 +00:00
|
|
|
|
2009-02-25 14:50:40 +00:00
|
|
|
void add_primitive_bone(struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d);
|
|
|
|
|
|
2009-01-08 17:12:50 +00:00
|
|
|
void transform_armature_mirror_update(struct Object *obedit);
|
2009-01-10 19:34:23 +00:00
|
|
|
void clear_armature(struct Scene *scene, struct Object *ob, char mode);
|
|
|
|
|
void create_vgroups_from_armature(struct Scene *scene, struct Object *ob, struct Object *par);
|
|
|
|
|
void docenter_armature (struct Scene *scene, struct View3D *v3d, struct Object *ob, int centermode);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2009-01-14 16:13:50 +00:00
|
|
|
void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode);
|
2009-03-17 21:44:58 +00:00
|
|
|
void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */
|
2009-03-20 18:00:51 +00:00
|
|
|
void armature_bone_rename(struct Object *ob, char *oldnamep, char *newnamep);
|
2009-01-14 16:13:50 +00:00
|
|
|
|
2009-01-24 13:45:24 +00:00
|
|
|
void undo_push_armature(struct bContext *C, char *name);
|
|
|
|
|
|
2009-01-05 16:15:23 +00:00
|
|
|
/* poseobject.c */
|
2009-02-01 19:53:24 +00:00
|
|
|
void ED_armature_exit_posemode(struct bContext *C, struct Base *base);
|
|
|
|
|
void ED_armature_enter_posemode(struct bContext *C, struct Base *base);
|
2009-01-05 16:15:23 +00:00
|
|
|
int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
|
|
|
|
|
void ED_pose_deselectall(struct Object *ob, int test, int doundo);
|
|
|
|
|
|
2009-03-20 18:00:51 +00:00
|
|
|
/* sketch */
|
|
|
|
|
|
2009-03-22 00:30:18 +00:00
|
|
|
int ED_operator_sketch_mode_active_stroke(struct bContext *C);
|
|
|
|
|
int ED_operator_sketch_full_mode(struct bContext *C);
|
|
|
|
|
int ED_operator_sketch_mode(struct bContext *C);
|
|
|
|
|
|
|
|
|
|
void BIF_freeSketch(struct bContext *C);
|
2009-03-20 18:00:51 +00:00
|
|
|
void BIF_convertSketch(struct bContext *C);
|
|
|
|
|
void BIF_deleteSketch(struct bContext *C);
|
|
|
|
|
void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */
|
|
|
|
|
|
|
|
|
|
void BIF_makeListTemplates(struct bContext *C);
|
|
|
|
|
char *BIF_listTemplates(struct bContext *C);
|
|
|
|
|
int BIF_currentTemplate(struct bContext *C);
|
|
|
|
|
void BIF_freeTemplates(struct bContext *C);
|
|
|
|
|
void BIF_setTemplate(struct bContext *C, int index);
|
|
|
|
|
int BIF_nbJointsTemplate(struct bContext *C);
|
|
|
|
|
char * BIF_nameBoneTemplate(struct bContext *C);
|
|
|
|
|
|
2009-03-22 00:30:18 +00:00
|
|
|
void BDR_drawSketch(struct bContext *vc);
|
|
|
|
|
int BDR_drawSketchNames(struct ViewContext *vc);
|
2009-01-05 16:15:23 +00:00
|
|
|
|
2009-01-05 15:19:31 +00:00
|
|
|
#endif /* ED_ARMATURE_H */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|