Blender V4.3
anim_sys.cc File Reference
#include <cfloat>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
#include "BLI_bit_vector.hh"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_listbase.h"
#include "BLI_listbase_wrapper.hh"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_math_vector_types.hh"
#include "BLI_string_utils.hh"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_anim_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_animsys.h"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_nla.hh"
#include "BKE_node.hh"
#include "BKE_report.hh"
#include "BKE_texture.h"
#include "ANIM_action.hh"
#include "ANIM_action_legacy.hh"
#include "ANIM_evaluation.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "RNA_access.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "BLO_read_write.hh"
#include "nla_private.h"
#include "atomic_ops.h"
#include "CLG_log.h"

Go to the source code of this file.

Macros

#define ANIMSYS_FLOAT_AS_BOOL(value)   ((value) > (1.0f - FLT_EPSILON))
 
#define EVAL_ANIM_IDS(first, aflag)
 
#define EVAL_ANIM_NODETREE_IDS(first, NtId_Type, aflag)
 

Functions

KS_PathBKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int)
 
KeyingSetBKE_keyingset_add (ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
 
KS_PathBKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode)
 
void BKE_keyingset_free_path (KeyingSet *ks, KS_Path *ksp)
 
void BKE_keyingsets_copy (ListBase *newlist, const ListBase *list)
 
void BKE_keyingsets_foreach_id (LibraryForeachIDData *data, const ListBase *keyingsets)
 
void BKE_keyingset_free_paths (KeyingSet *ks)
 
void BKE_keyingsets_free (ListBase *list)
 
void BKE_keyingsets_blend_write (BlendWriter *writer, ListBase *list)
 
void BKE_keyingsets_blend_read_data (BlendDataReader *reader, ListBase *list)
 
static bool is_fcurve_evaluatable (const FCurve *fcu)
 
bool BKE_animsys_rna_path_resolve (PointerRNA *ptr, const char *rna_path, const int array_index, PathResolvedRNA *r_result)
 
bool BKE_animsys_read_from_rna_path (PathResolvedRNA *anim_rna, float *r_value)
 
bool BKE_animsys_write_to_rna_path (PathResolvedRNA *anim_rna, const float value)
 
static bool animsys_construct_orig_pointer_rna (const PointerRNA *ptr, PointerRNA *ptr_orig)
 
static void animsys_write_orig_anim_rna (PointerRNA *ptr, const char *rna_path, int array_index, float value)
 
static void animsys_evaluate_fcurves (PointerRNA *ptr, Span< FCurve * > fcurves, const AnimationEvalContext *anim_eval_context, bool flush_to_original)
 
static void animsys_quaternion_evaluate_fcurves (PathResolvedRNA quat_rna, Span< FCurve * > quat_fcurves, const AnimationEvalContext *anim_eval_context, float r_quaternion[4])
 
static void animsys_blend_fcurves_quaternion (PathResolvedRNA *anim_rna, Span< FCurve * > quaternion_fcurves, const AnimationEvalContext *anim_eval_context, const float blend_factor)
 
static void animsys_blend_in_fcurves (PointerRNA *ptr, Span< FCurve * > fcurves, const AnimationEvalContext *anim_eval_context, const float blend_factor)
 
AnimationEvalContext BKE_animsys_eval_context_construct (Depsgraph *depsgraph, float eval_time)
 
AnimationEvalContext BKE_animsys_eval_context_construct_at (const AnimationEvalContext *anim_eval_context, float eval_time)
 
static void animsys_evaluate_drivers (PointerRNA *ptr, AnimData *adt, const AnimationEvalContext *anim_eval_context)
 
static void action_idcode_patch_check (ID *id, bAction *act)
 
void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup *agrp, const AnimationEvalContext *anim_eval_context)
 
