1 /* BKE_action.h May 2001
3 * Blender kernel action functionality
9 * ***** BEGIN GPL LICENSE BLOCK *****
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
26 * All rights reserved.
28 * Contributor(s): Full recode, Ton Roosendaal, Crete 2005
29 * Full recode, Joshua Leung, 2009
31 * ***** END GPL LICENSE BLOCK *****
37 #include "DNA_listBase.h"
39 /* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */
49 /* Kernel prototypes */
54 /* Action API ----------------- */
56 /* Allocate a new bAction with the given name */
57 struct bAction *add_empty_action(const char name[]);
59 /* Allocate a copy of the given Action and all its data */
60 struct bAction *copy_action(struct bAction *src);
62 /* Deallocate all of the Action's data, but not the Action itself */
63 void free_action(struct bAction *act);
65 // XXX is this needed?
66 void make_local_action(struct bAction *act);
68 /* Some kind of bounding box operation on the action */
69 void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden);
71 /* Does action have any motion data at all? */
72 short action_has_motion(const struct bAction *act);
74 /* Action Groups API ----------------- */
76 /* Make the given Action Group the active one */
77 void set_active_action_group(struct bAction *act, struct bActionGroup *agrp, short select);
79 /* Add given channel into (active) group */
80 void action_groups_add_channel(struct bAction *act, struct bActionGroup *agrp, struct FCurve *fcurve);
82 /* Remove the given channel from all groups */
83 void action_groups_remove_channel(struct bAction *act, struct FCurve *fcu);
85 /* Find a group with the given name */
86 struct bActionGroup *action_groups_find_named(struct bAction *act, const char name[]);
89 /* Pose API ----------------- */
92 * Removes and deallocates all channels from a pose.
93 * Does not free the pose itself.
95 void free_pose_channels(struct bPose *pose);
98 * Removes and deallocates all data from a pose, and also frees the pose.
100 void free_pose(struct bPose *pose);
103 * Allocate a new pose on the heap, and copy the src pose and it's channels
104 * into the new pose. *dst is set to the newly allocated structure, and assumed to be NULL.
106 void copy_pose(struct bPose **dst, struct bPose *src,
107 int copyconstraints);
112 * Return a pointer to the pose channel of the given name
115 struct bPoseChannel *get_pose_channel(const struct bPose *pose,
119 * Return a pointer to the active pose channel from this Object.
120 * (Note: Object, not bPose is used here, as we need layer info from Armature)
122 struct bPoseChannel *get_active_posechannel(struct Object *ob);
125 * Looks to see if the channel with the given name
126 * already exists in this pose - if not a new one is
127 * allocated and initialized.
129 struct bPoseChannel *verify_pose_channel(struct bPose* pose,
132 /* sets constraint flags */
133 void update_pose_constraint_flags(struct bPose *pose);
135 /* clears BONE_UNKEYED flags for frame changing */
136 // XXX to be depreceated for a more general solution in animsys...
137 void framechange_poses_clear_unkeyed(void);
139 /* Used for the Action Constraint */
140 void what_does_obaction(struct Scene *scene, struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe);
142 /* exported for game engine */
143 void game_blend_poses(struct bPose *dst, struct bPose *src, float srcweight/*, short mode*/); /* was blend_poses */
144 void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);
147 void copy_pose_result(struct bPose *to, struct bPose *from);
148 /* clear all transforms */
149 void rest_pose(struct bPose *pose);
151 /* functions used by the game engine */
152 void game_copy_pose(struct bPose **dst, struct bPose *src);
153 void game_free_pose(struct bPose *pose);