Blender V4.3
BKE_animsys.h File Reference
#include "BLI_bit_vector.hh"
#include "BLI_span.hh"
#include "BLI_sys_types.h"

Go to the source code of this file.

Classes

struct  AnimationEvalContext
 
struct  AnimationBasePathChange
 

Typedefs

typedef struct AnimationEvalContext AnimationEvalContext
 
typedef struct AnimationBasePathChange AnimationBasePathChange
 
typedef struct NlaKeyframingContext NlaKeyframingContext
 
typedef enum eAnimData_Recalc eAnimData_Recalc
 

Enumerations

enum  eAnimData_Recalc { ADT_RECALC_DRIVERS = (1 << 0) , ADT_RECALC_ANIM = (1 << 1) , ADT_RECALC_ALL = (ADT_RECALC_DRIVERS | ADT_RECALC_ANIM) }
 

Functions

AnimationEvalContext BKE_animsys_eval_context_construct (struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
 
AnimationEvalContext BKE_animsys_eval_context_construct_at (const AnimationEvalContext *anim_eval_context, float eval_time) ATTR_WARN_UNUSED_RESULT
 
struct KeyingSetBKE_keyingset_add (struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
 
struct KS_PathBKE_keyingset_add_path (struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode)
 
struct KS_PathBKE_keyingset_find_path (struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode)
 
void BKE_keyingsets_copy (struct ListBase *newlist, const struct ListBase *list)
 
void BKE_keyingsets_foreach_id (struct LibraryForeachIDData *data, const struct ListBase *keyingsets)
 
void BKE_keyingset_free_path (struct KeyingSet *ks, struct KS_Path *ksp)
 
void BKE_keyingset_free_paths (struct KeyingSet *ks)
 
void BKE_keyingsets_free (struct ListBase *list)
 
void BKE_keyingsets_blend_write (struct BlendWriter *writer, struct ListBase *list)
 
void BKE_keyingsets_blend_read_data (struct BlendDataReader *reader, struct ListBase *list)
 
char * BKE_animsys_fix_rna_path_rename (struct ID *owner_id, char *old_path, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
 
void BKE_action_fix_paths_rename (struct ID *owner_id, struct bAction *act, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
 
void BKE_animdata_fix_paths_rename (struct ID *owner_id, struct AnimData *adt, struct ID *ref_id, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
 
void BKE_animdata_fix_paths_rename_all_ex (struct Main *bmain, struct ID *ref_id, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
 
void BKE_animdata_fix_paths_rename_all (struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
 
bool BKE_animdata_fix_paths_remove (struct ID *id, const char *prefix)
 
void BKE_animdata_transfer_by_basepath (struct Main *bmain, struct ID *srcID, struct ID *dstID, struct ListBase *basepaths)
 
struct NlaKeyframingContextBKE_animsys_get_nla_keyframing_context (struct ListBase *cache, struct PointerRNA *ptr, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context)
 
void BKE_animsys_nla_remap_keyframe_values (struct NlaKeyframingContext *context, struct PointerRNA *prop_ptr, struct PropertyRNA *prop, const blender::MutableSpan< float > values, int index, const struct AnimationEvalContext *anim_eval_context, bool *r_force_all, blender::BitVector<> &r_values_mask)
 
void BKE_animsys_free_nla_keyframing_context_cache (struct ListBase *cache)
 
bool BKE_animsys_rna_path_resolve (struct PointerRNA *ptr, const char *rna_path, int array_index, struct PathResolvedRNA *r_result)
 
bool BKE_animsys_read_from_rna_path (struct PathResolvedRNA *anim_rna, float *r_value)
 
bool BKE_animsys_write_to_rna_path (struct PathResolvedRNA *anim_rna, float value)
 
void BKE_animsys_evaluate_animdata (struct ID *id, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, bool flush_to_original)
 
void BKE_animsys_evaluate_all_animation (struct Main *main, struct Depsgraph *depsgraph, float ctime)
 
void animsys_evaluate_action (struct PointerRNA *ptr, struct bAction *act, int32_t action_slot_handle, const struct AnimationEvalContext *anim_eval_context, bool flush_to_original)
 
void animsys_blend_in_action (struct PointerRNA *ptr, struct bAction *act, int32_t action_slot_handle, const AnimationEvalContext *anim_eval_context, float blend_factor)
 
void animsys_evaluate_action_group (struct PointerRNA *ptr, struct bAction *act, struct bActionGroup *agrp, const struct AnimationEvalContext *anim_eval_context)
 
void BKE_animsys_eval_animdata (struct Depsgraph *depsgraph, struct ID *id)
 
void BKE_animsys_eval_driver (struct Depsgraph *depsgraph, struct ID *id, int driver_index, struct FCurve *fcu_orig)
 
void BKE_animsys_update_driver_array (struct ID *id)
 

Typedef Documentation

◆ AnimationBasePathChange

typedef struct AnimationBasePathChange AnimationBasePathChange

◆ AnimationEvalContext

typedef struct AnimationEvalContext AnimationEvalContext

Container for data required to do FCurve and Driver evaluation.

◆ eAnimData_Recalc

◆ NlaKeyframingContext

typedef struct NlaKeyframingContext NlaKeyframingContext

Definition at line 213 of file BKE_animsys.h.

Enumeration Type Documentation

◆ eAnimData_Recalc

Enumerator
ADT_RECALC_DRIVERS 
ADT_RECALC_ANIM 
ADT_RECALC_ALL 

Definition at line 265 of file BKE_animsys.h.

Function Documentation

◆ animsys_blend_in_action()

void animsys_blend_in_action ( struct PointerRNA * ptr,
struct bAction * act,
int32_t action_slot_handle,
const AnimationEvalContext * anim_eval_context,
float blend_factor )

◆ animsys_evaluate_action()

void animsys_evaluate_action ( struct PointerRNA * ptr,
struct bAction * act,
int32_t action_slot_handle,
const struct AnimationEvalContext * anim_eval_context,
bool flush_to_original )

Evaluate Action (F-Curve Bag).

Note that this is only used for either legacy Actions or for evaluation of the NLA.

Referenced by blender::animrig::pose_apply_action_all_bones(), and blender::animrig::pose_apply_action_selected_bones().

◆ animsys_evaluate_action_group()

void animsys_evaluate_action_group ( struct PointerRNA * ptr,
struct bAction * act,
struct bActionGroup * agrp,
const struct AnimationEvalContext * anim_eval_context )

Referenced by what_does_obaction().

◆ BKE_action_fix_paths_rename()

void BKE_action_fix_paths_rename ( struct ID * owner_id,
struct bAction * act,
const char * prefix,
const char * oldName,
const char * newName,
int oldSubscript,
int newSubscript,
bool verify_paths )

Fix all the paths for the given ID + Action.

This is just an external wrapper for the F-Curve fixing function, with input validity checks on top of the basic method.

Note
it is assumed that the structure we're replacing is <prefix><["><name><"]> i.e. pose.bones["Bone"].

Definition at line 1038 of file anim_data.cc.

References BLI_array_alloca, BLI_sprintfN(), BLI_str_escape(), ELEM, blender::animrig::legacy::fcurves_all(), fcurves_path_rename_fix(), and MEM_freeN().

Referenced by constraint_bone_name_fix(), and joined_armature_fix_links_constraints().

◆ BKE_animdata_fix_paths_remove()

bool BKE_animdata_fix_paths_remove ( struct ID * id,
const char * prefix )

◆ BKE_animdata_fix_paths_rename()

void BKE_animdata_fix_paths_rename ( struct ID * owner_id,
struct AnimData * adt,
struct ID * ref_id,
const char * prefix,
const char * oldName,
const char * newName,
int oldSubscript,
int newSubscript,
bool verify_paths )

◆ BKE_animdata_fix_paths_rename_all()

void BKE_animdata_fix_paths_rename_all ( struct ID * ref_id,
const char * prefix,
const char * oldName,
const char * newName )

◆ BKE_animdata_fix_paths_rename_all_ex()

void BKE_animdata_fix_paths_rename_all_ex ( struct Main * bmain,
struct ID * ref_id,
const char * prefix,
const char * oldName,
const char * newName,
int oldSubscript,
int newSubscript,
bool verify_paths )

Fix all RNA-Paths throughout the database (directly access the Global.main version).

Note
it is assumed that the structure we're replacing is <prefix><["><name><"]> i.e. pose.bones["Bone"]

Definition at line 1438 of file anim_data.cc.

References BKE_animdata_fix_paths_rename(), and BKE_animdata_main_cb().

Referenced by BKE_animdata_fix_paths_rename_all(), and version_node_socket_index_animdata().

◆ BKE_animdata_transfer_by_basepath()

void BKE_animdata_transfer_by_basepath ( struct Main * bmain,
struct ID * srcID,
struct ID * dstID,
struct ListBase * basepaths )

◆ BKE_animsys_eval_animdata()

◆ BKE_animsys_eval_context_construct()

◆ BKE_animsys_eval_context_construct_at()

AnimationEvalContext BKE_animsys_eval_context_construct_at ( const AnimationEvalContext * anim_eval_context,
float eval_time )

◆ BKE_animsys_eval_driver()

◆ BKE_animsys_evaluate_all_animation()

void BKE_animsys_evaluate_all_animation ( struct Main * main,
struct Depsgraph * depsgraph,
float ctime )

Evaluation of all ID-blocks with Animation Data blocks - Animation Data Only

This will evaluate only the animation info available in the animation data-blocks encountered. In order to enforce the system by which some settings controlled by a 'local' (i.e. belonging in the nearest ID-block that setting is related to, not a standard 'root') block are overridden by a larger 'user'

Definition at line 4039 of file anim_sys.cc.

References ADT_RECALC_ANIM, BKE_animsys_eval_context_construct(), BLI_listbase_is_empty(), DEG_is_active(), depsgraph, EVAL_ANIM_IDS, EVAL_ANIM_NODETREE_IDS, G, G_DEBUG, main(), and printf.

Referenced by do_render_strip_seqbase().

◆ BKE_animsys_evaluate_animdata()

void BKE_animsys_evaluate_animdata ( struct ID * id,
struct AnimData * adt,
const struct AnimationEvalContext * anim_eval_context,
eAnimData_Recalc recalc,
bool flush_to_original )

Evaluation loop for evaluation animation data

This assumes that the animation-data provided belongs to the ID block in question, and that the flags for which parts of the animation-data settings need to be recalculated have been set already by the depsgraph. Now, we use the recalculate.

Referenced by BKE_object_modifier_update_subframe(), BKE_object_where_is_calc_time(), blender::ed::object::ocean_bake_exec(), particle_system_update(), pose_clear_user_transforms_exec(), RE_RenderAnim(), seq_prefetch_frames(), seq_render_mask(), and what_does_obaction().

◆ BKE_animsys_fix_rna_path_rename()

char * BKE_animsys_fix_rna_path_rename ( struct ID * owner_id,
char * old_path,
const char * prefix,
const char * oldName,
const char * newName,
int oldSubscript,
int newSubscript,
bool verify_paths )

Get a "fixed" version of the given path old_path.

This is just an external wrapper for the RNA-Path fixing function, with input validity checks on top of the basic method.

Note
it is assumed that the structure we're replacing is <prefix><["><name><"]> i.e. pose.bones["Bone"].

Definition at line 981 of file anim_data.cc.

References BLI_array_alloca, BLI_sprintfN(), BLI_str_escape(), CLOG_WARN, ELEM, G, G_DEBUG, LOG, MEM_freeN(), printf, result, and rna_path_rename_fix().

Referenced by joined_armature_fix_animdata_cb().

◆ BKE_animsys_free_nla_keyframing_context_cache()

void BKE_animsys_free_nla_keyframing_context_cache ( struct ListBase * cache)

Free all cached contexts from the list.

Definition at line 3913 of file anim_sys.cc.

References BLI_freelistN(), LISTBASE_FOREACH, MEM_SAFE_FREE, and nlaeval_free().

Referenced by achannel_setting_slider_cb(), and blender::animrig::insert_keyframes().

◆ BKE_animsys_get_nla_keyframing_context()

struct NlaKeyframingContext * BKE_animsys_get_nla_keyframing_context ( struct ListBase * cache,
struct PointerRNA * ptr,
struct AnimData * adt,
const struct AnimationEvalContext * anim_eval_context )

Prepare data necessary to compute correct keyframe values for NLA strips with non-Replace mode or influence different from 1.

Parameters
cacheList used to cache contexts for reuse when keying multiple channels in one operation.
ptrRNA pointer to the ID with the animation.
Returns
Keyframing context, or NULL if not necessary.

Referenced by achannel_setting_slider_cb(), and blender::animrig::nla_time_remap().

◆ BKE_animsys_nla_remap_keyframe_values()

void BKE_animsys_nla_remap_keyframe_values ( struct NlaKeyframingContext * context,
struct PointerRNA * prop_ptr,
struct PropertyRNA * prop,
const blender::MutableSpan< float > values,
int index,
const struct AnimationEvalContext * anim_eval_context,
bool * r_force_all,
blender::BitVector<> & r_values_mask )

Apply correction from the NLA context to the values about to be keyframed.

Parameters
contextContext to use (may be NULL).
prop_ptrProperty about to be keyframed.
[in,out]valuesSpan of property values to adjust.
indexIndex of the element about to be updated, or -1.
[out]r_force_allFor array properties, set to true if the property should be treated as all-or-nothing (i.e. where either all elements get keyed or none do). Irrelevant for non-array properties. May be NULL.
[out]r_values_maskA mask for the elements of values, where bits are set to true for the elements that were both indicated by index and for which valid keying values were successfully computed. In short, this is a mask for the indices that can get keyed.

Referenced by blender::animrig::insert_keyframes(), and blender::animrig::nla_map_keyframe_values_and_generate_reports().

◆ BKE_animsys_read_from_rna_path()

◆ BKE_animsys_rna_path_resolve()

◆ BKE_animsys_update_driver_array()

void BKE_animsys_update_driver_array ( struct ID * id)

◆ BKE_animsys_write_to_rna_path()

◆ BKE_keyingset_add()

struct KeyingSet * BKE_keyingset_add ( struct ListBase * list,
const char idname[],
const char name[],
short flag,
short keyingflag )

◆ BKE_keyingset_add_path()

struct KS_Path * BKE_keyingset_add_path ( struct KeyingSet * ks,
struct ID * id,
const char group_name[],
const char rna_path[],
int array_index,
short flag,
short groupmode )

Add a path to a KeyingSet. Nothing is returned for now. Checks are performed to ensure that destination is appropriate for the KeyingSet in question

Definition at line 164 of file anim_sys.cc.

References KS_Path::array_index, BKE_keyingset_find_path(), BLI_addtail(), BLI_strdup(), CLOG_ERROR, ELEM, flag, KS_Path::flag, G, G_DEBUG, KS_Path::group, KS_Path::groupmode, GS, KS_Path::id, KS_Path::idtype, LOG, MEM_callocN, KeyingSet::paths, KS_Path::rna_path, and STRNCPY.

Referenced by add_keyingset_button_exec(), and blender::ed::outliner::do_outliner_keyingset_editop().

◆ BKE_keyingset_find_path()

struct KS_Path * BKE_keyingset_find_path ( struct KeyingSet * ks,
struct ID * id,
const char group_name[],
const char rna_path[],
int array_index,
int group_mode )

Find the destination matching the criteria given. TODO: do we want some method to perform partial matches too?

Definition at line 84 of file anim_sys.cc.

References ELEM, LISTBASE_FOREACH, KeyingSet::paths, and STREQ.

Referenced by BKE_keyingset_add_path(), blender::ed::outliner::do_outliner_keyingset_editop(), and remove_keyingset_button_exec().

◆ BKE_keyingset_free_path()

◆ BKE_keyingset_free_paths()

◆ BKE_keyingsets_blend_read_data()

void BKE_keyingsets_blend_read_data ( struct BlendDataReader * reader,
struct ListBase * list )

Definition at line 320 of file anim_sys.cc.

References BLO_read_string(), BLO_read_struct_list, and LISTBASE_FOREACH.

Referenced by scene_blend_read_data().

◆ BKE_keyingsets_blend_write()

void BKE_keyingsets_blend_write ( struct BlendWriter * writer,
struct ListBase * list )

Definition at line 302 of file anim_sys.cc.

References BLO_write_string(), BLO_write_struct, and LISTBASE_FOREACH.

Referenced by scene_blend_write().

◆ BKE_keyingsets_copy()

void BKE_keyingsets_copy ( struct ListBase * newlist,
const struct ListBase * list )

Referenced by scene_copy_data().

◆ BKE_keyingsets_foreach_id()

void BKE_keyingsets_foreach_id ( struct LibraryForeachIDData * data,
const struct ListBase * keyingsets )

Process the ID pointers inside a scene's keyingsets, in see BKE_lib_query.hh for details.

Referenced by scene_foreach_id().

◆ BKE_keyingsets_free()

void BKE_keyingsets_free ( struct ListBase * list)