Blender V2.61 - r43446
|
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stddef.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_anim.h"
#include "BKE_constraint.h"
#include "BKE_global.h"
#include "BKE_fcurve.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_idprop.h"
#include "BIK_api.h"
#include "RNA_access.h"
Go to the source code of this file.
Definition in file action.c.
typedef struct tMakeLocalActionContext tMakeLocalActionContext |
short action_get_item_transforms | ( | bAction * | act, |
Object * | ob, | ||
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 | ( | bAction * | act, |
bActionGroup * | agrp, | ||
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().
bActionGroup* action_groups_add_new | ( | 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 | ( | 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().
bActionGroup* action_groups_find_named | ( | 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 bAction * | act | ) |
Definition at line 849 of file action.c.
References bAction::curves, ListBase::first, FCurve::next, and FCurve::totvert.
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 bAction * | act, |
float * | start, | ||
float * | end, | ||
short | incl_modifiers | ||
) |
Definition at line 866 of file action.c.
References FMod_Cycles::after_mode, FMod_Cycles::before_mode, calc_fcurve_range(), bAction::curves, FModifier::data, FALSE, FCM_EXTRAPOLATE_NONE, FCM_LIMIT_XMAX, FCM_LIMIT_XMIN, ListBase::first, FMod_Limits::flag, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_LIMITS, if(), ListBase::last, max, MAX2, MAXFRAMEF, min, MIN2, MINAFRAMEF, FCurve::modifiers, FCurve::next, FMod_Limits::rect, FCurve::totvert, TRUE, FModifier::type, rctf::xmax, and rctf::xmin.
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().
static void copy_pose_channel_data | ( | bPoseChannel * | pchan, |
const bPoseChannel * | chan | ||
) | [static] |
Definition at line 643 of file action.c.
References bPoseChannel::chan_mat, bPoseChannel::constraints, copy_m4_m4(), copy_qt_qt(), copy_v3_v3(), bConstraint::enforce, bPoseChannel::eul, ListBase::first, bPoseChannel::flag, bConstraint::headtail, bPoseChannel::loc, bConstraint::next, bPoseChannel::pose_mat, bPoseChannel::quat, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::rotmode, and bPoseChannel::size.
Referenced by extract_pose_from_pose().
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 | ( | bPoseChannel * | pchan, |
const bPoseChannel * | pchan_from | ||
) |
Definition at line 668 of file action.c.
References bPoseChannel::agrp_index, bPoseChannel::constraints, copy_constraints(), copy_v3_v3(), bPoseChannel::custom, IDP_CopyProperty(), IDP_FreeProperty(), bPoseChannel::ikflag, bPoseChannel::iklinweight, bPoseChannel::ikrotweight, bPoseChannel::ikstretch, bPoseChannel::limitmax, bPoseChannel::limitmin, MEM_freeN(), NULL, bPoseChannel::prop, bPoseChannel::protectflag, bPoseChannel::rotmode, bPoseChannel::stiffness, and TRUE.
Definition at line 1058 of file action.c.
References bPose::chanbase, copy_pose_channel_data(), ListBase::first, and bPoseChannel::next.
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 | ( | 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 | ( | 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().
bActionGroup* get_active_actiongroup | ( | bAction * | act | ) | [read] |
Definition at line 223 of file action.c.
References AGRP_ACTIVE, ListBase::first, bActionGroup::flag, bAction::groups, bActionGroup::next, and NULL.
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 | ( | bPose * | pose | ) |
Definition at line 480 of file action.c.
References bPose::iksolver, IKSOLVER_ITASC, IKSOLVER_LEGACY, and NULL.
Referenced by write_pose().
bPoseChannel* get_pose_channel | ( | const bPose * | pose, |
const char * | name | ||
) |
Definition at line 413 of file action.c.
References BLI_findstring(), BLI_ghash_lookup(), bPose::chanhash, ELEM, and NULL.
void init_pose_ikparam | ( | 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 | ( | 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 | ( | 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().
Definition at line 114 of file action.c.
References tMakeLocalActionContext::act, tMakeLocalActionContext::act_new, AnimData::action, bAction::id, id_us_min(), id_us_plus(), ID::lib, and NULL.
Referenced by make_local_action().
Definition at line 103 of file action.c.
References tMakeLocalActionContext::act, AnimData::action, tMakeLocalActionContext::is_lib, tMakeLocalActionContext::is_local, ID::lib, and TRUE.
Referenced by make_local_action().
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 | ( | 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 | ( | 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 | ( | 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 | ( | bAction * | act, |
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 | ( | 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().
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 | ( | Object * | ob, |
Object * | workob, | ||
bPose * | pose, | ||
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().