void animsys_evaluate_action (PointerRNA *ptr, bAction *act, const int32_t action_slot_handle, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
void animsys_blend_in_action (PointerRNA *ptr, bAction *act, const int32_t action_slot_handle, const AnimationEvalContext *anim_eval_context, const float blend_factor)
 
static float nlastrip_get_influence (NlaStrip *strip, float cframe)
 
static void nlastrip_evaluate_controls (NlaStrip *strip, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
NlaEvalStripnlastrips_ctime_get_strip (ListBase *list, ListBase *strips, short index, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
static NlaEvalStripnlastrips_ctime_get_strip_single (ListBase *dst_list, NlaStrip *single_strip, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
static void nlavalidmask_init (NlaValidMask *mask, int bits)
 
static void nlavalidmask_free (NlaValidMask *mask)
 
static uint nlaevalchan_keyhash (const void *ptr)
 
static bool nlaevalchan_keycmp (const void *a, const void *b)
 
static NlaEvalChannelSnapshotnlaevalchan_snapshot_new (NlaEvalChannel *nec)
 
static void nlaevalchan_snapshot_free (NlaEvalChannelSnapshot *nec_snapshot)
 
static void nlaevalchan_snapshot_copy (NlaEvalChannelSnapshot *dst, const NlaEvalChannelSnapshot *src)
 
static void nlaeval_snapshot_init (NlaEvalSnapshot *snapshot, NlaEvalData *nlaeval, NlaEvalSnapshot *base)
 
static NlaEvalChannelSnapshotnlaeval_snapshot_get (NlaEvalSnapshot *snapshot, int index)
 
static void nlaeval_snapshot_ensure_size (NlaEvalSnapshot *snapshot, int size)
 
static NlaEvalChannelSnapshot ** nlaeval_snapshot_ensure_slot (NlaEvalSnapshot *snapshot, NlaEvalChannel *nec)
 
static NlaEvalChannelSnapshotnlaeval_snapshot_find_channel (NlaEvalSnapshot *snapshot, NlaEvalChannel *nec)
 
static NlaEvalChannelSnapshotnlaeval_snapshot_ensure_channel (NlaEvalSnapshot *snapshot, NlaEvalChannel *nec)
 
static void nlaeval_snapshot_free_data (NlaEvalSnapshot *snapshot)
 
static void nlaevalchan_free_data (NlaEvalChannel *nec)
 
static void nlaeval_init (NlaEvalData *nlaeval)
 
static void nlaeval_free (NlaEvalData *nlaeval)
 
static int nlaevalchan_validate_index (const NlaEvalChannel *nec, int index)
 
static bool nlaevalchan_validate_index_ex (const NlaEvalChannel *nec, const int array_index)
 
static void nlaevalchan_get_default_values (NlaEvalChannel *nec, float *r_values)
 
static char nlaevalchan_detect_mix_mode (NlaEvalChannelKey *key, int length)
 
static NlaEvalChannelnlaevalchan_verify_key (NlaEvalData *nlaeval, const char *path, NlaEvalChannelKey *key)
 
static NlaEvalChannelnlaevalchan_verify (PointerRNA *ptr, NlaEvalData *nlaeval, const char *path)
 
static bool nla_blend_get_inverted_lower_value (const int blendmode, const float strip_value, const float blended_value, const float influence, float *r_lower_value)
 
static bool nla_combine_get_inverted_lower_value (const int mix_mode, float base_value, const float strip_value, const float blended_value, const float influence, float *r_lower_value)
 
static void nla_combine_quaternion_get_inverted_lower_values (const float strip_values[4], const float blended_values[4], const float influence, float r_lower_value[4])
 
static float nla_blend_value (const int blendmode, const float lower_value, const float strip_value, const float influence)
 
static float nla_combine_value (const int mix_mode, float base_value, const float lower_value, const float strip_value, const float influence)
 
static bool nla_blend_get_inverted_strip_value (const int blendmode, const float lower_value, const float blended_value, const float influence, float *r_strip_value)
 
static bool nla_combine_get_inverted_strip_value (const int mix_mode, float base_value, const float lower_value, const float blended_value, const float influence, float *r_strip_value)
 
static void nla_combine_quaternion (const float lower_values[4], const float strip_values[4], const float influence, float r_blended_value[4])
 
static bool nla_combine_quaternion_get_inverted_strip_values (const float lower_values[4], const float blended_values[4], const float influence, float r_strip_values[4])
 
static void nlaevalchan_assert_nonNull (const NlaEvalChannelSnapshot *necs)
 
static void nlaevalchan_assert_blendOrcombine_compatible (const NlaEvalChannelSnapshot *lower_necs, const NlaEvalChannelSnapshot *upper_necs, const NlaEvalChannelSnapshot *blended_necs)
 
static bool nlaevalchan_combine_quaternion_handle_undefined_blend_values (NlaEvalChannelSnapshot *blended_necs, NlaEvalChannelSnapshot *upper_or_lower_necs)
 
static void nlaevalchan_assert_blendOrcombine_compatible_quaternion (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *upper_necs, NlaEvalChannelSnapshot *blended_necs)
 
static void nlaevalchan_copy_values (NlaEvalChannelSnapshot *dst, const NlaEvalChannelSnapshot *src)
 
static bool nlaevalchan_blendOrcombine_try_copy_from_lower (const NlaEvalChannelSnapshot *lower_necs, const NlaEvalChannelSnapshot *upper_necs, const float upper_influence, NlaEvalChannelSnapshot *r_blended_necs)
 
static bool nlaevalchan_blendOrcombine_try_copy_to_lower (NlaEvalChannelSnapshot *blended_necs, NlaEvalChannelSnapshot *upper_necs, const float upper_influence, NlaEvalChannelSnapshot *r_lower_necs)
 
static void nlaevalchan_blend_value (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *upper_necs, const int upper_blendmode, const float upper_influence, NlaEvalChannelSnapshot *r_blended_necs)
 
static void nlaevalchan_combine_value (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *upper_necs, const float upper_influence, NlaEvalChannelSnapshot *r_blended_necs)
 
static void nlaevalchan_combine_quaternion (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *upper_necs, const float upper_influence, NlaEvalChannelSnapshot *r_blended_necs)
 
static void nlaevalchan_blendOrcombine (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *upper_necs, const int upper_blendmode, const float upper_influence, NlaEvalChannelSnapshot *r_blended_necs)
 
static void nlaevalchan_blend_value_get_inverted_upper_evalchan (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *blended_necs, const int upper_blendmode, const float upper_influence, NlaEvalChannelSnapshot *r_upper_necs)
 
static void nlaevalchan_combine_value_get_inverted_upper_evalchan (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *blended_necs, const float upper_influence, NlaEvalChannelSnapshot *r_upper_necs)
 
static void nlaevalchan_combine_quaternion_get_inverted_upper_evalchan (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *blended_necs, const float upper_influence, NlaEvalChannelSnapshot *r_upper_necs)
 
static void nlaevalchan_blendOrcombine_get_inverted_upper_evalchan (NlaEvalChannelSnapshot *lower_necs, NlaEvalChannelSnapshot *blended_necs, const int upper_blendmode, const float upper_influence, NlaEvalChannelSnapshot *r_upper_necs)
 
static void nlaevalchan_blend_value_get_inverted_lower_evalchan (NlaEvalChannelSnapshot *blended_necs, NlaEvalChannelSnapshot *upper_necs, const int upper_blendmode, const float upper_influence, NlaEvalChannelSnapshot *r_lower_necs)
 
static void nlaevalchan_combine_value_get_inverted_lower_evalchan (NlaEvalChannelSnapshot *blended_necs, NlaEvalChannelSnapshot *upper_necs, const float upper_influence, NlaEvalChannelSnapshot *r_lower_necs)
 
static void nlaevalchan_combine_quaternion_get_inverted_lower_evalchan (NlaEvalChannelSnapshot *blended_necs, NlaEvalChannelSnapshot *upper_necs, const float upper_influence, NlaEvalChannelSnapshot *r_lower_necs)
 
static void nlaevalchan_blendOrCombine_get_inverted_lower_evalchan (NlaEvalChannelSnapshot *blended_necs, NlaEvalChannelSnapshot *upper_necs, const int upper_blendmode, const float upper_influence, NlaEvalChannelSnapshot *r_lower_necs)
 
static void nlaeval_fmodifiers_join_stacks (ListBase *result, ListBase *list1, ListBase *list2)
 
static void nlaeval_fmodifiers_split_stacks (ListBase *list1, ListBase *list2)
 
static void nlasnapshot_from_action (PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, bAction *action, const animrig::slot_handle_t slot_handle, const float evaltime, NlaEvalSnapshot *r_snapshot)
 
static void nlastrip_evaluate_actionclip (const int evaluation_mode, PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot)
 
static void nlastrip_evaluate_transition (const int evaluation_mode, PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
static void nlastrip_evaluate_meta (const int evaluation_mode, PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
void nlastrip_evaluate (const int evaluation_mode, PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
void nlasnapshot_blend_strip (PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
void nlasnapshot_blend_strip_get_inverted_lower_snapshot (PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const AnimationEvalContext *anim_eval_context)
 
void nlasnapshot_blend_strip_no_blend (PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const AnimationEvalContext *anim_eval_context)
 
void nladata_flush_channels (PointerRNA *ptr, NlaEvalData *channels, NlaEvalSnapshot *snapshot, const bool flush_to_original)
 
static void nla_eval_domain_action (PointerRNA *ptr, NlaEvalData *channels, bAction *act, const animrig::slot_handle_t slot_handle, GSet *touched_actions)
 
static void nla_eval_domain_strips (PointerRNA *ptr, NlaEvalData *channels, ListBase *strips, GSet *touched_actions)
 
static void animsys_evaluate_nla_domain (PointerRNA *ptr, NlaEvalData *channels, AnimData *adt)
 
static void animsys_create_tweak_strip (const AnimData *adt, const bool keyframing_to_strip, NlaStrip *r_tweak_strip)
 
static void animsys_create_action_track_strip (const AnimData *adt, const bool keyframing_to_strip, NlaStrip *r_action_strip)
 
static bool is_nlatrack_evaluatable (const AnimData *adt, const NlaTrack *nlt)
 
static bool is_action_track_evaluated_without_nla (const AnimData *adt, const bool any_strip_evaluated)
 
static NlaTracknlatrack_find_tweaked (const AnimData *adt)
 
static bool animsys_evaluate_nla_for_flush (NlaEvalData *echannels, PointerRNA *ptr, const AnimData *adt, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
static void animsys_evaluate_nla_for_keyframing (PointerRNA *ptr, const AnimData *adt, const AnimationEvalContext *anim_eval_context, NlaKeyframingContext *r_context)
 
static bool animsys_calculate_nla (PointerRNA *ptr, AnimData *adt, const AnimationEvalContext *anim_eval_context, const bool flush_to_original)
 
void nlasnapshot_enable_all_blend_domain (NlaEvalSnapshot *snapshot)
 
void nlasnapshot_ensure_channels (NlaEvalData *eval_data, NlaEvalSnapshot *snapshot)
 
void nlasnapshot_blend (NlaEvalData *eval_data, NlaEvalSnapshot *lower_snapshot, NlaEvalSnapshot *upper_snapshot, const short upper_blendmode, const float upper_influence, NlaEvalSnapshot *r_blended_snapshot)
 
void nlasnapshot_blend_get_inverted_upper_snapshot (NlaEvalData *eval_data, NlaEvalSnapshot *lower_snapshot, NlaEvalSnapshot *blended_snapshot, const short upper_blendmode, const float upper_influence, NlaEvalSnapshot *r_upper_snapshot)
 
void nlasnapshot_blend_get_inverted_lower_snapshot (NlaEvalData *eval_data, NlaEvalSnapshot *blended_snapshot, NlaEvalSnapshot *upper_snapshot, const short upper_blendmode, const float upper_influence, NlaEvalSnapshot *r_lower_snapshot)
 
NlaKeyframingContextBKE_animsys_get_nla_keyframing_context (ListBase *cache, PointerRNA *ptr, AnimData *adt, const AnimationEvalContext *anim_eval_context)
 
void BKE_animsys_nla_remap_keyframe_values (NlaKeyframingContext *context, PointerRNA *prop_ptr, PropertyRNA *prop, const blender::MutableSpan< float > values, int index, const AnimationEvalContext *anim_eval_context, bool *r_force_all, blender::BitVector<> &r_values_mask)
 
void BKE_animsys_free_nla_keyframing_context_cache (ListBase *cache)
 
static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt)
 
void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, const AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, const bool flush_to_original)
 
void BKE_animsys_evaluate_all_animation (Main *main, Depsgraph *depsgraph, float ctime)
 
void BKE_animsys_eval_animdata (Depsgraph *depsgraph, ID *id)
 
void BKE_animsys_update_driver_array (ID *id)
 
void BKE_animsys_eval_driver (Depsgraph *depsgraph, ID *id, int driver_index, FCurve *fcu_orig)
 

Variables

static CLG_LogRef LOG = {"bke.anim_sys"}
 

Macro Definition Documentation

◆ ANIMSYS_FLOAT_AS_BOOL

#define ANIMSYS_FLOAT_AS_BOOL ( value)    ((value) > (1.0f - FLT_EPSILON))

Definition at line 397 of file anim_sys.cc.

Referenced by BKE_animsys_write_to_rna_path().

◆ EVAL_ANIM_IDS

#define EVAL_ANIM_IDS ( first,
aflag )
Value:
for (id = static_cast<ID *>(first); id; id = static_cast<ID *>(id->next)) { \
if (ID_REAL_USERS(id) > 0) { \
BKE_animsys_evaluate_animdata(id, adt, &anim_eval_context, aflag, flush_to_original); \
} \
} \
(void)0
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:89
#define ID_REAL_USERS(id)
Definition DNA_ID.h:637
Definition DNA_ID.h:413

Referenced by BKE_animsys_evaluate_all_animation().

◆ EVAL_ANIM_NODETREE_IDS

#define EVAL_ANIM_NODETREE_IDS ( first,
NtId_Type,
aflag )
Value:
for (id = static_cast<ID *>(first); id; id = static_cast<ID *>(id->next)) { \
if (ID_REAL_USERS(id) > 0) { \
NtId_Type *ntp = (NtId_Type *)id; \
if (ntp->nodetree) { \
AnimData *adt2 = BKE_animdata_from_id((ID *)ntp->nodetree); \
BKE_animsys_evaluate_animdata( \
&ntp->nodetree->id, adt2, &anim_eval_context, ADT_RECALC_ANIM, flush_to_original); \
} \
BKE_animsys_evaluate_animdata(id, adt, &anim_eval_context, aflag, flush_to_original); \
} \
} \
(void)0
@ ADT_RECALC_ANIM

Referenced by BKE_animsys_evaluate_all_animation().

Function Documentation

◆ action_idcode_patch_check()

◆ animsys_blend_fcurves_quaternion()

static void animsys_blend_fcurves_quaternion ( PathResolvedRNA * anim_rna,
Span< FCurve * > quaternion_fcurves,
const AnimationEvalContext * anim_eval_context,
const float blend_factor )
static

This function assumes that the quaternion keys are sequential. They do not have to be in array_index order.

Definition at line 628 of file anim_sys.cc.

References animsys_quaternion_evaluate_fcurves(), BLI_assert, interp_qt_qtqt(), PathResolvedRNA::prop, PathResolvedRNA::ptr, RNA_property_float_get_array(), RNA_property_float_set_array(), and blender::Span< T >::size().

Referenced by animsys_blend_in_fcurves().

◆ animsys_blend_in_action()

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

◆ animsys_blend_in_fcurves()

◆ animsys_calculate_nla()

static bool animsys_calculate_nla ( PointerRNA * ptr,
AnimData * adt,
const AnimationEvalContext * anim_eval_context,
const bool flush_to_original )
static

NLA Evaluation function (mostly for use through do_animdata)

  • All channels that will be affected are not cleared anymore. Instead, we just evaluate into some temp channels, where values can be accumulated in one go.
Returns
whether any NLA tracks were evaluated at all.

Definition at line 3617 of file anim_sys.cc.

References animsys_evaluate_nla_domain(), animsys_evaluate_nla_for_flush(), NlaEvalData::eval_snapshot, nladata_flush_channels(), nlaeval_free(), nlaeval_init(), and ptr.

Referenced by BKE_animsys_evaluate_animdata().

◆ animsys_construct_orig_pointer_rna()

static bool animsys_construct_orig_pointer_rna ( const PointerRNA * ptr,
PointerRNA * ptr_orig )
static

◆ animsys_create_action_track_strip()

◆ animsys_create_tweak_strip()

static void animsys_create_tweak_strip ( const AnimData * adt,
const bool keyframing_to_strip,
NlaStrip * r_tweak_strip )
static

Tweaked strip is evaluated differently from other strips. Adjacent strips are ignored and includes a workaround for when user is not editing in place.

Definition at line 3241 of file anim_sys.cc.

References AnimData::actstrip, ADT_NLA_EDIT_NOMAP, BKE_nlastrip_recalculate_bounds_sync_action(), NlaStrip::extendmode, AnimData::flag, NlaStrip::flag, NlaStrip::next, NLASTRIP_EXTEND_HOLD, NLASTRIP_FLAG_NO_TIME_MAP, NLASTRIP_FLAG_SYNC_LENGTH, NLASTRIP_FLAG_USR_TIME, and NlaStrip::prev.

Referenced by animsys_evaluate_nla_for_flush(), and animsys_evaluate_nla_for_keyframing().

◆ animsys_evaluate_action()

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

◆ animsys_evaluate_action_group()

◆ animsys_evaluate_drivers()

◆ animsys_evaluate_fcurves()

static void animsys_evaluate_fcurves ( PointerRNA * ptr,
Span< FCurve * > fcurves,
const AnimationEvalContext * anim_eval_context,
bool flush_to_original )
static

Evaluate all the F-Curves in the given list This performs a set of standard checks. If extra checks are required, separate code should be used.

Definition at line 569 of file anim_sys.cc.

References animsys_write_orig_anim_rna(), BKE_animsys_rna_path_resolve(), BKE_animsys_write_to_rna_path(), calculate_fcurve(), is_fcurve_evaluatable(), and ptr.

Referenced by animsys_evaluate_action(), and nlastrip_evaluate_controls().

◆ animsys_evaluate_nla_domain()

static void animsys_evaluate_nla_domain ( PointerRNA * ptr,
NlaEvalData * channels,
AnimData * adt )
static

Ensure that all channels touched by any of the actions in enabled tracks exist. This is necessary to ensure that evaluation result depends only on current frame.

Definition at line 3198 of file anim_sys.cc.

References AnimData::action, ADT_NLA_EDIT_ON, ADT_NLA_EVAL_UPPER_TRACKS, ADT_NLA_SOLO_TRACK, BLI_gset_free(), BLI_gset_ptr_new(), AnimData::flag, LISTBASE_FOREACH, nla_eval_domain_action(), nla_eval_domain_strips(), AnimData::nla_tracks, NLATRACK_MUTED, NLATRACK_SOLO, ptr, AnimData::slot_handle, AnimData::tmp_slot_handle, and AnimData::tmpact.

Referenced by animsys_calculate_nla().

◆ animsys_evaluate_nla_for_flush()

static bool animsys_evaluate_nla_for_flush ( NlaEvalData * echannels,
PointerRNA * ptr,
const AnimData * adt,
const AnimationEvalContext * anim_eval_context,
const bool flush_to_original )
static

NLA Evaluation function - values are calculated and stored in temporary "NlaEvalChannels"

Parameters
[out]echannelsEvaluation channels with calculated values

Append strip to evaluate for this track.

Tweaked strip is evaluated differently.

Definition at line 3408 of file anim_sys.cc.

References animsys_create_action_track_strip(), animsys_create_tweak_strip(), BLI_freelistN(), NlaEvalData::eval_snapshot, ListBase::first, is_action_track_evaluated_without_nla(), is_nlatrack_evaluatable(), LISTBASE_FOREACH, NlaTrack::next, AnimData::nla_tracks, nlasnapshot_blend_strip(), nlastrips_ctime_get_strip(), nlastrips_ctime_get_strip_single(), nlatrack_find_tweaked(), ptr, NlaTrack::strips, and NlaEvalStrip::track.

Referenced by animsys_calculate_nla().

◆ animsys_evaluate_nla_for_keyframing()

◆ animsys_evaluate_overrides()

static void animsys_evaluate_overrides ( PointerRNA * ptr,
AnimData * adt )
static

◆ animsys_quaternion_evaluate_fcurves()

static void animsys_quaternion_evaluate_fcurves ( PathResolvedRNA quat_rna,
Span< FCurve * > quat_fcurves,
const AnimationEvalContext * anim_eval_context,
float r_quaternion[4] )
static

This function assumes that the quaternion keys are sequential. They do not have to be in array_index order. If the quaternion is only partially keyed, the result is normalized. If it is fully keyed, the result is returned as-is.

Definition at line 597 of file anim_sys.cc.

References BLI_assert, calculate_fcurve(), normalize_qt(), PathResolvedRNA::prop_index, and blender::Span< T >::size().

Referenced by animsys_blend_fcurves_quaternion().

◆ animsys_write_orig_anim_rna()

static void animsys_write_orig_anim_rna ( PointerRNA * ptr,
const char * rna_path,
int array_index,
float value )
static

◆ 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()

◆ 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()

◆ BKE_animsys_nla_remap_keyframe_values()

◆ BKE_animsys_read_from_rna_path()

◆ BKE_animsys_rna_path_resolve()

◆ BKE_animsys_update_driver_array()

void BKE_animsys_update_driver_array ( ID * id)

◆ BKE_animsys_write_to_rna_path()

◆ BKE_keyingset_add()

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

◆ BKE_keyingset_add_path()

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()

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 ( BlendDataReader * reader,
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 ( BlendWriter * writer,
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 ( ListBase * newlist,
const ListBase * list )

Definition at line 243 of file anim_sys.cc.

References BLI_duplicatelist(), LISTBASE_FOREACH, and MEM_dupallocN.

◆ BKE_keyingsets_foreach_id()

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

Definition at line 256 of file anim_sys.cc.

References BKE_LIB_FOREACHID_PROCESS_ID, IDWALK_CB_NOP, and LISTBASE_FOREACH.

◆ BKE_keyingsets_free()

void BKE_keyingsets_free ( ListBase * list)

◆ is_action_track_evaluated_without_nla()

static bool is_action_track_evaluated_without_nla ( const AnimData * adt,
const bool any_strip_evaluated )
static

Check for special case of non-pushed action being evaluated with no NLA influence (off and no strips evaluated) nor NLA interference (ensure NLA not soloing).

NLA settings interference.

Allow action track to evaluate as if there isn't any NLA data.

Definition at line 3360 of file anim_sys.cc.

References AnimData::action, ADT_NLA_EDIT_ON, ADT_NLA_SOLO_TRACK, and AnimData::flag.

Referenced by animsys_evaluate_nla_for_flush(), and animsys_evaluate_nla_for_keyframing().

◆ is_fcurve_evaluatable()

◆ is_nlatrack_evaluatable()

static bool is_nlatrack_evaluatable ( const AnimData * adt,
const NlaTrack * nlt )
static

◆ nla_blend_get_inverted_lower_value()

static bool nla_blend_get_inverted_lower_value ( const int blendmode,
const float strip_value,
const float blended_value,
const float influence,
float * r_lower_value )
static
Returns
true if a solution exists and the output was written to.

Definition at line 1609 of file anim_sys.cc.

References BLI_assert_msg, IS_EQF, NLASTRIP_MODE_ADD, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_MULTIPLY, NLASTRIP_MODE_REPLACE, and NLASTRIP_MODE_SUBTRACT.

Referenced by nlaevalchan_blend_value_get_inverted_lower_evalchan().

◆ nla_blend_get_inverted_strip_value()

static bool nla_blend_get_inverted_strip_value ( const int blendmode,
const float lower_value,
const float blended_value,
const float influence,
float * r_strip_value )
static
Returns
true if solution exists and output is written to.

No solution if strip had 0 influence.

Math:

blended_value = inf * (lower_value * strip_value) + (1 - inf) * lower_value blended_value - (1 - inf) * lower_value = inf * (lower_value * strip_value) (blended_value - (1 - inf) * lower_value) / (inf * lower_value) = strip_value (blended_value - lower_value + inf * lower_value) / (inf * lower_value) = strip_value ((blended_value - lower_value) / (inf * lower_value)) + 1 = strip_value

strip_value = ((blended_value - lower_value) / (inf * lower_value)) + 1

Math:

blended_value = lower_value * (1.0f - inf) + (strip_value * inf) blended_value - lower_value * (1.0f - inf) = (strip_value * inf) (blended_value - lower_value * (1.0f - inf)) / inf = strip_value

strip_value = (blended_value - lower_value * (1.0f - inf)) / inf

Definition at line 1860 of file anim_sys.cc.

References ATTR_FALLTHROUGH, BLI_assert_msg, IS_EQF, NLASTRIP_MODE_ADD, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_MULTIPLY, and NLASTRIP_MODE_SUBTRACT.

Referenced by nlaevalchan_blend_value_get_inverted_upper_evalchan().

◆ nla_blend_value()

static float nla_blend_value ( const int blendmode,
const float lower_value,
const float strip_value,
const float influence )
static

◆ nla_combine_get_inverted_lower_value()

static bool nla_combine_get_inverted_lower_value ( const int mix_mode,
float base_value,
const float strip_value,
const float blended_value,
const float influence,
float * r_lower_value )
static
Returns
true if solution exists and output written to.

Definition at line 1705 of file anim_sys.cc.

References BLI_assert_msg, IS_EQF, NEC_MIX_ADD, NEC_MIX_AXIS_ANGLE, NEC_MIX_MULTIPLY, NEC_MIX_QUATERNION, and powf.

Referenced by nlaevalchan_combine_value_get_inverted_lower_evalchan().

◆ nla_combine_get_inverted_strip_value()

static bool nla_combine_get_inverted_strip_value ( const int mix_mode,
float base_value,
const float lower_value,
const float blended_value,
const float influence,
float * r_strip_value )
static
Returns
true if solution exists and output is written to.

Definition at line 1924 of file anim_sys.cc.

References BLI_assert_msg, IS_EQF, NEC_MIX_ADD, NEC_MIX_AXIS_ANGLE, NEC_MIX_MULTIPLY, and powf.

Referenced by nlaevalchan_combine_value_get_inverted_upper_evalchan().

◆ nla_combine_quaternion()

static void nla_combine_quaternion ( const float lower_values[4],
const float strip_values[4],
const float influence,
float r_blended_value[4] )
static

Accumulate quaternion channels for Combine mode according to influence.

Returns
blended_value = lower_values @ strip_values^infl

Definition at line 1970 of file anim_sys.cc.

References mul_qt_qtqt(), normalize_qt_qt(), and pow_qt_fl_normalized().

Referenced by nlaevalchan_combine_quaternion().

◆ nla_combine_quaternion_get_inverted_lower_values()

static void nla_combine_quaternion_get_inverted_lower_values ( const float strip_values[4],
const float blended_values[4],
const float influence,
float r_lower_value[4] )
static

◆ nla_combine_quaternion_get_inverted_strip_values()

static bool nla_combine_quaternion_get_inverted_strip_values ( const float lower_values[4],
const float blended_values[4],
const float influence,
float r_strip_values[4] )
static
Returns
true if solution exists and output written to.

Definition at line 1985 of file anim_sys.cc.

References invert_qt_normalized(), IS_EQF, mul_qt_qtqt(), normalize_qt_qt(), and pow_qt_fl_normalized().

Referenced by nlaevalchan_combine_quaternion_get_inverted_upper_evalchan().

◆ nla_combine_value()

static float nla_combine_value ( const int mix_mode,
float base_value,
const float lower_value,
const float strip_value,
const float influence )
static

Definition at line 1830 of file anim_sys.cc.

References BLI_assert_msg, IS_EQF, NEC_MIX_ADD, NEC_MIX_AXIS_ANGLE, NEC_MIX_MULTIPLY, and powf.

Referenced by nlaevalchan_combine_value().

◆ nla_eval_domain_action()

◆ nla_eval_domain_strips()

static void nla_eval_domain_strips ( PointerRNA * ptr,
NlaEvalData * channels,
ListBase * strips,
GSet * touched_actions )
static

◆ nladata_flush_channels()

void nladata_flush_channels ( PointerRNA * ptr,
NlaEvalData * channels,
NlaEvalSnapshot * snapshot,
bool flush_to_original )

write the accumulated settings to.

The bitmask is set for all channels touched by NLA due to the domain() function. Channels touched by current set of evaluated strips will have a snapshot channel directly from the evaluation snapshot.

This function falls back to the default value if the snapshot channel doesn't exist. Thus channels, touched by NLA but not by the current set of evaluated strips, will be reset to default. If channel not touched by NLA then it's value is unchanged.

Definition at line 3101 of file anim_sys.cc.

References animsys_write_orig_anim_rna(), BKE_animsys_write_to_rna_path(), BLI_BITMAP_TEST, NlaEvalChannelSnapshot::length, LISTBASE_FOREACH, nlaeval_snapshot_find_channel(), PathResolvedRNA::prop_index, PathResolvedRNA::ptr, ptr, and NlaEvalChannelSnapshot::values.

Referenced by animsys_calculate_nla().

◆ nlaeval_fmodifiers_join_stacks()

static void nlaeval_fmodifiers_join_stacks ( ListBase * result,
ListBase * list1,
ListBase * list2 )
static

◆ nlaeval_fmodifiers_split_stacks()

static void nlaeval_fmodifiers_split_stacks ( ListBase * list1,
ListBase * list2 )
static

◆ nlaeval_free()

◆ nlaeval_init()

◆ nlaeval_snapshot_ensure_channel()

◆ nlaeval_snapshot_ensure_size()

◆ nlaeval_snapshot_ensure_slot()

◆ nlaeval_snapshot_find_channel()

◆ nlaeval_snapshot_free_data()

◆ nlaeval_snapshot_get()

◆ nlaeval_snapshot_init()

◆ nlaevalchan_assert_blendOrcombine_compatible()

◆ nlaevalchan_assert_blendOrcombine_compatible_quaternion()

◆ nlaevalchan_assert_nonNull()

◆ nlaevalchan_blend_value()

static void nlaevalchan_blend_value ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * upper_necs,
const int upper_blendmode,
const float upper_influence,
NlaEvalChannelSnapshot * r_blended_necs )
static

Based on blendmode, blend lower necs with upper necs into blended necs.

Each upper value's blend domain determines whether to blend or to copy directly from lower.

Definition at line 2118 of file anim_sys.cc.

References NlaEvalChannelSnapshot::blend_domain, BLI_BITMAP_TEST_BOOL, length(), NlaEvalChannelSnapshot::length, nla_blend_value(), nlaevalchan_assert_blendOrcombine_compatible(), nlaevalchan_blendOrcombine_try_copy_from_lower(), NlaValidMask::ptr, and NlaEvalChannelSnapshot::values.

Referenced by nlaevalchan_blendOrcombine().

◆ nlaevalchan_blend_value_get_inverted_lower_evalchan()

◆ nlaevalchan_blend_value_get_inverted_upper_evalchan()

static void nlaevalchan_blend_value_get_inverted_upper_evalchan ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * blended_necs,
const int upper_blendmode,
const float upper_influence,
NlaEvalChannelSnapshot * r_upper_necs )
static

Based on blend-mode, solve for the upper values such that when lower blended with upper then we get blended values as a result.

Only processes blended values in the remap domain. Successfully remapped upper values are placed in the remap domain so caller knows which values are usable.

Definition at line 2263 of file anim_sys.cc.

References BLI_BITMAP_DISABLE, BLI_BITMAP_SET, BLI_BITMAP_TEST_BOOL, length(), NlaEvalChannelSnapshot::length, nla_blend_get_inverted_strip_value(), nlaevalchan_assert_blendOrcombine_compatible(), nlaevalchan_assert_nonNull(), NlaValidMask::ptr, NlaEvalChannelSnapshot::remap_domain, and NlaEvalChannelSnapshot::values.

Referenced by nlaevalchan_blendOrcombine_get_inverted_upper_evalchan().

◆ nlaevalchan_blendOrcombine()

static void nlaevalchan_blendOrcombine ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * upper_necs,
const int upper_blendmode,
const float upper_influence,
NlaEvalChannelSnapshot * r_blended_necs )
static

Based on blend-mode and mix-mode, blend lower necs with upper necs into blended necs.

Each upper value's blend domain determines whether to blend or to copy directly from lower.

Parameters
lower_necsNever nullptr.
upper_necsCan be nullptr.
upper_blendmodeEnum value in eNlaStrip_Blend_Mode.
upper_influenceValue in range [0, 1].
upper_necsNever nullptr.

Definition at line 2217 of file anim_sys.cc.

References BLI_assert_msg, NlaEvalChannelSnapshot::channel, NlaEvalChannel::mix_mode, NEC_MIX_ADD, NEC_MIX_AXIS_ANGLE, NEC_MIX_MULTIPLY, NEC_MIX_QUATERNION, nlaevalchan_assert_nonNull(), nlaevalchan_blend_value(), nlaevalchan_combine_quaternion(), nlaevalchan_combine_value(), NLASTRIP_MODE_ADD, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_MULTIPLY, NLASTRIP_MODE_REPLACE, and NLASTRIP_MODE_SUBTRACT.

Referenced by nlasnapshot_blend().

◆ nlaevalchan_blendOrCombine_get_inverted_lower_evalchan()

static void nlaevalchan_blendOrCombine_get_inverted_lower_evalchan ( NlaEvalChannelSnapshot * blended_necs,
NlaEvalChannelSnapshot * upper_necs,
const int upper_blendmode,
const float upper_influence,
NlaEvalChannelSnapshot * r_lower_necs )
static

Based on blendmode and mix mode, solve for the lower values such that when lower blended or combined with upper then we get blended values as a result.

Only processes blended values in the remap domain. Successfully remapped lower values are placed in the remap domain so caller knows which values are usable.

Parameters
blended_necsNever nullptr.
upper_necsCan be nullptr.
upper_blendmodeEnum value in eNlaStrip_Blend_Mode.
upper_influenceValue in range [0, 1].
r_lower_necsNever nullptr.

Definition at line 2542 of file anim_sys.cc.

References BLI_assert_msg, NlaEvalChannelSnapshot::channel, NlaEvalChannel::mix_mode, NEC_MIX_ADD, NEC_MIX_AXIS_ANGLE, NEC_MIX_MULTIPLY, NEC_MIX_QUATERNION, nlaevalchan_assert_nonNull(), nlaevalchan_blend_value_get_inverted_lower_evalchan(), nlaevalchan_combine_quaternion_get_inverted_lower_evalchan(), nlaevalchan_combine_value_get_inverted_lower_evalchan(), NLASTRIP_MODE_ADD, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_MULTIPLY, NLASTRIP_MODE_REPLACE, and NLASTRIP_MODE_SUBTRACT.

Referenced by nlasnapshot_blend_get_inverted_lower_snapshot().

◆ nlaevalchan_blendOrcombine_get_inverted_upper_evalchan()

static void nlaevalchan_blendOrcombine_get_inverted_upper_evalchan ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * blended_necs,
const int upper_blendmode,
const float upper_influence,
NlaEvalChannelSnapshot * r_upper_necs )
static

Based on blend-mode and mix mode, solve for the upper values such that when lower blended or combined with upper then we get blended values as a result.

Only processes blended values in the remap domain. Successfully remapped upper values are placed in the remap domain so caller knows which values are usable.

Parameters
lower_necsNever nullptr.
blended_necsNever nullptr.
upper_blendmodeEnum value in eNlaStrip_Blend_Mode.
upper_influenceValue in range [0, 1].
r_upper_necsNever nullptr.

Definition at line 2366 of file anim_sys.cc.

References BLI_assert_msg, BLI_bitmap_set_all(), NlaEvalChannelSnapshot::channel, IS_EQF, NlaEvalChannelSnapshot::length, NlaEvalChannel::mix_mode, NEC_MIX_ADD, NEC_MIX_AXIS_ANGLE, NEC_MIX_MULTIPLY, NEC_MIX_QUATERNION, nlaevalchan_assert_nonNull(), nlaevalchan_blend_value_get_inverted_upper_evalchan(), nlaevalchan_combine_quaternion_get_inverted_upper_evalchan(), nlaevalchan_combine_value_get_inverted_upper_evalchan(), NLASTRIP_MODE_ADD, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_MULTIPLY, NLASTRIP_MODE_REPLACE, NLASTRIP_MODE_SUBTRACT, NlaValidMask::ptr, and NlaEvalChannelSnapshot::remap_domain.

Referenced by nlasnapshot_blend_get_inverted_upper_snapshot().

◆ nlaevalchan_blendOrcombine_try_copy_from_lower()

static bool nlaevalchan_blendOrcombine_try_copy_from_lower ( const NlaEvalChannelSnapshot * lower_necs,
const NlaEvalChannelSnapshot * upper_necs,
const float upper_influence,
NlaEvalChannelSnapshot * r_blended_necs )
static

Copies from lower necs to blended necs if upper necs is nullptr or has zero influence.

Returns
true if copied.

Definition at line 2070 of file anim_sys.cc.

References IS_EQF, and nlaevalchan_copy_values().

Referenced by nlaevalchan_blend_value(), nlaevalchan_combine_quaternion(), and nlaevalchan_combine_value().

◆ nlaevalchan_blendOrcombine_try_copy_to_lower()

static bool nlaevalchan_blendOrcombine_try_copy_to_lower ( NlaEvalChannelSnapshot * blended_necs,
NlaEvalChannelSnapshot * upper_necs,
const float upper_influence,
NlaEvalChannelSnapshot * r_lower_necs )
static

Copies to lower necs from blended necs if upper necs is nullptr or has zero influence. If successful, copies blended_necs remap domains to lower_necs.

Does not check upper value blend domains.

Returns
true if copied.

Definition at line 2093 of file anim_sys.cc.

References BLI_bitmap_copy_all(), IS_EQF, NlaEvalChannelSnapshot::length, nlaevalchan_copy_values(), NlaValidMask::ptr, and NlaEvalChannelSnapshot::remap_domain.

Referenced by nlaevalchan_blend_value_get_inverted_lower_evalchan(), nlaevalchan_combine_quaternion_get_inverted_lower_evalchan(), and nlaevalchan_combine_value_get_inverted_lower_evalchan().

◆ nlaevalchan_combine_quaternion()

static void nlaevalchan_combine_quaternion ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * upper_necs,
const float upper_influence,
NlaEvalChannelSnapshot * r_blended_necs )
static

Quaternion combines lower necs with upper necs into blended necs.

Each upper value's blend domain determines whether to blend or to copy directly from lower.

No need to check per index. We limit to all or nothing combining for quaternions.

Definition at line 2183 of file anim_sys.cc.

References NlaEvalChannelSnapshot::blend_domain, BLI_BITMAP_TEST_BOOL, nla_combine_quaternion(), nlaevalchan_assert_blendOrcombine_compatible_quaternion(), nlaevalchan_blendOrcombine_try_copy_from_lower(), nlaevalchan_copy_values(), NlaValidMask::ptr, and NlaEvalChannelSnapshot::values.

Referenced by nlaevalchan_blendOrcombine().

◆ nlaevalchan_combine_quaternion_get_inverted_lower_evalchan()

◆ nlaevalchan_combine_quaternion_get_inverted_upper_evalchan()

static void nlaevalchan_combine_quaternion_get_inverted_upper_evalchan ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * blended_necs,
const float upper_influence,
NlaEvalChannelSnapshot * r_upper_necs )
static

Solve for the upper values such that when lower quaternion combined with upper then we get blended values as a result.

All blended values must be in the remap domain. If successfully remapped, then all upper values are placed in the remap domain so caller knows the result is usable.

Definition at line 2334 of file anim_sys.cc.

References BLI_bitmap_set_all(), nla_combine_quaternion_get_inverted_strip_values(), nlaevalchan_assert_blendOrcombine_compatible_quaternion(), nlaevalchan_assert_nonNull(), nlaevalchan_combine_quaternion_handle_undefined_blend_values(), NlaValidMask::ptr, NlaEvalChannelSnapshot::remap_domain, and NlaEvalChannelSnapshot::values.

Referenced by nlaevalchan_blendOrcombine_get_inverted_upper_evalchan().

◆ nlaevalchan_combine_quaternion_handle_undefined_blend_values()

static bool nlaevalchan_combine_quaternion_handle_undefined_blend_values ( NlaEvalChannelSnapshot * blended_necs,
NlaEvalChannelSnapshot * upper_or_lower_necs )
static

Check each remap domain of blended values individually in case animator had a non-combine NLA strip with a subset of quaternion channels and remapping through any of them failed and thus potentially has undefined values.

Returns
true if case occurred and handled. Returns false if case didn't occur.

Definition at line 2038 of file anim_sys.cc.

References BLI_bitmap_set_all(), BLI_BITMAP_TEST_BOOL, NlaValidMask::ptr, and NlaEvalChannelSnapshot::remap_domain.

Referenced by nlaevalchan_combine_quaternion_get_inverted_lower_evalchan(), and nlaevalchan_combine_quaternion_get_inverted_upper_evalchan().

◆ nlaevalchan_combine_value()

static void nlaevalchan_combine_value ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * upper_necs,
const float upper_influence,
NlaEvalChannelSnapshot * r_blended_necs )
static

