Blender V2.61 - r43446
|
Blender kernel action and pose functionality. More...
#include "DNA_listBase.h"
Go to the source code of this file.
Typedefs | |
typedef enum eAction_TransformFlags | eAction_TransformFlags |
Enumerations | |
enum | eAction_TransformFlags { ACT_TRANS_LOC = (1<<0), ACT_TRANS_ROT = (1<<1), ACT_TRANS_SCALE = (1<<2), ACT_TRANS_PROP = (1<<3), ACT_TRANS_ONLY = (ACT_TRANS_LOC|ACT_TRANS_ROT|ACT_TRANS_SCALE), ACT_TRANS_ALL = (ACT_TRANS_ONLY|ACT_TRANS_PROP) } |
Functions | |
struct bAction * | add_empty_action (const char name[]) |
struct bAction * | copy_action (struct bAction *src) |
void | free_action (struct bAction *act) |
void | make_local_action (struct bAction *act) |
short | action_get_item_transforms (struct bAction *act, struct Object *ob, struct bPoseChannel *pchan, ListBase *curves) |
void | calc_action_range (const struct bAction *act, float *start, float *end, short incl_modifiers) |
short | action_has_motion (const struct bAction *act) |
struct bActionGroup * | get_active_actiongroup (struct bAction *act) |
void | set_active_action_group (struct bAction *act, struct bActionGroup *agrp, short select) |
struct bActionGroup * | action_groups_add_new (struct bAction *act, const char name[]) |
void | action_groups_add_channel (struct bAction *act, struct bActionGroup *agrp, struct FCurve *fcurve) |
void | action_groups_remove_channel (struct bAction *act, struct FCurve *fcu) |
struct bActionGroup * | action_groups_find_named (struct bAction *act, const char name[]) |
void | action_groups_clear_tempflags (struct bAction *act) |
void | free_pose_channel (struct bPoseChannel *pchan) |
void | free_pose_channels (struct bPose *pose) |
void | make_pose_channels_hash (struct bPose *pose) |
void | free_pose_channels_hash (struct bPose *pose) |
void | free_pose (struct bPose *pose) |
void | copy_pose (struct bPose **dst, struct bPose *src, int copyconstraints) |
void | duplicate_pose_channel_data (struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from) |
struct bPoseChannel * | get_pose_channel (const struct bPose *pose, const char *name) |
struct bPoseChannel * | get_active_posechannel (struct Object *ob) |
struct bPoseChannel * | verify_pose_channel (struct bPose *pose, const char *name) |
void | extract_pose_from_pose (struct bPose *pose, const struct bPose *src) |
void | update_pose_constraint_flags (struct bPose *pose) |
const char * | get_ikparam_name (struct bPose *pose) |
void | init_pose_ikparam (struct bPose *pose) |
void | init_pose_itasc (struct bItasc *itasc) |
void | framechange_poses_clear_unkeyed (void) |
void | pose_add_group (struct Object *ob) |
void | pose_remove_group (struct Object *ob) |
void | what_does_obaction (struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe) |
void | copy_pose_result (struct bPose *to, struct bPose *from) |
void | rest_pose (struct bPose *pose) |
typedef enum eAction_TransformFlags eAction_TransformFlags |
Definition at line 76 of file BKE_action.h.
short action_get_item_transforms | ( | struct bAction * | act, |
struct Object * | ob, | ||
struct bPoseChannel * | pchan, | ||
ListBase * | curves | ||
) |
Definition at line 948 of file action.c.
References ACT_TRANS_ALL, ACT_TRANS_LOC, ACT_TRANS_PROP, ACT_TRANS_ROT, ACT_TRANS_SCALE, BLI_addtail(), BLI_genericNodeN(), bAction::curves, ListBase::first, MEM_freeN(), FCurve::next, NULL, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_from_ID_to_struct(), RNA_pointer_create(), RNA_PoseBone, and strlen().
Referenced by fcurves_to_pchan_links_get().
void action_groups_add_channel | ( | struct bAction * | act, |
struct bActionGroup * | agrp, | ||
struct FCurve * | fcurve | ||
) |
Definition at line 283 of file action.c.
References BLI_insertlinkafter(), BLI_insertlinkbefore(), bActionGroup::channels, bAction::curves, ELEM3, ListBase::first, FCurve::grp, ListBase::last, FCurve::next, NULL, bActionGroup::prev, and FCurve::prev.
Referenced by action_move_fcurves_by_basepath(), AnimationImporter::add_bone_fcurve(), fcurve_add_to_list(), fcurve_path_rename(), and verify_fcurve().
struct bActionGroup* action_groups_add_new | ( | struct bAction * | act, |
const char | name[] | ||
) | [read] |
Definition at line 256 of file action.c.
References AGRP_SELECTED, BLI_addtail(), BLI_strncpy(), BLI_uniquename(), ELEM, bActionGroup::flag, bAction::groups, MEM_callocN(), bActionGroup::name, and NULL.
Referenced by action_move_fcurves_by_basepath(), and verify_fcurve().
void action_groups_clear_tempflags | ( | struct bAction * | act | ) |
Definition at line 397 of file action.c.
References AGRP_TEMP, ELEM, ListBase::first, bActionGroup::flag, bAction::groups, bActionGroup::next, and NULL.
Referenced by action_move_fcurves_by_basepath().
struct bActionGroup* action_groups_find_named | ( | struct bAction * | act, |
const char | name[] | ||
) | [read] |
Definition at line 386 of file action.c.
References BLI_findstring(), ELEM3, ListBase::first, bAction::groups, and NULL.
Referenced by action_move_fcurves_by_basepath(), AnimationImporter::add_bone_fcurve(), draw_motion_path_instance(), fcurve_add_to_list(), verify_fcurve(), and what_does_obaction().
Definition at line 349 of file action.c.
References BLI_remlink(), bActionGroup::channels, bAction::curves, ELEM, ListBase::first, FCurve::grp, ListBase::last, FCurve::next, NULL, and FCurve::prev.
Referenced by action_move_fcurves_by_basepath(), ANIM_fcurve_delete_from_animdata(), animchannels_delete_exec(), fcurve_path_rename(), and fcurve_remove().
short action_has_motion | ( | const struct bAction * | act | ) |
Referenced by BKE_nla_action_pushdown().
struct bAction* add_empty_action | ( | const char | name[] | ) | [read] |
Definition at line 82 of file action.c.
References alloc_libblock(), G, and ID_AC.
Referenced by act_new_exec(), BKE_animdata_separate_by_basepath(), do_versions_ipos_to_animato(), ipo_to_animdata(), poselib_init_new(), and verify_adt_action().
void calc_action_range | ( | const struct bAction * | act, |
float * | start, | ||
float * | end, | ||
short | incl_modifiers | ||
) |
Definition at line 180 of file action.c.
References BLI_addtail(), BLI_duplicatelist(), bActionGroup::channels, copy_fcurve(), copy_libblock(), bAction::curves, ListBase::first, bAction::groups, FCurve::grp, bAction::id, ListBase::last, bAction::markers, FCurve::next, bActionGroup::next, and NULL.
Referenced by act_new_exec(), BKE_copy_animdata(), BKE_copy_animdata_id_action(), id_copy(), make_local_action(), nlaedit_apply_scale_exec(), and node_group_ungroup().
Allocate a new pose on the heap, and copy the src pose and it's channels into the new pose. *dst is set to the newly allocated structure, and assumed to be NULL.
Definition at line 493 of file action.c.
References bPose::agroups, BLI_duplicatelist(), bPose::chanbase, bPoseChannel::constraints, copy_constraints(), ListBase::first, IDP_CopyProperty(), bPose::ikdata, bPose::ikparam, bPose::iksolver, MEM_callocN(), MEM_dupallocN(), bPoseChannel::mpath, bPoseChannel::next, NULL, bPoseChannel::prop, and TRUE.
Referenced by copy_object_pose(), draw_ghost_poses(), draw_ghost_poses_keys(), draw_ghost_poses_range(), pose_clear_user_transforms_exec(), and pose_copy_exec().
Definition at line 1096 of file action.c.
References bPoseChannel::chan_mat, bPose::chanbase, copy_m4_m4(), copy_qt_qt(), copy_v3_v3(), bPoseChannel::eul, ListBase::first, bPoseChannel::flag, get_pose_channel(), bPoseChannel::loc, bPoseChannel::name, bPoseChannel::next, NULL, bPoseChannel::pose_head, bPoseChannel::pose_mat, bPoseChannel::pose_tail, bPoseChannel::protectflag, bPoseChannel::quat, bPoseChannel::rotmode, and bPoseChannel::size.
Referenced by object_handle_update().
void duplicate_pose_channel_data | ( | struct bPoseChannel * | pchan, |
const struct bPoseChannel * | pchan_from | ||
) |
Copy the internal members of each pose channel including constraints and ID-Props, used when duplicating bones in editmode.
Referenced by duplicateEditBoneObjects().
Referenced by BL_ArmatureObject::GetMRDPose(), BL_ArmatureObject::GetPose(), and BL_ArmatureObject::SetPose().
void framechange_poses_clear_unkeyed | ( | void | ) |
Definition at line 772 of file action.c.
References bPoseChannel::bone, BONE_UNKEYED, bPose::chanbase, ListBase::first, Bone::flag, G, Object::id, bPoseChannel::next, ID::next, and Object::pose.
void free_action | ( | struct bAction * | act | ) |
Definition at line 160 of file action.c.
References BLI_freelistN(), bAction::curves, ListBase::first, free_fcurves(), bAction::groups, bAction::markers, and NULL.
Referenced by free_libblock().
void free_pose | ( | struct bPose * | pose | ) |
Removes and deallocates all data from a pose, and also frees the pose.
Definition at line 621 of file action.c.
References bPose::agroups, BIK_clear_data(), BLI_freelistN(), ListBase::first, free_pose_channels(), bPose::ikparam, and MEM_freeN().
Referenced by actcon_get_tarmat(), draw_ghost_poses(), draw_ghost_poses_keys(), draw_ghost_poses_range(), free_object(), and lib_link_object().
void free_pose_channel | ( | struct bPoseChannel * | pchan | ) |
Deallocates a pose channel. Does not free the pose channel itself.
Definition at line 591 of file action.c.
References animviz_free_motionpath(), bPoseChannel::constraints, free_constraints(), IDP_FreeProperty(), MEM_freeN(), bPoseChannel::mpath, NULL, and bPoseChannel::prop.
Referenced by armature_delete_selected_exec(), armature_rebuild_pose(), free_pose_channels(), pose_proxy_synchronize(), and separate_armature_bones().
void free_pose_channels | ( | struct bPose * | pose | ) |
Removes and deallocates all channels from a pose. Does not free the pose itself.
Definition at line 607 of file action.c.
References BLI_freelistN(), bPose::chanbase, ListBase::first, free_pose_channel(), free_pose_channels_hash(), and bPoseChannel::next.
Referenced by free_pose(), and game_free_pose().
void free_pose_channels_hash | ( | struct bPose * | pose | ) |
Definition at line 582 of file action.c.
References BLI_ghash_free(), bPose::chanhash, and NULL.
Referenced by armature_delete_selected_exec(), armature_rebuild_pose(), free_pose_channels(), join_armature_exec(), separate_armature_bones(), and verify_pose_channel().
struct bActionGroup* get_active_actiongroup | ( | struct bAction * | act | ) | [read] |
Definition at line 223 of file action.c.
References AGRP_ACTIVE, ListBase::first, bActionGroup::flag, bAction::groups, bActionGroup::next, and NULL.
struct bPoseChannel* get_active_posechannel | ( | struct Object * | ob | ) | [read] |
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)
Definition at line 463 of file action.c.
References bArmature::act_bone, bPose::chanbase, Object::data, ELEM3, ListBase::first, bArmature::layer, NULL, and Object::pose.
Referenced by child_get_inverse_matrix(), constraint_add_exec(), do_view3d_region_buttons(), draw_constraint(), ed_screen_context(), edit_constraint_property_get(), get_active_constraints(), get_new_constraint_target(), gimbal_axis(), parent_set_exec(), pose_ik_add_invoke(), and v3d_posearmature_buts().
const char* get_ikparam_name | ( | struct bPose * | pose | ) |
Definition at line 480 of file action.c.
References bPose::iksolver, IKSOLVER_ITASC, IKSOLVER_LEGACY, and NULL.
Referenced by write_pose().
struct bPoseChannel* get_pose_channel | ( | const struct bPose * | pose, |
const char * | name | ||
) | [read] |
Return a pointer to the pose channel of the given name from this pose.
Referenced by add_verts_to_dgroups(), animchan_sync_fcurve(), animchan_sync_group(), AnimationImporter::apply_matrix_curves(), applyModifier(), armature_deform_verts(), BL_SkinDeformer::BGEDeformVerts(), bone_skinnable_cb(), buttons_context_path_pose_bone(), constraint_target_to_mat4(), copy_pose_result(), AnimationExporter::create_4x4_source(), DAG_pose_sort(), deformVerts_do(), dgroup_skinnable_cb(), dtar_get_pchan_ptr(), dvar_eval_locDiff(), dvar_eval_transChan(), ED_armature_bone_rename(), get_armature_bone_constraint(), SkinInfo::get_pose_channel_from_node(), get_selected_defgroups(), BL_ArmatureObject::GetBoneMatrix(), ob_parbone(), object_hook_reset_exec(), pose_bone_do_paste(), pose_bone_flip_active_exec(), pose_channel_in_IK_chain(), pose_grab_with_ik_children(), pose_proxy_synchronize(), pose_select_constraint_target_exec(), pose_select_same_keyingset(), poselib_apply_pose(), poselib_backup_posecopy(), poselib_keytag_pose(), rebuild_pose_bone(), AnimationExporter::sample_and_write_bone_animation(), AnimationExporter::sample_and_write_bone_animation_matrix(), AnimationExporter::sample_animation(), setviewmatrixview3d(), skip_fcurve_selected_data(), AnimationImporter::translate_animation_OLD(), AnimationImporter::translate_Animations(), and wpaint_stroke_test_start().
void init_pose_ikparam | ( | struct bPose * | pose | ) |
Definition at line 555 of file action.c.
References bPose::ikparam, bPose::iksolver, IKSOLVER_ITASC, IKSOLVER_LEGACY, init_pose_itasc(), MEM_callocN(), and NULL.
void init_pose_itasc | ( | struct bItasc * | itasc | ) |
Definition at line 538 of file action.c.
References bItasc::dampeps, bItasc::dampmax, bItasc::feedback, bItasc::flag, bItasc::iksolver, IKSOLVER_ITASC, ITASC_AUTO_STEP, ITASC_INITIAL_REITERATION, ITASC_SOLVER_SDLS, bItasc::maxstep, bItasc::maxvel, bItasc::minstep, bItasc::numiter, bItasc::numstep, bItasc::precision, and bItasc::solver.
Referenced by get_ikdata(), and init_pose_ikparam().
void make_local_action | ( | struct bAction * | act | ) |
Definition at line 129 of file action.c.
References tMakeLocalActionContext::act_new, BKE_animdata_main_cb(), BKE_id_lib_local_paths(), copy_action(), FALSE, ID::flag, G, bAction::id, id_clear_lib_data(), tMakeLocalActionContext::is_lib, tMakeLocalActionContext::is_local, ID::lib, LIB_FAKEUSER, make_localact_apply_cb(), make_localact_init_cb(), NULL, and ID::us.
Referenced by BKE_animdata_make_local(), id_make_local(), and make_local_strips().
void make_pose_channels_hash | ( | struct bPose * | pose | ) |
Removes the hash for quick lookup of channels, must be done when adding/removing channels.
Definition at line 571 of file action.c.
References BLI_ghash_insert(), BLI_ghash_new(), BLI_ghashutil_strcmp(), BLI_ghashutil_strhash(), bPose::chanbase, bPose::chanhash, ListBase::first, bPoseChannel::name, and bPoseChannel::next.
Referenced by armature_rebuild_pose(), game_copy_pose(), and object_handle_update().
void pose_add_group | ( | struct Object * | ob | ) |
Definition at line 794 of file action.c.
References bPose::active_group, bPose::agroups, BLI_addtail(), BLI_countlist(), BLI_strncpy(), BLI_uniquename(), ELEM, if(), MEM_callocN(), NULL, and Object::pose.
Referenced by pose_group_add_exec(), and pose_group_assign_exec().
void pose_remove_group | ( | struct Object * | ob | ) |
Definition at line 811 of file action.c.
References bPose::active_group, bPose::agroups, BLI_findlink(), BLI_freelinkN(), bPose::chanbase, ELEM, ListBase::first, if(), NULL, and Object::pose.
Referenced by pose_group_remove_exec().
void rest_pose | ( | struct bPose * | pose | ) |
Definition at line 1074 of file action.c.
References bPose::chanbase, bPose::cyclic_offset, bPoseChannel::eul, ListBase::first, bPoseChannel::flag, bPoseChannel::loc, bPoseChannel::next, POSE_LOC, POSE_ROT, POSE_SIZE, bPoseChannel::quat, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::size, bPose::stride_offset, unit_axis_angle(), unit_qt(), and zero_v3().
Referenced by convert_tree(), object_make_proxy(), pose_clear_user_transforms_exec(), and pose_proxy_synchronize().
void set_active_action_group | ( | struct bAction * | act, |
struct bActionGroup * | agrp, | ||
short | select | ||
) |
Definition at line 238 of file action.c.
References AGRP_ACTIVE, ListBase::first, bActionGroup::flag, bAction::groups, bActionGroup::next, and NULL.
void update_pose_constraint_flags | ( | struct bPose * | pose | ) |
Definition at line 711 of file action.c.
References bPoseChannel::bone, BONE_CONNECTED, bPose::chanbase, bPoseChannel::constflag, CONSTRAINT_IK_TIP, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK, bPoseChannel::constraints, data, bConstraint::data, ListBase::first, bPose::flag, bKinematicConstraint::flag, Bone::flag, if(), bPoseChannel::next, bConstraint::next, NULL, OB_ARMATURE, OB_CURVE, bPoseChannel::parent, PCHAN_HAS_CONST, PCHAN_HAS_IK, PCHAN_HAS_SPLINEIK, PCHAN_HAS_TARGET, POSE_CONSTRAINTS_TIMEDEPEND, bKinematicConstraint::rootbone, bKinematicConstraint::subtarget, bKinematicConstraint::tar, bFollowPathConstraint::tar, bConstraint::type, and Object::type.
Referenced by armature_rebuild_pose(), constraint_add_exec(), and ED_object_constraint_update().
struct bPoseChannel* verify_pose_channel | ( | struct bPose * | pose, |
const char * | name | ||
) | [read] |
Looks to see if the channel with the given name already exists in this pose - if not a new one is allocated and initialized.
Definition at line 426 of file action.c.
References BLI_addtail(), BLI_findstring(), BLI_strncpy(), bPose::chanbase, bPoseChannel::constinv, free_pose_channels_hash(), bPoseChannel::iklinweight, bPoseChannel::ikrotweight, bPoseChannel::limitmax, bPoseChannel::limitmin, MEM_callocN(), bPoseChannel::name, NULL, OB_LOCK_ROT4D, bPoseChannel::protectflag, bPoseChannel::quat, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::size, bPoseChannel::stiffness, unit_axis_angle(), unit_m4(), and unit_qt().
Referenced by actcon_get_tarmat(), duplicateEditBoneObjects(), rebuild_pose_bone(), and updateDuplicateSubtargetObjects().
void what_does_obaction | ( | struct Object * | ob, |
struct Object * | workob, | ||
struct bPose * | pose, | ||
struct bAction * | act, | ||
char | groupname[], | ||
float | cframe | ||
) |
Definition at line 1136 of file action.c.
References AnimData::action, action_groups_find_named(), Object::adt, ADT_RECALC_ANIM, animsys_evaluate_action_group(), BKE_animsys_evaluate_animdata(), BLI_strncpy(), clear_workob(), Object::constinv, Object::constraints, copy_m4_m4(), ListBase::first, Object::id, ListBase::last, ID::name, NULL, Object::obmat, Object::par1, Object::par2, Object::par3, Object::parent, Object::parentinv, Object::parsubstr, Object::partype, Object::pose, AnimData::recalc, RNA_id_pointer_create(), Object::rotmode, Object::trackflag, and Object::upflag.
Referenced by actcon_get_tarmat().