Blender
V3.3
|
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_session_uuid.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_anim_visualization.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_asset.h"
#include "BKE_constraint.h"
#include "BKE_deform.h"
#include "BKE_fcurve.h"
#include "BKE_icons.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "BIK_api.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "RNA_prototypes.h"
#include "BLO_read_write.h"
#include "CLG_log.h"
Go to the source code of this file.
Macros | |
#define | DNA_DEPRECATED_ALLOW |
Variables | |
static CLG_LogRef | LOG = {"bke.action"} |
static AssetTypeInfo | AssetType_AC |
IDTypeInfo | IDType_ID_AC |
|
static |
Definition at line 287 of file action.c.
References action_asset_type_property(), BKE_asset_metadata_idprop_ensure(), BLI_assert, GS, bAction::id, ID_AC, and ID::name.
|
static |
Definition at line 276 of file action.c.
References BKE_action_has_single_frame(), IDPropertyTemplate::i, IDP_INT, and IDP_New().
Referenced by action_asset_pre_save().
|
static |
Definition at line 193 of file action.c.
References BKE_fcurve_blend_read_data(), BKE_previewimg_blend_read(), BLO_read_data_address, BLO_read_list(), bAction::curves, bAction::groups, LISTBASE_FOREACH, bAction::markers, and bAction::preview.
|
static |
Definition at line 255 of file action.c.
References BKE_fcurve_blend_read_expand(), blend_read_expand_constraint_channels(), BLO_expand, bAction::curves, LISTBASE_FOREACH, and bAction::markers.
|
static |
Definition at line 228 of file action.c.
References BKE_fcurve_blend_read_lib(), blend_read_lib_constraint_channels(), BLO_read_id_address, bAction::curves, bAction::id, ID::lib, LISTBASE_FOREACH, and bAction::markers.
|
static |
Definition at line 173 of file action.c.
References BKE_fcurve_blend_write(), BKE_id_blend_write(), BKE_previewimg_blend_write(), BLO_write_id_struct, BLO_write_struct, bAction::curves, bAction::groups, bAction::id, LISTBASE_FOREACH, bAction::markers, and bAction::preview.
|
static |
Only copy internal data of Action ID from source to already allocated/initialized destination. You probably never want to use that directly, use BKE_id_copy or BKE_id_copy_ex for typical needs.
WARNING! This function will not handle ID user count!
flag | Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more). |
Definition at line 92 of file action.c.
References BKE_fcurve_copy(), BKE_previewimg_id_copy(), BLI_addtail(), BLI_duplicatelist(), BLI_listbase_clear(), bActionGroup::channels, bAction::curves, ListBase::first, bAction::groups, FCurve::grp, bAction::id, ListBase::last, LIB_ID_COPY_NO_PREVIEW, bAction::markers, bActionGroup::next, FCurve::next, NULL, and bAction::preview.
|
static |
Definition at line 160 of file action.c.
References BKE_fcurve_foreach_id(), BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL, BKE_LIB_FOREACHID_PROCESS_IDSUPER, bAction::curves, data, IDWALK_CB_NOP, LISTBASE_FOREACH, and bAction::markers.
Free (or release) any data used by this action (does not free the action itself).
Definition at line 143 of file action.c.
References BKE_fcurves_free(), BKE_previewimg_free(), BLI_freelistN(), bAction::curves, bAction::groups, bAction::markers, and bAction::preview.
short action_get_item_transforms | ( | struct bAction * | act, |
struct Object * | ob, | ||
struct bPoseChannel * | pchan, | ||
ListBase * | curves | ||
) |
Return flags indicating which transforms the given object/posechannel has
Definition at line 1501 of file action.c.
References ACT_TRANS_ALL, ACT_TRANS_BBONE, ACT_TRANS_LOC, ACT_TRANS_PROP, ACT_TRANS_ROT, ACT_TRANS_SCALE, BLI_addtail(), BLI_genericNodeN(), bAction::curves, curves, ListBase::first, MEM_freeN, FCurve::next, NULL, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_from_ID_to_struct(), and RNA_pointer_create().
Referenced by fcurves_to_pchan_links_get().
void action_group_colors_sync | ( | bActionGroup * | grp, |
const bActionGroup * | ref_grp | ||
) |
Definition at line 380 of file action.c.
References ThemeWireColor::active, bActionGroup::cs, bActionGroup::customCol, rgba_uchar_args_set(), ThemeWireColor::select, ThemeWireColor::solid, and bTheme::tarm.
void action_groups_add_channel | ( | struct bAction * | act, |
struct bActionGroup * | agrp, | ||
struct FCurve * | fcurve | ||
) |
Add given channel into (active) group
Definition at line 435 of file action.c.
References BLI_insertlinkafter(), BLI_insertlinkbefore(), BLI_listbase_is_empty(), bActionGroup::channels, bAction::curves, ELEM, 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(), animchannels_group_channels(), ED_action_fcurve_ensure(), fcurve_add_to_list(), and updateDuplicateActionConstraintSettings().
bActionGroup* action_groups_add_new | ( | struct bAction * | act, |
const char | name[] | ||
) |
Add a new action group with the given name to the action>
Definition at line 410 of file action.c.
References AGRP_SELECTED, BLI_addtail(), BLI_strncpy(), BLI_uniquename(), DATA_, ELEM, bActionGroup::flag, bAction::groups, MEM_callocN, bActionGroup::name, and NULL.
Referenced by action_move_fcurves_by_basepath(), animchannels_group_channels(), ED_action_fcurve_ensure(), and updateDuplicateActionConstraintSettings().
Clear all 'temp' flags on all groups.
Definition at line 593 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().
Remove the given channel from all groups.
Definition at line 542 of file action.c.
References BLI_listbase_clear(), 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(), animchannels_group_channels(), animchannels_ungroup_exec(), BKE_action_fcurves_clear(), fcurve_path_rename(), fcurve_remove(), and remove_sequencer_fcurves().
Definition at line 1335 of file action.c.
References bAction::curves, ListBase::first, FCurve::next, and FCurve::totvert.
Definition at line 332 of file action.c.
References BKE_id_new(), and ID_AC.
Referenced by action_create_new(), BKE_animdata_transfer_by_basepath(), do_versions_ipos_to_animato(), ED_id_action_ensure(), ipo_to_animdata(), and poselib_init_new().
Remove all fcurves from the action.
Definition at line 1988 of file action.c.
References action_groups_remove_channel(), BKE_fcurve_free(), bAction::curves, DEG_id_tag_update(), ListBase::first, bAction::id, and ID_RECALC_ANIMATION_NO_FLUSH.
Definition at line 1480 of file action.c.
References ACT_FRAME_RANGE, calc_action_range(), bAction::flag, bAction::frame_end, and bAction::frame_start.
Referenced by BKE_nlastrip_new(), and BKE_nlastrip_recalculate_bounds_sync_action().
bActionGroup* BKE_action_group_find_name | ( | struct bAction * | act, |
const char | name[] | ||
) |
Find a group with the given name.
Definition at line 582 of file action.c.
References BLI_findstring(), ELEM, ListBase::first, bAction::groups, and NULL.
Referenced by action_move_fcurves_by_basepath(), AnimationImporter::add_bone_fcurve(), animviz_calc_motionpaths(), ED_action_fcurve_ensure(), fcurve_add_to_list(), updateDuplicateActionConstraintSettings(), and what_does_obaction().
Reconstruct group channel pointers. Assumes that the groups referred to by the FCurves are already in act->groups. Reorders the main channel list to match group order.
Definition at line 503 of file action.c.
References BLI_addtail(), BLI_assert, BLI_findindex(), BLI_listbase_clear(), BLI_movelisttolist(), bAction::curves, ELEM, ListBase::first, bAction::groups, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, and NULL.
Referenced by blo_do_versions_300(), curve_rename_fcurves(), and blender::bke::tests::TEST().
Return whether the action has one unique point in time keyed.
This is mostly for the pose library, which will have different behavior depending on whether an Action corresponds to a "pose" (one keyframe) or "animation snippet" (multiple keyframes).
false
when there is no keyframe at all or keys on different points in time, true
when exactly one point in time is keyed. Definition at line 1352 of file action.c.
References BLI_listbase_is_empty(), compare_ff(), bAction::curves, LISTBASE_FOREACH, and NULL.
Referenced by action_asset_type_property(), and blender::bke::tests::TEST().
Is the action configured as cyclic.
Definition at line 1496 of file action.c.
References ACT_CYCLIC, ACT_FRAME_RANGE, and bAction::flag.
Referenced by BKE_nlastrip_new(), and insert_keyframe_fcurve_value().
bActionGroup* BKE_pose_add_group | ( | struct bPose * | pose, |
const char * | name | ||
) |
Adds a new bone-group (name may be NULL).
Definition at line 1266 of file action.c.
References bPose::active_group, bPose::agroups, BLI_addtail(), BLI_listbase_count(), BLI_strncpy(), BLI_uniquename(), DATA_, MEM_callocN, and bActionGroup::name.
Referenced by pose_group_add_exec(), and pose_group_assign_exec().
void BKE_pose_blend_read_data | ( | BlendDataReader * | reader, |
bPose * | pose | ||
) |
Definition at line 1884 of file action.c.
References bPose::agroups, animviz_motionpath_blend_read_data(), BKE_constraint_blend_read_data(), BKE_pose_channel_runtime_reset(), BKE_pose_channel_session_uuid_generate(), BLI_listbase_clear(), BLO_read_data_address, BLO_read_list(), bPose::chan_array, bPose::chanbase, bPose::chanhash, CLAMP, IDP_BlendDataRead, bPose::ikdata, bPose::ikparam, LISTBASE_FOREACH, NULL, ROT_MODE_MAX, and ROT_MODE_MIN.
Referenced by object_blend_read_data().
void BKE_pose_blend_read_expand | ( | BlendExpander * | expander, |
bPose * | pose | ||
) |
Definition at line 1975 of file action.c.
References BKE_constraint_blend_read_expand(), BLO_expand, bPose::chanbase, IDP_BlendReadExpand(), and LISTBASE_FOREACH.
Referenced by object_blend_read_expand().
void BKE_pose_blend_read_lib | ( | BlendLibReader * | reader, |
Object * | ob, | ||
bPose * | pose | ||
) |
Definition at line 1932 of file action.c.
References BKE_armature_find_bone_name(), BKE_constraint_blend_read_lib(), BKE_pose_tag_recalc(), BLO_read_id_address, BLO_read_lib_get_main(), BLO_read_lib_is_undo(), BONE_SELECTED, bPose::chanbase, Object::constraints, Object::data, DEG_id_tag_update_ex(), bArmature::id, Object::id, ID_IS_LINKED, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, IDP_BlendReadLib(), ID::lib, LISTBASE_FOREACH, NULL, and UNLIKELY.
Referenced by object_blend_read_lib().
void BKE_pose_blend_write | ( | BlendWriter * | writer, |
bPose * | pose, | ||
bArmature * | arm | ||
) |
Definition at line 1832 of file action.c.
References bPose::agroups, animviz_motionpath_blend_write(), BKE_armature_find_bone_name(), BKE_constraint_blend_write(), BKE_pose_ikparam_get_name(), BLI_assert, BLO_write_struct, BLO_write_struct_by_name(), BONE_SELECTED, bPose::chanbase, bPose::flag, Bone::flag, IDP_BlendWrite(), bPose::ikparam, LISTBASE_FOREACH, NULL, and POSE_RECALC.
Referenced by object_blend_write().
bPoseChannel* BKE_pose_channel_active | ( | struct Object * | ob, |
bool | check_arm_layer | ||
) |
Find the active pose-channel for an object
check_arm_layer | checks if the bone is on a visible armature layer (this might be skipped (e.g. for "Show Active" from the Outliner). |
Definition at line 699 of file action.c.
References bArmature::act_bone, BKE_pose_is_layer_visible(), bPose::chanbase, Object::data, ELEM, ListBase::first, if(), NULL, and Object::pose.
Referenced by BKE_pose_channel_active_if_layer_visible(), and outliner_show_active_get_element().
bPoseChannel* BKE_pose_channel_active_if_layer_visible | ( | struct Object * | ob | ) |
Find the active pose-channel for an object if it is on a visible armature layer (calls BKE_pose_channel_active with check_arm_layer set to true)
Definition at line 720 of file action.c.
References BKE_pose_channel_active().
Referenced by add_hook_object(), BKE_pose_channel_active_or_first_selected(), constraint_add_exec(), ED_object_calc_active_center_for_posemode(), ED_object_constraint_active_list(), ED_object_parent_set(), ED_transform_calc_orientation_from_type_ex(), get_new_constraint_target(), getTransformOrientation_ex(), pose_ik_add_invoke(), pose_select_hierarchy_exec(), screen_ctx_active_pose_bone(), v3d_posearmature_buts(), view_lock_to_active_exec(), WIDGETGROUP_armature_spline_poll(), WIDGETGROUP_armature_spline_refresh(), and WIDGETGROUP_armature_spline_setup().
bPoseChannel* BKE_pose_channel_active_or_first_selected | ( | struct Object * | ob | ) |
Use this when detecting the "other selected bone", when we have multiple armatures in pose mode.
In this case the active-selected is an obvious choice when finding the target for a constraint for eg. however from the users perspective the active pose bone of the active object is the real active bone, so any other non-active selected bone is a candidate for being the other selected bone, see: T58447.
Definition at line 725 of file action.c.
References BKE_pose_channel_active_if_layer_visible(), bPoseChannel::bone, BONE_SELECTED, bPose::chanbase, Object::data, ELEM, ListBase::first, Bone::flag, if(), bPoseChannel::next, NULL, PBONE_VISIBLE, and Object::pose.
Referenced by get_new_constraint_target().
void BKE_pose_channel_copy_data | ( | bPoseChannel * | pchan, |
const bPoseChannel * | pchan_from | ||
) |
Definition at line 1143 of file action.c.
References bPoseChannel::agrp_index, bPoseChannel::bbone_next, bPoseChannel::bbone_prev, BKE_constraints_copy(), bPoseChannel::constraints, copy_v3_v3(), bPoseChannel::custom, bPoseChannel::custom_rotation_euler, bPoseChannel::custom_scale_xyz, bPoseChannel::custom_translation, bPoseChannel::drawflag, Object::id, id_us_plus(), IDP_CopyProperty(), IDP_FreeProperty(), bPoseChannel::ikflag, bPoseChannel::iklinweight, bPoseChannel::ikrotweight, bPoseChannel::ikstretch, bPoseChannel::limitmax, bPoseChannel::limitmin, NULL, bPoseChannel::prop, bPoseChannel::protectflag, bPoseChannel::rotmode, and bPoseChannel::stiffness.
bPoseChannel* BKE_pose_channel_ensure | ( | struct bPose * | pose, |
const char * | name | ||
) |
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 628 of file action.c.
References BKE_pose_channel_find_name(), BKE_pose_channel_session_uuid_generate(), BLI_addtail(), BLI_ghash_insert(), BLI_strncpy(), bPose::chanbase, bPose::chanhash, bPoseChannel::constinv, copy_v3_fl(), bPoseChannel::custom_rotation_euler, bPoseChannel::custom_scale_xyz, bPoseChannel::custom_translation, bPoseChannel::iklinweight, bPoseChannel::ikrotweight, bPoseChannel::limitmax, bPoseChannel::limitmin, M_PI, MEM_callocN, bPoseChannel::name, NULL, OB_LOCK_ROT4D, bPoseChannel::protectflag, bPoseChannel::quat, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::scale_in, bPoseChannel::scale_out, bPoseChannel::size, bPoseChannel::stiffness, unit_axis_angle(), unit_m4(), unit_qt(), and zero_v3().
Referenced by actcon_get_tarmat(), armature_symmetrize_exec(), copy_pchan(), rebuild_pose_bone(), updateDuplicateConstraintSettings(), updateDuplicateCustomBoneShapes(), and updateDuplicateSubtarget().
bPoseChannel* BKE_pose_channel_find_name | ( | const bPose * | pose, |
const char * | name | ||
) |
Definition at line 615 of file action.c.
References BLI_findstring(), BLI_ghash_lookup(), bPose::chanbase, bPose::chanhash, ELEM, and NULL.
Referenced by BKE_pose_channel_ensure(), BKE_pose_channel_get_mirrored(), BKE_pose_copy_data_ex(), BKE_pose_copy_result(), and pose_channel_in_IK_chain().
void BKE_pose_channel_free | ( | bPoseChannel * | pchan | ) |
Definition at line 1078 of file action.c.
References BKE_pose_channel_free_ex().
Referenced by armature_symmetrize_exec(), BKE_pose_channels_remove(), and separate_armature_bones().
void BKE_pose_channel_free_bbone_cache | ( | struct bPoseChannel_Runtime * | runtime | ) |
Deallocates runtime cache of a pose channel's B-Bone shape.
Definition at line 1069 of file action.c.
References bPoseChannel_Runtime::bbone_deform_mats, bPoseChannel_Runtime::bbone_dual_quats, bPoseChannel_Runtime::bbone_pose_mats, bPoseChannel_Runtime::bbone_rest_mats, bPoseChannel_Runtime::bbone_segments, and MEM_SAFE_FREE.
Referenced by allocate_bbone_cache(), BKE_pchan_bbone_segments_cache_copy(), BKE_pose_bone_done(), BKE_pose_channel_runtime_free(), and BKE_pose_eval_init().
void BKE_pose_channel_free_ex | ( | struct bPoseChannel * | pchan, |
bool | do_id_user | ||
) |
Deallocates a pose channel. Does not free the pose channel itself.
Definition at line 1024 of file action.c.
References animviz_free_motionpath(), BKE_constraints_free_ex(), BKE_pose_channel_runtime_free(), bPoseChannel::constraints, bPoseChannel::custom, bPoseChannel::draw_data, Object::id, id_us_min(), IDP_FreeProperty_ex(), MEM_SAFE_FREE, bPoseChannel::mpath, NULL, bPoseChannel::prop, and bPoseChannel::runtime.
Referenced by BKE_pose_channel_free(), BKE_pose_channels_clear_with_null_bone(), and BKE_pose_channels_free_ex().
bPoseChannel* BKE_pose_channel_get_mirrored | ( | const bPose * | pose, |
const char * | name | ||
) |
Definition at line 748 of file action.c.
References BKE_pose_channel_find_name(), BLI_string_flip_side_name(), MAXBONENAME, NULL, and STREQ.
bool BKE_pose_channel_in_IK_chain | ( | struct Object * | ob, |
struct bPoseChannel * | pchan | ||
) |
Checks if a bone is part of an IK chain or not.
Definition at line 920 of file action.c.
References pose_channel_in_IK_chain().
void BKE_pose_channel_runtime_free | ( | struct bPoseChannel_Runtime * | runtime | ) |
Deallocates runtime cache of a pose channel
Definition at line 1064 of file action.c.
References BKE_pose_channel_free_bbone_cache().
Referenced by BKE_pose_channel_free_ex(), and blender::deg::ObjectRuntimeBackup::restore_pose_channel_runtime_data().
void BKE_pose_channel_runtime_reset | ( | struct bPoseChannel_Runtime * | runtime | ) |
Clears the runtime cache of a pose channel without free.
Definition at line 1052 of file action.c.
Referenced by blender::deg::ObjectRuntimeBackup::backup_pose_channel_runtime_data(), and BKE_pose_blend_read_data().
void BKE_pose_channel_runtime_reset_on_copy | ( | struct bPoseChannel_Runtime * | runtime | ) |
Reset all non-persistent fields.
Definition at line 1057 of file action.c.
References bPoseChannel_Runtime::session_uuid.
Referenced by BKE_pose_copy_data_ex().
void BKE_pose_channel_session_uuid_generate | ( | bPoseChannel * | pchan | ) |
Definition at line 610 of file action.c.
References BLI_session_uuid_generate(), bPoseChannel::runtime, and bPoseChannel_Runtime::session_uuid.
Referenced by BKE_pose_blend_read_data(), BKE_pose_channel_ensure(), and BKE_pose_copy_data_ex().
Definition at line 1100 of file action.c.
References BKE_pose_channels_free_ex().
Removes and deallocates all channels from a pose. Does not free the pose itself.
Definition at line 1083 of file action.c.
References BKE_pose_channel_free_ex(), BKE_pose_channels_hash_free(), BLI_freelistN(), bPose::chan_array, bPose::chanbase, ListBase::first, MEM_SAFE_FREE, and bPoseChannel::next.
Referenced by BKE_pose_channels_free(), and BKE_pose_free_data_ex().
Removes the hash for quick lookup of channels, must be done when adding/removing channels.
Definition at line 925 of file action.c.
References BLI_ghash_insert(), BLI_ghash_str_new(), bPose::chanbase, bPose::chanhash, ListBase::first, bPoseChannel::name, and bPoseChannel::next.
Referenced by BKE_object_handle_update_ex(), BKE_pose_copy_data_ex(), BKE_pose_rebuild(), blender::deg::DepsgraphNodeBuilder::build_rig(), postEditBoneDuplicate(), and what_does_obaction().
Definition at line 937 of file action.c.
References BLI_ghash_free(), bPose::chanhash, and NULL.
Referenced by BKE_pose_channels_clear_with_null_bone(), BKE_pose_channels_free_ex(), ED_armature_join_objects_exec(), postEditBoneDuplicate(), and separate_armature_bones().
Definition at line 678 of file action.c.
References BLI_ghash_lookup(), bPose::chanbase, bPose::chanhash, ListBase::first, bPoseChannel::name, and bPoseChannel::next.
void BKE_pose_channels_remove | ( | struct Object * | ob, |
bool(*)(const char *bone_name, void *user_data) | filter_fn, | ||
void * | user_data | ||
) |
Selectively remove pose channels.
Definition at line 960 of file action.c.
References bPoseChannel::bbone_next, bPoseChannel::bbone_prev, BKE_constraint_targets_flush(), BKE_constraint_targets_get(), BKE_pose_channel_free(), BLI_freelinkN(), BLI_ghash_remove(), bPose::chanbase, bPose::chanhash, CONSTRAINT_DISABLE, bPoseChannel::constraints, bPoseChannel::custom_tx, ListBase::first, bConstraint::flag, bPoseChannel::name, bPoseChannel::next, bConstraint::next, bConstraintTarget::next, NULL, Object::pose, pose_channels_remove_internal_links(), bConstraintTarget::subtarget, bConstraintTarget::tar, and user_data.
Referenced by armature_delete_selected_exec(), and armature_dissolve_selected_exec().
Definition at line 1805 of file action.c.
References BLI_gset_free(), BLI_gset_insert(), BLI_gset_lookup(), BLI_gset_new(), BLI_session_uuid_ghash_compare(), BLI_session_uuid_ghash_hash(), BLI_session_uuid_is_generated(), bPose::chanbase, LISTBASE_FOREACH, and NULL.
Definition at line 855 of file action.c.
References BKE_pose_copy_data_ex(), and src.
void BKE_pose_copy_data_ex | ( | bPose ** | dst, |
const bPose * | src, | ||
const int | flag, | ||
const bool | copy_constraints | ||
) |
Definition at line 774 of file action.c.
References bPose::agroups, animviz_copy_motionpath(), bPose::avs, bPoseChannel::bbone_next, bPoseChannel::bbone_prev, BKE_constraints_copy_ex(), BKE_pose_channel_find_name(), BKE_pose_channel_runtime_reset_on_copy(), BKE_pose_channel_session_uuid_generate(), BKE_pose_channels_hash_ensure(), BLI_duplicatelist(), bPose::chanbase, bPose::chanhash, bPoseChannel::constraints, bPoseChannel::custom, bPoseChannel::custom_tx, bPoseChannel::draw_data, ListBase::first, id_us_plus(), IDP_CopyProperty_ex(), bPose::ikdata, bPose::ikparam, bPose::iksolver, ListBase::last, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_callocN, MEM_dupallocN, bPoseChannel::mpath, bPoseChannel::name, bPoseChannel::next, NULL, bPoseChannel::prop, bPoseChannel::runtime, and src.
Referenced by BKE_pose_copy_data().
void BKE_pose_copy_pchan_result | ( | bPoseChannel * | pchanto, |
const bPoseChannel * | pchanfrom | ||
) |
Definition at line 1664 of file action.c.
References bPoseChannel::chan_mat, copy_m4_m4(), copy_qt_qt(), copy_v3_v3(), bPoseChannel::curve_in_x, bPoseChannel::curve_in_z, bPoseChannel::curve_out_x, bPoseChannel::curve_out_z, bPoseChannel::ease1, bPoseChannel::ease2, bPoseChannel::eul, bPoseChannel::flag, bPoseChannel::loc, bPoseChannel::pose_head, bPoseChannel::pose_mat, bPoseChannel::pose_tail, bPoseChannel::protectflag, bPoseChannel::quat, bPoseChannel::roll1, bPoseChannel::roll2, bPoseChannel::rotmode, bPoseChannel::scale_in, bPoseChannel::scale_out, and bPoseChannel::size.
Referenced by BKE_pose_copy_result().
Both poses should be in sync.
Definition at line 1695 of file action.c.
References BKE_pose_channel_find_name(), BKE_pose_copy_pchan_result(), CLOG_ERROR, from, LOG, bPoseChannel::name, bPoseChannel::next, and NULL.
Definition at line 1138 of file action.c.
References BKE_pose_free_ex().
Referenced by object_blend_read_lib().
Definition at line 1124 of file action.c.
References BKE_pose_free_data_ex().
Referenced by actcon_get_tarmat().
Definition at line 1105 of file action.c.
References bPose::agroups, BIK_clear_data(), BKE_pose_channels_free_ex(), BLI_freelistN(), ListBase::first, bPose::ikparam, and MEM_freeN.
Referenced by BKE_pose_free_data(), and BKE_pose_free_ex().
Removes and deallocates all data from a pose, and also frees the pose.
Definition at line 1129 of file action.c.
References BKE_pose_free_data_ex(), and MEM_freeN.
Referenced by BKE_pose_free(), and object_free_data().
const char* BKE_pose_ikparam_get_name | ( | struct bPose * | pose | ) |
Return the name of structure pointed by pose->ikparam
.
Definition at line 761 of file action.c.
References bPose::iksolver, IKSOLVER_ITASC, IKSOLVER_STANDARD, and NULL.
Referenced by BKE_pose_blend_write().
Allocate and initialize pose->ikparam
according to pose->iksolver
.
Definition at line 877 of file action.c.
References BKE_pose_itasc_init(), bPose::ikparam, bPose::iksolver, IKSOLVER_ITASC, IKSOLVER_STANDARD, MEM_callocN, and NULL.
bool BKE_pose_is_layer_visible | ( | const bArmature * | arm, |
const bPoseChannel * | pchan | ||
) |
Definition at line 694 of file action.c.
References bPoseChannel::bone, Bone::layer, and bArmature::layer.
Referenced by BKE_pose_channel_active().
Initialize a bItasc structure with default value.
Definition at line 860 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 BKE_pose_ikparam_init(), and get_ikdata().
void BKE_pose_remove_group | ( | struct bPose * | pose, |
struct bActionGroup * | grp, | ||
int | index | ||
) |
Remove the given bone-group (expects 'virtual' index (+1 one, used by active_group etc.)) index might be invalid ( < 1), in which case it will be find from grp.
Definition at line 1284 of file action.c.
References bPose::active_group, bPose::agroups, bPoseChannel::agrp_index, BLI_assert, BLI_findindex(), BLI_freelinkN(), BLI_listbase_is_empty(), bPose::chanbase, ListBase::first, and bPoseChannel::next.
Referenced by BKE_pose_remove_group_index().
Remove the indexed bone-group (expects 'virtual' index (+1 one, used by active_group etc.)).
Definition at line 1322 of file action.c.
References bPose::agroups, BKE_pose_remove_group(), BLI_findlink(), and NULL.
Referenced by pose_group_remove_exec().
Zero the pose transforms for the entire pose or only for selected bones.
Definition at line 1631 of file action.c.
References bPoseChannel::bone, BONE_SELECTED, bPose::chanbase, copy_v3_fl(), bPoseChannel::curve_in_x, bPoseChannel::curve_in_z, bPoseChannel::curve_out_x, bPoseChannel::curve_out_z, bPose::cyclic_offset, bPoseChannel::ease1, bPoseChannel::ease2, bPoseChannel::eul, ListBase::first, bPoseChannel::flag, Bone::flag, bPoseChannel::loc, bPoseChannel::next, NULL, POSE_BBONE_SHAPE, POSE_LOC, POSE_ROT, POSE_SIZE, bPoseChannel::quat, bPoseChannel::roll1, bPoseChannel::roll2, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::scale_in, bPoseChannel::scale_out, bPoseChannel::size, bPose::stride_offset, unit_axis_angle(), unit_qt(), and zero_v3().
Referenced by pose_clear_user_transforms_exec().
Tag pose for recalculation. Also tag all related data to be recalculated.
Definition at line 1719 of file action.c.
References DEG_relations_tag_update(), bPose::flag, and POSE_RECALC.
Referenced by armature_delete_selected_exec(), BKE_object_duplicate(), BKE_pose_blend_read_lib(), blo_do_versions_pre250(), constraint_add_exec(), constraint_copy_to_selected_exec(), object_pose_tag_update(), and pose_constraint_copy_exec().
Tag constraint flags for update.
Definition at line 1259 of file action.c.
References bPose::flag, and POSE_CONSTRAINTS_NEED_UPDATE_FLAGS.
Referenced by ED_object_constraint_tag_update().
Checks for IK constraint, Spline IK, and also for Follow-Path constraint. can do more constraints flags later. pose should be entirely OK.
Definition at line 1192 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, Bone::flag, if(), bPoseChannel::next, bConstraint::next, NULL, OB_ARMATURE, OB_CURVES_LEGACY, bPoseChannel::parent, PCHAN_HAS_CONST, PCHAN_HAS_IK, PCHAN_HAS_SPLINEIK, PCHAN_HAS_TARGET, POSE_CONSTRAINTS_NEED_UPDATE_FLAGS, POSE_CONSTRAINTS_TIMEDEPEND, and bConstraint::type.
Referenced by BKE_object_handle_update_ex(), BKE_pose_rebuild(), blender::deg::DepsgraphNodeBuilder::build_rig(), constraint_add_exec(), ED_object_constraint_update(), and what_does_obaction().
|
static |
Definition at line 248 of file action.c.
References BLO_expand, and LISTBASE_FOREACH.
Referenced by action_blend_read_expand().
|
static |
Definition at line 221 of file action.c.
References BLO_read_id_address, id, ID::lib, and LISTBASE_FOREACH.
Referenced by action_blend_read_lib().
Definition at line 1393 of file action.c.
References FMod_Cycles::after_mode, FMod_Cycles::before_mode, BKE_fcurve_calc_range(), bAction::curves, FModifier::data, FCM_EXTRAPOLATE_NONE, FCM_LIMIT_XMAX, FCM_LIMIT_XMIN, ListBase::first, FMod_Limits::flag, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_LIMITS, if(), ListBase::last, max, max_ff(), MAXFRAMEF, min, min_ff(), MINAFRAMEF, FCurve::modifiers, FCurve::next, FMod_Limits::rect, FCurve::totvert, FModifier::type, rctf::xmax, and rctf::xmin.
Referenced by BKE_action_get_frame_range().
bActionGroup* get_active_actiongroup | ( | struct bAction * | act | ) |
Get the active action-group for an Action.
Definition at line 345 of file action.c.
References AGRP_ACTIVE, ListBase::first, bActionGroup::flag, bAction::groups, bActionGroup::next, and NULL.
|
static |
Definition at line 894 of file action.c.
References BKE_pose_channel_find_name(), bPoseChannel::bone, Bone::childbase, CONSTRAINT_IK_AUTO, CONSTRAINT_TYPE_KINEMATIC, bPoseChannel::constraints, data, bConstraint::data, ListBase::first, Bone::name, Bone::next, bConstraint::next, Object::pose, and bConstraint::type.
Referenced by BKE_pose_channel_in_IK_chain().
|
static |
Definition at line 945 of file action.c.
References bPose::chanbase, LISTBASE_FOREACH, NULL, and Object::pose.
Referenced by BKE_pose_channels_remove().
void set_active_action_group | ( | struct bAction * | act, |
struct bActionGroup * | agrp, | ||
short | select | ||
) |
Make the given Action-Group the active one.
Definition at line 360 of file action.c.
References AGRP_ACTIVE, ListBase::first, bActionGroup::flag, bAction::groups, bActionGroup::next, NULL, and select().
void what_does_obaction | ( | Object * | ob, |
Object * | workob, | ||
bPose * | pose, | ||
bAction * | act, | ||
char | groupname[], | ||
const AnimationEvalContext * | anim_eval_context | ||
) |
Definition at line 1728 of file action.c.
References AnimData::action, Object::adt, ADT_RECALC_ANIM, animsys_evaluate_action_group(), BKE_action_group_find_name(), BKE_animdata_action_ensure_idroot(), BKE_animsys_evaluate_animdata(), BKE_object_workob_clear(), BKE_pose_channels_hash_ensure(), BKE_pose_update_constraint_flags(), BLI_strncpy(), bPose::chanbase, Object::constinv, Object::constraints, copy_m4_m4(), ListBase::first, bPose::flag, 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, POSE_CONSTRAINTS_NEED_UPDATE_FLAGS, RNA_id_pointer_create(), Object::rotmode, Object::trackflag, and Object::upflag.
|
static |
IDTypeInfo IDType_ID_AC |
|
static |
Definition at line 63 of file action.c.
Referenced by BKE_pose_copy_result().