Based on mix-mode, provided by one the necs, combines lower necs with upper necs into blended necs.

Each upper value's blend domain determines whether to blend or to copy directly from lower.

Definition at line 2149 of file anim_sys.cc.

References NlaEvalChannel::base_snapshot, NlaEvalChannelSnapshot::blend_domain, BLI_BITMAP_TEST_BOOL, NlaEvalChannelSnapshot::channel, length(), NlaEvalChannelSnapshot::length, NlaEvalChannel::mix_mode, nla_combine_value(), nlaevalchan_assert_blendOrcombine_compatible(), nlaevalchan_blendOrcombine_try_copy_from_lower(), NlaValidMask::ptr, and NlaEvalChannelSnapshot::values.

Referenced by nlaevalchan_blendOrcombine().

◆ nlaevalchan_combine_value_get_inverted_lower_evalchan()

◆ nlaevalchan_combine_value_get_inverted_upper_evalchan()

static void nlaevalchan_combine_value_get_inverted_upper_evalchan ( NlaEvalChannelSnapshot * lower_necs,
NlaEvalChannelSnapshot * blended_necs,
const float upper_influence,
NlaEvalChannelSnapshot * r_upper_necs )
static

Based on mix-mode, solve for the upper values such that when lower combined with upper then we get blended values as a result.

