Blender V4.3
nla_private.h File Reference
#include "BLI_bitmap.h"
#include "BLI_ghash.h"
#include "RNA_types.hh"

Go to the source code of this file.

Classes

struct  NlaEvalStrip
 
struct  NlaEvalChannelKey
 
struct  NlaValidMask
 
struct  NlaEvalChannelSnapshot
 
struct  NlaEvalChannel
 
struct  NlaEvalSnapshot
 
struct  NlaEvalData
 
struct  NlaKeyframingContext
 

Typedefs

typedef struct NlaEvalStrip NlaEvalStrip
 
typedef struct NlaEvalChannelKey NlaEvalChannelKey
 
typedef struct NlaValidMask NlaValidMask
 
typedef struct NlaEvalChannelSnapshot NlaEvalChannelSnapshot
 
typedef struct NlaEvalChannel NlaEvalChannel
 
typedef struct NlaEvalSnapshot NlaEvalSnapshot
 
typedef struct NlaEvalData NlaEvalData
 
typedef struct NlaKeyframingContext NlaKeyframingContext
 

Enumerations

enum  eNlaEvalStrip_StripMode {
  NES_TIME_BEFORE = -1 , NES_TIME_WITHIN , NES_TIME_AFTER , NES_TIME_TRANSITION_START ,
  NES_TIME_TRANSITION_END
}
 
enum  eNlaEvalChannel_MixMode { NEC_MIX_ADD , NEC_MIX_MULTIPLY , NEC_MIX_QUATERNION , NEC_MIX_AXIS_ANGLE }
 
enum  eNlaStripEvaluate_Mode { STRIP_EVAL_BLEND , STRIP_EVAL_BLEND_GET_INVERTED_LOWER_SNAPSHOT , STRIP_EVAL_NOBLEND }
 

Functions

float nlastrip_get_frame (NlaStrip *strip, float cframe, short mode)
 
NlaEvalStripnlastrips_ctime_get_strip (ListBase *list, ListBase *strips, short index, const struct AnimationEvalContext *anim_eval_context, bool flush_to_original)
 
void nlastrip_evaluate (const int evaluation_mode, PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const struct AnimationEvalContext *anim_eval_context, bool flush_to_original)
 
void nladata_flush_channels (PointerRNA *ptr, NlaEvalData *channels, NlaEvalSnapshot *snapshot, 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, short upper_blendmode, float upper_influence, NlaEvalSnapshot *r_blended_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)
 
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)
 
void nlasnapshot_blend_strip (PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const struct 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 struct AnimationEvalContext *anim_eval_context)
 
void nlasnapshot_blend_strip_no_blend (PointerRNA *ptr, NlaEvalData *channels, ListBase *modifiers, NlaEvalStrip *nes, NlaEvalSnapshot *snapshot, const struct AnimationEvalContext *anim_eval_context)
 

Typedef Documentation

◆ NlaEvalChannel

typedef struct NlaEvalChannel NlaEvalChannel

Temp channel for accumulating data from NLA for a single property. Handles array properties as a unit to allow intelligent blending.

◆ NlaEvalChannelKey

typedef struct NlaEvalChannelKey NlaEvalChannelKey

Unique channel key for GHash.

◆ NlaEvalChannelSnapshot

typedef struct NlaEvalChannelSnapshot NlaEvalChannelSnapshot

Set of property values for blending.

◆ NlaEvalData

typedef struct NlaEvalData NlaEvalData

Set of all channels covered by NLA.

◆ NlaEvalSnapshot

typedef struct NlaEvalSnapshot NlaEvalSnapshot

Set of values for all channels.

◆ NlaEvalStrip

typedef struct NlaEvalStrip NlaEvalStrip

Used for list of strips to accumulate at current time.

◆ NlaKeyframingContext

typedef struct NlaKeyframingContext NlaKeyframingContext

Information about the currently edited strip and ones below it for keyframing.

◆ NlaValidMask

typedef struct NlaValidMask NlaValidMask

Bitmask of array indices touched by actions.

Enumeration Type Documentation

◆ eNlaEvalChannel_MixMode

NlaEvalChannel::mix_mode

Enumerator
NEC_MIX_ADD 
NEC_MIX_MULTIPLY 
NEC_MIX_QUATERNION 
NEC_MIX_AXIS_ANGLE 

Definition at line 87 of file nla_private.h.

◆ eNlaEvalStrip_StripMode

NlaEvalStrip::strip_mode.

Enumerator
NES_TIME_BEFORE 
NES_TIME_WITHIN 
NES_TIME_AFTER 
NES_TIME_TRANSITION_START 
NES_TIME_TRANSITION_END 

Definition at line 42 of file nla_private.h.

◆ eNlaStripEvaluate_Mode

Evaluates the given evaluation strip.

Enumerator
STRIP_EVAL_BLEND 

Blend upper strip with lower stack.

STRIP_EVAL_BLEND_GET_INVERTED_LOWER_SNAPSHOT 

Given upper strip and blended snapshot, solve for lower stack.

STRIP_EVAL_NOBLEND 

Store strip fcurve values in snapshot, properly marking blend_domain values.

Currently only used for transitions to distinguish fcurve sampled values from default or lower stack values.

Definition at line 189 of file nla_private.h.

Function Documentation

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

◆ 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 struct 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 struct 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 struct AnimationEvalContext * anim_eval_context )

◆ nlasnapshot_enable_all_blend_domain()

◆ nlasnapshot_ensure_channels()

void nlasnapshot_ensure_channels ( NlaEvalData * eval_data,
NlaEvalSnapshot * snapshot )

◆ nlastrip_evaluate()

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

◆ nlastrip_get_frame()

float nlastrip_get_frame ( NlaStrip * strip,
float cframe,
short mode )

Convert non clipped mapping for strip-time <-> global time: mode = eNlaTime_ConvertModes[] -> NLATIME_CONVERT_*

Only secure for 'internal' (i.e. within AnimSys evaluation) operations, but should not be directly relied on for stuff which interacts with editors.

Definition at line 721 of file blenkernel/intern/nla.cc.

References nlastrip_get_frame_actionclip(), nlastrip_get_frame_transition(), NLASTRIP_TYPE_CLIP, NLASTRIP_TYPE_META, NLASTRIP_TYPE_TRANSITION, and NlaStrip::type.

Referenced by bezt_apply_nlamapping(), BKE_nla_tweakedit_remap(), nla_actionclip_draw_markers(), nlaedit_apply_scale_exec(), nlaedit_split_strip_actclip(), and nlastrip_evaluate_controls().

◆ nlastrips_ctime_get_strip()

NlaEvalStrip * nlastrips_ctime_get_strip ( ListBase * list,
ListBase * strips,
short index,
const struct AnimationEvalContext * anim_eval_context,
bool flush_to_original )

Gets the strip active at the current time for a list of strips for evaluation purposes.