diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_action.h')
-rw-r--r-- | source/blender/blenkernel/BKE_action.h | 108 |
1 files changed, 48 insertions, 60 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 37ced4cb00b..67eb2ed58bf 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -26,6 +26,7 @@ * All rights reserved. * * Contributor(s): Full recode, Ton Roosendaal, Crete 2005 + * Full recode, Joshua Leung, 2009 * * ***** END GPL LICENSE BLOCK ***** */ @@ -35,15 +36,14 @@ #include "DNA_listBase.h" -/** - * The following structures are defined in DNA_action_types.h - */ - +/* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */ struct bAction; -struct bActionChannel; +struct bActionGroup; +struct FCurve; struct bPose; struct bPoseChannel; struct Object; +struct Scene; struct ID; /* Kernel prototypes */ @@ -51,6 +51,39 @@ struct ID; extern "C" { #endif +/* Action API ----------------- */ + +/* Allocate a new bAction with the given name */ +struct bAction *add_empty_action(const char name[]); + +/* Allocate a copy of the given Action and all its data */ +struct bAction *copy_action(struct bAction *src); + +/* Deallocate all of the Action's data, but not the Action itself */ +void free_action(struct bAction *act); + +// XXX is this needed? +void make_local_action(struct bAction *act); + +/* Some kind of bounding box operation on the action */ +void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden); + +/* Action Groups API ----------------- */ + +/* Make the given Action Group the active one */ +void set_active_action_group(struct bAction *act, struct bActionGroup *agrp, short select); + +/* Add given channel into (active) group */ +void action_groups_add_channel(struct bAction *act, struct bActionGroup *agrp, struct FCurve *fcurve); + +/* Remove the given channel from all groups */ +void action_groups_remove_channel(struct bAction *act, struct FCurve *fcu); + +/* Find a group with the given name */ +struct bActionGroup *action_groups_find_named(struct bAction *act, const char name[]); + + +/* Pose API ----------------- */ /** * Removes and deallocates all channels from a pose. @@ -70,20 +103,6 @@ void free_pose(struct bPose *pose); void copy_pose(struct bPose **dst, struct bPose *src, int copyconstraints); -/** - * Deallocate the action's channels including constraint channels. - * does not free the action structure. - */ -void free_action(struct bAction * id); - -void make_local_action(struct bAction *act); - -/* only for armatures, doing pose actions only too */ -void do_all_pose_actions(struct Object *); -/* only for objects, doing only 1 channel */ -void do_all_object_actions(struct Object *); -/* only for Mesh, Curve, Surface, Lattice, doing only Shape channel */ -void do_all_shape_actions(struct Object *); /** @@ -92,6 +111,12 @@ void do_all_shape_actions(struct Object *); */ struct bPoseChannel *get_pose_channel(const struct bPose *pose, const char *name); + +/** + * Return a pointer to the active pose channel from this Object. + * (Note: Object, not bPose is used here, as we need layer info from Armature) + */ +struct bPoseChannel *get_active_posechannel(struct Object *ob); /** * Looks to see if the channel with the given name @@ -105,45 +130,11 @@ struct bPoseChannel *verify_pose_channel(struct bPose* pose, void update_pose_constraint_flags(struct bPose *pose); /* clears BONE_UNKEYED flags for frame changing */ +// XXX to be depreceated for a more general solution in animsys... void framechange_poses_clear_unkeyed(void); -/** - * Allocate a new bAction on the heap and copy - * the contents of src into it. If src is NULL NULL is returned. - */ - -struct bAction *copy_action(struct bAction *src); - -/** - * Some kind of bounding box operation on the action. - */ -void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden); - -/** - * Set the pose channels from the given action. - */ -void extract_pose_from_action(struct bPose *pose, struct bAction *act, float ctime); - -/** - * Get the effects of the given action using a workob - */ -void what_does_obaction(struct Object *ob, struct bAction *act, float cframe); - -/** - * Iterate through the action channels of the action - * and return the channel with the given name. - * Returns NULL if no channel. - */ -struct bActionChannel *get_action_channel(struct bAction *act, const char *name); -/** - * Iterate through the action channels of the action - * and return the channel with the given name. - * Returns and adds new channel if no channel. - */ -struct bActionChannel *verify_action_channel(struct bAction *act, const char *name); - - /* baking */ -struct bAction *bake_obIPO_to_action(struct Object *ob); +/* Used for the Action Constraint */ +void what_does_obaction(struct Scene *scene, struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe); /* exported for game engine */ void blend_poses(struct bPose *dst, struct bPose *src, float srcweight, short mode); @@ -158,10 +149,7 @@ void rest_pose(struct bPose *pose); float get_action_frame(struct Object *ob, float cframe); /* map strip time to global time (frame nr) */ float get_action_frame_inv(struct Object *ob, float cframe); -/* builds a list of NlaIpoChannel with ipo values to write in datablock */ -void extract_ipochannels_from_action(ListBase *lb, struct ID *id, struct bAction *act, const char *name, float ctime); -/* write values returned by extract_ipochannels_from_action, returns the number of value written */ -int execute_ipochannels(ListBase *lb); + /* functions used by the game engine */ void game_copy_pose(struct bPose **dst, struct bPose *src); |