Only processes blended values in the remap domain. Successfully remapped upper values are placed in the remap domain so caller knows which values are usable.

Definition at line 2296 of file anim_sys.cc.

References NlaEvalChannel::base_snapshot, BLI_BITMAP_DISABLE, BLI_BITMAP_SET, BLI_BITMAP_TEST_BOOL, NlaEvalChannelSnapshot::channel, length(), NlaEvalChannelSnapshot::length, NlaEvalChannel::mix_mode, nla_combine_get_inverted_strip_value(), nlaevalchan_assert_blendOrcombine_compatible(), nlaevalchan_assert_nonNull(), NlaValidMask::ptr, NlaEvalChannelSnapshot::remap_domain, and NlaEvalChannelSnapshot::values.

Referenced by nlaevalchan_blendOrcombine_get_inverted_upper_evalchan().

◆ nlaevalchan_copy_values()

◆ nlaevalchan_detect_mix_mode()

◆ nlaevalchan_free_data()

static void nlaevalchan_free_data ( NlaEvalChannel * nec)
static

Definition at line 1340 of file anim_sys.cc.

References NlaEvalChannel::domain, NlaEvalChannel::key, and nlavalidmask_free().

Referenced by nlaeval_free().

◆ nlaevalchan_get_default_values()

◆ nlaevalchan_keycmp()

static bool nlaevalchan_keycmp ( const void * a,
const void * b )
static

Definition at line 1195 of file anim_sys.cc.

References B, and b.

Referenced by nlaeval_init().

◆ nlaevalchan_keyhash()

static uint nlaevalchan_keyhash ( const void * ptr)
static

◆ nlaevalchan_snapshot_copy()

static void nlaevalchan_snapshot_copy ( NlaEvalChannelSnapshot * dst,
const NlaEvalChannelSnapshot * src )
static

◆ nlaevalchan_snapshot_free()

◆ nlaevalchan_snapshot_new()

◆ nlaevalchan_validate_index()

static int nlaevalchan_validate_index ( const NlaEvalChannel * nec,
int index )
static

Definition at line 1376 of file anim_sys.cc.

References NlaEvalChannel::is_array.

Referenced by nla_eval_domain_action(), and nlaevalchan_validate_index_ex().

◆ nlaevalchan_validate_index_ex()

static bool nlaevalchan_validate_index_ex ( const NlaEvalChannel * nec,
const int array_index )
static

Although array_index comes from fcurve, that doesn't necessarily mean the property has that many elements.

Definition at line 1388 of file anim_sys.cc.

References NlaEvalChannel::base_snapshot, CLOG_WARN, G, G_DEBUG, NlaEvalChannel::key, NlaEvalChannelSnapshot::length, LOG, nlaevalchan_validate_index(), PointerRNA::owner_id, NlaEvalChannelKey::ptr, and NlaEvalChannel::rna_path.

Referenced by nlasnapshot_from_action().

◆ nlaevalchan_verify()

◆ nlaevalchan_verify_key()

◆ nlasnapshot_blend()

void nlasnapshot_blend ( NlaEvalData * eval_data,
NlaEvalSnapshot * lower_snapshot,
NlaEvalSnapshot * upper_snapshot,
short upper_blendmode,
float upper_influence,
NlaEvalSnapshot * r_blended_snapshot )

Blends the lower_snapshot with the upper_snapshot into r_blended_snapshot according to the given upper_blendmode and upper_influence.

For upper_snapshot, blending limited to values in the blend_domain. For Replace blend-mode, this allows the upper snapshot to have a location XYZ channel where only a subset of values are blended.

Blend with lower_snapshot's base or default.

Definition at line 3664 of file anim_sys.cc.

References NlaEvalSnapshot::base, NlaEvalData::channels, LISTBASE_FOREACH, nlaeval_snapshot_ensure_channel(), nlaeval_snapshot_ensure_size(), nlaeval_snapshot_find_channel(), nlaeval_snapshot_get(), nlaevalchan_blendOrcombine(), and NlaEvalData::num_channels.

Referenced by nlastrip_evaluate_actionclip(), and nlastrip_evaluate_transition().

◆ nlasnapshot_blend_get_inverted_lower_snapshot()

void nlasnapshot_blend_get_inverted_lower_snapshot ( NlaEvalData * eval_data,
NlaEvalSnapshot * blended_snapshot,
NlaEvalSnapshot * upper_snapshot,
const short upper_blendmode,
const float upper_influence,
NlaEvalSnapshot * r_lower_snapshot )

Using blended_snapshot and upper_snapshot, we can solve for the r_lower_snapshot.

Only channels that exist within blended_snapshot are processed. Only blended values within the remap_domain are processed.

Writes to r_upper_snapshot NlaEvalChannelSnapshot->remap_domain to match remapping success.

Assumes caller marked upper values that are in the blend_domain. This determines whether the blended value came directly from the lower snapshot or a result of blending.

Definition at line 3719 of file anim_sys.cc.

References NlaEvalData::channels, LISTBASE_FOREACH, nlaeval_snapshot_ensure_channel(), nlaeval_snapshot_ensure_size(), nlaeval_snapshot_get(), nlaevalchan_blendOrCombine_get_inverted_lower_evalchan(), and NlaEvalData::num_channels.

Referenced by nlastrip_evaluate_actionclip().

◆ nlasnapshot_blend_get_inverted_upper_snapshot()

void nlasnapshot_blend_get_inverted_upper_snapshot ( NlaEvalData * eval_data,
NlaEvalSnapshot * lower_snapshot,
NlaEvalSnapshot * blended_snapshot,
short upper_blendmode,
float upper_influence,
NlaEvalSnapshot * r_upper_snapshot )

Using blended_snapshot and lower_snapshot, we can solve for the r_upper_snapshot.

Only channels that exist within blended_snapshot are inverted.

For r_upper_snapshot, disables NlaEvalChannelSnapshot->remap_domain for failed inversions. Only values within the remap_domain are processed.

We assume the caller only wants a subset of channels to be inverted, those that exist within blended_snapshot.

Definition at line 3691 of file anim_sys.cc.

References NlaEvalSnapshot::base, NlaEvalData::channels, LISTBASE_FOREACH, nlaeval_snapshot_ensure_channel(), nlaeval_snapshot_ensure_size(), nlaeval_snapshot_find_channel(), nlaeval_snapshot_get(), nlaevalchan_blendOrcombine_get_inverted_upper_evalchan(), and NlaEvalData::num_channels.

Referenced by BKE_animsys_nla_remap_keyframe_values().

◆ nlasnapshot_blend_strip()

void nlasnapshot_blend_strip ( PointerRNA * ptr,
NlaEvalData * channels,
ListBase * modifiers,
NlaEvalStrip * nes,
NlaEvalSnapshot * snapshot,
const AnimationEvalContext * anim_eval_context,
const bool flush_to_original )

◆ nlasnapshot_blend_strip_get_inverted_lower_snapshot()

void nlasnapshot_blend_strip_get_inverted_lower_snapshot ( PointerRNA * ptr,
NlaEvalData * channels,
ListBase * modifiers,
NlaEvalStrip * nes,
NlaEvalSnapshot * snapshot,
const AnimationEvalContext * anim_eval_context )

◆ nlasnapshot_blend_strip_no_blend()

void nlasnapshot_blend_strip_no_blend ( PointerRNA * ptr,
NlaEvalData * channels,
ListBase * modifiers,
NlaEvalStrip * nes,
NlaEvalSnapshot * snapshot,
const AnimationEvalContext * anim_eval_context )

Definition at line 3090 of file anim_sys.cc.

References nlastrip_evaluate(), ptr, and STRIP_EVAL_NOBLEND.

Referenced by nlastrip_evaluate_transition().

◆ nlasnapshot_enable_all_blend_domain()

◆ nlasnapshot_ensure_channels()

void nlasnapshot_ensure_channels ( NlaEvalData * eval_data,
NlaEvalSnapshot * snapshot )

◆ nlasnapshot_from_action()

◆ nlastrip_evaluate()

◆ nlastrip_evaluate_actionclip()

◆ nlastrip_evaluate_controls()

◆ nlastrip_evaluate_meta()

◆ nlastrip_evaluate_transition()

◆ nlastrip_get_influence()

static float nlastrip_get_influence ( NlaStrip * strip,
float cframe )
static

◆ nlastrips_ctime_get_strip()

◆ nlastrips_ctime_get_strip_single()

static NlaEvalStrip * nlastrips_ctime_get_strip_single ( ListBase * dst_list,
NlaStrip * single_strip,
const AnimationEvalContext * anim_eval_context,
const bool flush_to_original )
static

◆ nlatrack_find_tweaked()

static NlaTrack * nlatrack_find_tweaked ( const AnimData * adt)
static

XXX(Wayde Moss): BKE_nlatrack_find_tweaked() exists within nla.cc, but it doesn't appear to work as expected. From animsys_evaluate_nla_for_flush(), it returns nullptr in tweak mode. I'm not sure why. Preferably, it would be as simple as checking for (adt->act_Track == nlt) but that doesn't work either, neither does comparing indices.

This function is a temporary work around. The first disabled track is always the tweaked track.

Definition at line 3388 of file anim_sys.cc.

References LISTBASE_FOREACH, AnimData::nla_tracks, and NLATRACK_DISABLED.

Referenced by animsys_evaluate_nla_for_flush(), and animsys_evaluate_nla_for_keyframing().

◆ nlavalidmask_free()

static void nlavalidmask_free ( NlaValidMask * mask)
static

Definition at line 1178 of file anim_sys.cc.

References MEM_freeN().

Referenced by nlaevalchan_free_data(), and nlaevalchan_snapshot_free().

◆ nlavalidmask_init()

static void nlavalidmask_init ( NlaValidMask * mask,
int bits )
static

Definition at line 1167 of file anim_sys.cc.

References BLI_BITMAP_NEW, and BLI_BITMAP_SIZE.

Referenced by nlaevalchan_snapshot_new(), and nlaevalchan_verify_key().

Variable Documentation

◆ LOG