Blender V5.0
nla.cc File Reference
#include <cfloat>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.hh"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_speaker_types.h"
#include "BKE_action.hh"
#include "BKE_anim_data.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_nla.hh"
#include "BKE_sound.h"
#include "BLO_read_write.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "ANIM_nla.hh"
#include "nla_private.h"

Go to the source code of this file.

Namespaces

namespace  blender
namespace  blender::bke
namespace  blender::bke::nla

Macros

#define STASH_TRACK_NAME   DATA_("[Action Stash]")

Functions

static void nla_tweakmode_find_active (const ListBase *nla_tracks, NlaTrack **r_track_of_active_strip, NlaStrip **r_active_strip)
void BKE_nlastrip_free (NlaStrip *strip, const bool do_id_user)
void BKE_nlatrack_free (NlaTrack *nlt, const bool do_id_user)
void BKE_nla_tracks_free (ListBase *tracks, bool do_id_user)
NlaStripBKE_nlastrip_copy (Main *bmain, NlaStrip *strip, const bool use_same_action, const int flag)
NlaTrackBKE_nlatrack_copy (Main *bmain, NlaTrack *nlt, const bool use_same_actions, const int flag)
void BKE_nla_tracks_copy (Main *bmain, ListBase *dst, const ListBase *src, const int flag)
static NlaStripfind_active_strip_from_listbase (const NlaStrip *active_strip, const ListBase *strips_source, const ListBase *strips_dest)
static void update_active_strip (AnimData *adt_dest, NlaTrack *track_dest, const AnimData *adt_source, const NlaTrack *track_source)
static void update_active_track (AnimData *adt_dest, const AnimData *adt_source)
void BKE_nla_tracks_copy_from_adt (Main *bmain, AnimData *adt_dest, const AnimData *adt_source, const int flag)
NlaTrackBKE_nlatrack_new ()
void BKE_nlatrack_insert_before (ListBase *nla_tracks, NlaTrack *next, NlaTrack *new_track, bool is_liboverride)
void BKE_nlatrack_insert_after (ListBase *nla_tracks, NlaTrack *prev, NlaTrack *new_track, const bool is_liboverride)
NlaTrackBKE_nlatrack_new_before (ListBase *nla_tracks, NlaTrack *next, bool is_liboverride)
NlaTrackBKE_nlatrack_new_after (ListBase *nla_tracks, NlaTrack *prev, bool is_liboverride)
NlaTrackBKE_nlatrack_new_head (ListBase *nla_tracks, bool is_liboverride)
NlaTrackBKE_nlatrack_new_tail (ListBase *nla_tracks, const bool is_liboverride)
float BKE_nla_clip_length_get_nonzero (const NlaStrip *strip)
void BKE_nla_clip_length_ensure_nonzero (const float *actstart, float *r_actend)
static NlaStripnlastrip_new (bAction *act, ID &animated_id)
static void nlastrip_set_initial_length (NlaStrip *strip)
NlaStripBKE_nlastrip_new (bAction *act, ID &animated_id)
NlaStripBKE_nlastrip_new_for_slot (bAction *act, blender::animrig::slot_handle_t slot_handle, ID &animated_id)
NlaStripBKE_nlastack_add_strip (const OwnedAnimData owned_adt, const bool is_liboverride)
NlaStripBKE_nla_add_soundstrip (Main *bmain, Scene *scene, Speaker *speaker)
void BKE_nla_strip_foreach_id (NlaStrip *strip, LibraryForeachIDData *data)
void BKE_nlatrack_remove (ListBase *tracks, NlaTrack *nlt)
void BKE_nlatrack_remove_and_free (ListBase *tracks, NlaTrack *nlt, bool do_id_user)
bool BKE_nlatrack_is_enabled (const AnimData &adt, const NlaTrack &nlt)
static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short mode)
static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short mode)
float nlastrip_get_frame (NlaStrip *strip, float cframe, short mode)
float BKE_nla_tweakedit_remap (AnimData *adt, const float cframe, const eNlaTime_ConvertModes mode)
bool BKE_nlastrips_has_space (ListBase *strips, float start, float end)
void BKE_nlastrips_sort_strips (ListBase *strips)
void BKE_nlastrips_add_strip_unsafe (ListBase *strips, NlaStrip *strip)
bool BKE_nlastrips_add_strip (ListBase *strips, NlaStrip *strip)
void BKE_nlastrips_make_metas (ListBase *strips, bool is_temp)
void BKE_nlastrips_clear_metastrip (ListBase *strips, NlaStrip *strip)
void BKE_nlastrips_clear_metas (ListBase *strips, bool only_sel, bool only_temp)
bool BKE_nlameta_add_strip (NlaStrip *mstrip, NlaStrip *strip)
void BKE_nlameta_flush_transforms (NlaStrip *mstrip)
NlaTrackBKE_nlatrack_find_active (ListBase *tracks)
NlaTrackBKE_nlatrack_find_tweaked (AnimData *adt)
void BKE_nlatrack_solo_toggle (AnimData *adt, NlaTrack *nlt)
void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a)
bool BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end)
bool BKE_nlatrack_has_strips (ListBase *tracks)
void BKE_nlatrack_sort_strips (NlaTrack *nlt)
bool BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip, const bool is_liboverride)
void BKE_nlatrack_remove_strip (NlaTrack *track, NlaStrip *strip)
bool BKE_nlatrack_get_bounds (NlaTrack *nlt, float bounds[2])
bool BKE_nlatrack_is_nonlocal_in_liboverride (const ID *id, const NlaTrack *nlt)
static NlaStripnlastrip_find_active (ListBase *strips)
float BKE_nlastrip_compute_frame_from_previous_strip (NlaStrip *strip)
float BKE_nlastrip_compute_frame_to_next_strip (NlaStrip *strip)
NlaStripBKE_nlastrip_next_in_track (NlaStrip *strip, bool skip_transitions)
NlaStripBKE_nlastrip_prev_in_track (NlaStrip *strip, bool skip_transitions)
NlaStripBKE_nlastrip_find_active (NlaTrack *nlt)
void BKE_nlastrip_remove (ListBase *strips, NlaStrip *strip)
void BKE_nlastrip_remove_and_free (ListBase *strips, NlaStrip *strip, const bool do_id_user)
void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip)
static NlaStripnlastrip_find_by_name (ListBase *strips, const char *name)
NlaStripBKE_nlastrip_find_by_name (NlaTrack *nlt, const char *name)
bool BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max)
float BKE_nlastrip_distance_to_frame (const NlaStrip *strip, const float timeline_frame)
static void nlastrip_fix_resize_overlaps (NlaStrip *strip)
void BKE_nlastrip_recalculate_bounds_sync_action (NlaStrip *strip)
void BKE_nlastrip_recalculate_bounds (NlaStrip *strip)
void BKE_nlastrip_recalculate_blend (NlaStrip *strip)
bool BKE_nlatrack_has_animated_strips (NlaTrack *nlt)
bool BKE_nlatracks_have_animated_strips (ListBase *tracks)
void BKE_nlastrip_validate_fcurves (NlaStrip *strip)
bool BKE_nlastrip_controlcurve_remove (NlaStrip *strip, FCurve *fcurve)
bool BKE_nlastrip_has_curves_for_property (const PointerRNA *ptr, const PropertyRNA *prop)
void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
static void nlastrip_get_endpoint_overlaps (NlaStrip *strip, NlaTrack *track, float **start, float **end)
static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
static bool nlastrip_validate_transition_start_end (ListBase *strips, NlaStrip *strip)
void BKE_nla_validate_state (AnimData *adt)
bool BKE_nla_action_slot_is_stashed (AnimData *adt, bAction *act, const blender::animrig::slot_handle_t slot_handle)
bool BKE_nla_action_stash (const OwnedAnimData owned_adt, const bool is_liboverride)
void BKE_nla_action_pushdown (const OwnedAnimData owned_adt, const bool is_liboverride)
bool BKE_nla_tweakmode_enter (const OwnedAnimData owned_adt)
static bool is_nla_in_tweakmode (AnimData *adt)
static void nla_tweakmode_exit_sync_strip_lengths (AnimData *adt)
static void nla_tweakmode_exit_nofollowptr (AnimData *adt)
void BKE_nla_tweakmode_exit_nofollowptr (AnimData *adt)
void BKE_nla_tweakmode_exit (const OwnedAnimData owned_adt)
void BKE_nla_tweakmode_clear_flags (AnimData *adt)
void BKE_nla_debug_print_flags (AnimData *adt, ID *owner_id)
static void blend_write_nla_strips (BlendWriter *writer, ListBase *strips)
static void blend_data_read_nla_strips (BlendDataReader *reader, ListBase *strips)
void BKE_nla_blend_write (BlendWriter *writer, ListBase *tracks)
void BKE_nla_blend_read_data (BlendDataReader *reader, ID *id_owner, ListBase *tracks)
void BKE_nla_liboverride_post_process (ID *id, AnimData *adt)
static bool visit_strip (NlaStrip *strip, blender::FunctionRef< bool(NlaStrip *)> callback)
bool blender::bke::nla::foreach_strip (ID *id, blender::FunctionRef< bool(NlaStrip *)> callback)
bool blender::bke::nla::foreach_strip_adt (const AnimData &adt, blender::FunctionRef< bool(NlaStrip *)> callback)

Variables

static CLG_LogRef LOG = {"anim.nla"}

Macro Definition Documentation

◆ STASH_TRACK_NAME

#define STASH_TRACK_NAME   DATA_("[Action Stash]")

Function Documentation

◆ BKE_nla_action_pushdown()

void BKE_nla_action_pushdown ( OwnedAnimData owned_adt,
bool is_liboverride )

For the given AnimData block, add the active action to the NLA stack (i.e. 'push-down' action). The UI should only allow this for normal editing only (i.e. not in edit-mode for some strip's action), so no checks for this are performed.

TODO: maybe we should have checks for this too.

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

References AnimData::act_blendmode, AnimData::act_extendmode, AnimData::act_influence, AnimData::action, OwnedAnimData::adt, BKE_nlastack_add_strip(), BKE_nlastrip_set_active(), BKE_nlastrip_validate_fcurves(), NlaStrip::blendmode, BLI_assert_msg, ELEM, NlaStrip::extendmode, NlaStrip::flag, NlaStrip::influence, NLASTRIP_FLAG_USR_INFLUENCE, OwnedAnimData::owner_id, blender::animrig::unassign_action(), and UNUSED_VARS_NDEBUG.

Referenced by action_pushdown_exec(), and nlatracks_pushdown_exec().

◆ BKE_nla_action_slot_is_stashed()

bool BKE_nla_action_slot_is_stashed ( AnimData * adt,
bAction * act,
blender::animrig::slot_handle_t slot_handle )

Check if an action+slot combination is "stashed" in the NLA already.

The criteria for this are: 1) The action+slot in question lives in a "stash" track. 2) We only check first-level strips. That is, we will not check inside meta strips.

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

References LISTBASE_FOREACH, AnimData::nla_tracks, STASH_TRACK_NAME, and NlaStrip::strips.

Referenced by BKE_nla_action_stash().

◆ BKE_nla_action_stash()

◆ BKE_nla_add_soundstrip()

◆ BKE_nla_blend_read_data()

void BKE_nla_blend_read_data ( BlendDataReader * reader,
ID * id_owner,
ListBase * tracks )

◆ BKE_nla_blend_write()

void BKE_nla_blend_write ( BlendWriter * writer,
ListBase * tracks )

◆ BKE_nla_clip_length_ensure_nonzero()

void BKE_nla_clip_length_ensure_nonzero ( const float * actstart,
float * r_actend )

Ensure the passed range has non-zero length, using the same logic as BKE_nla_clip_length_get_nonzero to determine the new non-zero length.

See the documentation for BKE_nla_clip_length_get_nonzero for the reason this function exists and the issues around its use.

Usage: both actstart and r_actend should already be set to the start/end values of a strip's clip. r_actend will be modified if necessary to ensure the range is non-zero in length.

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

Referenced by animsys_create_action_track_strip(), BKE_nlastrip_recalculate_bounds_sync_action(), draw_nla_main_data(), nlastrip_set_initial_length(), and blender::bke::tests::TEST().

◆ BKE_nla_clip_length_get_nonzero()

float BKE_nla_clip_length_get_nonzero ( const NlaStrip * strip)

Compute the length of the passed strip's clip, unless the clip length is zero in which case a non-zero value is returned.

WARNING: this function is very narrow and special-cased in its application. It was introduced as part of the fix for issue #107030, as a way to collect a bunch of whack-a-mole inline applications of this logic in one place. The logic itself isn't principled in any way, and should almost certainly not be used anywhere that it isn't already, short of one of those whack-a-mole inline places being overlooked.

The underlying purpose of this function is to ensure that the computed clip length for an NLA strip is (in certain places) never zero, in order to avoid the strip's scale having to be infinity. In other words, it's a hack. But at least now it's a hack collected in one place.

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

References NlaStrip::actend, and NlaStrip::actstart.

Referenced by BKE_nlastrip_recalculate_bounds(), nlastrip_get_frame_actionclip(), and blender::bke::tests::TEST().

◆ BKE_nla_debug_print_flags()

◆ BKE_nla_liboverride_post_process()

void BKE_nla_liboverride_post_process ( ID * id,
AnimData * adt )

Ensure NLA Tweak Mode related flags & pointers are consistent.

This may mean that tweak mode is exited, if not all relevant pointers can be set correctly.

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

References AnimData::act_track, AnimData::actstrip, ADT_NLA_EDIT_ON, BKE_nla_tweakmode_exit(), BLI_assert, BLI_listbase_is_empty(), AnimData::flag, AnimData::nla_tracks, nla_tweakmode_find_active(), and UNUSED_VARS_NDEBUG.

Referenced by BKE_animdata_liboverride_post_process().

◆ BKE_nla_strip_foreach_id()

void BKE_nla_strip_foreach_id ( NlaStrip * strip,
LibraryForeachIDData * data )

◆ BKE_nla_tracks_copy()

void BKE_nla_tracks_copy ( Main * bmain,
ListBase * dst,
const ListBase * src,
int flag )

Copy all NLA data.

Parameters
flagControl ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.hh

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

References BKE_nlatrack_copy(), BLI_addtail(), BLI_listbase_clear(), ELEM, flag, and LISTBASE_FOREACH.

Referenced by BKE_animdata_merge_copy(), and BKE_nla_tracks_copy_from_adt().

◆ BKE_nla_tracks_copy_from_adt()

void BKE_nla_tracks_copy_from_adt ( Main * bmain,
AnimData * adt_dest,
const AnimData * adt_source,
int flag )

Copy NLA tracks from #adt_source to #adt_dest, and update the active track/strip pointers to point at those copies.

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

References AnimData::act_track, AnimData::actstrip, BKE_nla_tracks_copy(), flag, AnimData::nla_tracks, and update_active_track().

Referenced by BKE_animdata_copy_in_lib().

◆ BKE_nla_tracks_free()

void BKE_nla_tracks_free ( ListBase * tracks,
bool do_id_user )

Free the elements of type NLA Tracks provided in the given list, but do not free the list itself since that is not free-standing

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

References BKE_nlatrack_remove_and_free(), BLI_listbase_clear(), ELEM, NlaTrack::next, and tracks.

Referenced by BKE_animdata_free().

◆ BKE_nla_tweakedit_remap()

float BKE_nla_tweakedit_remap ( AnimData * adt,
float cframe,
eNlaTime_ConvertModes mode )

Non clipped mapping for strip-time <-> global time.

Public API method - perform this mapping using the given AnimData block and perform any necessary sanity checks on the value.

Note
Do not call this with an adt obtained from an bAnimListElem. Instead, use ANIM_nla_tweakedit_remap() for that. This is because not all data that might be in an bAnimListElem should be nla remapped, and this function cannot account for that, whereas ANIM_nla_tweakedit_remap() takes the bAnimListElem directly and makes sure the right thing is done.

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

References AnimData::act_track, AnimData::actstrip, ADT_NLA_EDIT_NOMAP, ADT_NLA_EDIT_ON, BKE_nlastrip_find_active(), BKE_nlatrack_find_active(), BKE_nlatrack_find_tweaked(), AnimData::flag, NlaStrip::flag, AnimData::nla_tracks, NLASTRIP_FLAG_USR_TIME, and nlastrip_get_frame().

Referenced by achannel_setting_slider_cb(), ANIM_draw_action_framerange(), ANIM_nla_tweakedit_remap(), blender::ed::transform::applyTimeScaleValue(), blender::ed::transform::applyTimeSlideValue(), bezt_nlamapping_apply(), bezt_nlamapping_restore(), calculate_fcurve_bounds_and_unhide(), delete_key_v3d_without_keying_set(), delete_key_vse_without_keying_set(), blender::animrig::delete_keyframe(), draw_fcurve_curve(), blender::ed::transform::flushTransGraphData(), blender::ed::transform::initTimeSlide(), blender::animrig::nla_time_remap(), blender::animrig::object_frame_has_keyframe(), pose_slide_apply(), pose_slide_init(), pose_slide_invoke_common(), blender::ed::transform::transform_snap_anim_flush_data_ex(), and ui_but_anim_flag().

◆ BKE_nla_tweakmode_clear_flags()

void BKE_nla_tweakmode_clear_flags ( AnimData * adt)

Clear all NLA Tweak Mode related flags on the ADT, tracks, and strips.

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

References ADT_NLA_EDIT_ON, AnimData::flag, LISTBASE_FOREACH, AnimData::nla_tracks, NLASTRIP_FLAG_TWEAKUSER, NLATRACK_DISABLED, and NlaStrip::strips.

Referenced by nla_tweakmode_exit_nofollowptr().

◆ BKE_nla_tweakmode_enter()

◆ BKE_nla_tweakmode_exit()

◆ BKE_nla_tweakmode_exit_nofollowptr()

void BKE_nla_tweakmode_exit_nofollowptr ( AnimData * adt)

Partially exit NLA tweak-mode for this AnimData block, without following any pointers to other data-blocks. This means no strip length syncing (as that needs to know info about the strip's Action), no reference counting on the Action, and no user update on the Action Slot.

This function just writes to the AnimData-owned data. It is intended to be used in blend-file reading code, which performs a reference count + rebuilds the slot user map later anyway.

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

References is_nla_in_tweakmode(), and nla_tweakmode_exit_nofollowptr().

Referenced by BKE_animdata_blend_read_data().

◆ BKE_nla_validate_state()

void BKE_nla_validate_state ( AnimData * adt)

◆ BKE_nlameta_add_strip()

bool BKE_nlameta_add_strip ( NlaStrip * mstrip,
NlaStrip * strip )

Add the given NLA-Strip to the given Meta-Strip, assuming that the strip isn't attached to any list of strips

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

References BKE_nlastrips_add_strip(), BKE_nlastrips_has_space(), BLI_addhead(), BLI_addtail(), ELEM, NlaStrip::end, NlaStrip::next, NlaStrip::prev, NlaStrip::start, and NlaStrip::strips.

◆ BKE_nlameta_flush_transforms()

void BKE_nlameta_flush_transforms ( NlaStrip * mstrip)

◆ BKE_nlastack_add_strip()

◆ BKE_nlastrip_compute_frame_from_previous_strip()

float BKE_nlastrip_compute_frame_from_previous_strip ( NlaStrip * strip)

Compute the left-hand-side 'frame limit' of that strip, in its NLA track.

This is either :

  • the end frame of the previous strip, if the strip's track contains another strip on it left
  • the macro MINFRAMEF, if no strips are to the left of this strip in its track
Parameters
stripThe strip to compute the left-hand-side 'frame limit' of.
Returns
The beginning frame of the previous strip, or MINFRAMEF if no strips are next in that track.

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

References NlaStrip::end, MINAFRAMEF, NLASTRIP_MIN_LEN_THRESH, NLASTRIP_TYPE_TRANSITION, NlaStrip::prev, NlaStrip::start, and NlaStrip::type.

◆ BKE_nlastrip_compute_frame_to_next_strip()

float BKE_nlastrip_compute_frame_to_next_strip ( NlaStrip * strip)

Compute the right-hand-side 'frame limit' of that strip, in its NLA track.

This is either :

  • the begin frame of the next strip, if the strip's track contains another strip on it right
  • the macro MAXFRAMEF, if no strips are to the right of this strip in its track
Parameters
stripThe strip to compute the right-hand-side 'frame limit' of.
Returns
The beginning frame of the next strip, or MAXFRAMEF if no strips are next in that track.

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

References NlaStrip::end, MAXFRAMEF, NlaStrip::next, NLASTRIP_MIN_LEN_THRESH, NLASTRIP_TYPE_TRANSITION, NlaStrip::start, and NlaStrip::type.

◆ BKE_nlastrip_controlcurve_remove()

bool BKE_nlastrip_controlcurve_remove ( NlaStrip * strip,
FCurve * fcurve )

Delete the NLA-Strip's control F-Curve.

This also ensures that the strip's flags are correctly updated.

Returns
Whether the F-Curve was actually removed.

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

References BKE_fcurve_free(), BLI_remlink(), NlaStrip::fcurves, NlaStrip::flag, NLASTRIP_FLAG_USR_INFLUENCE, NLASTRIP_FLAG_USR_TIME, FCurve::rna_path, and STREQ.

Referenced by ED_anim_ale_fcurve_delete().

◆ BKE_nlastrip_copy()

NlaStrip * BKE_nlastrip_copy ( Main * bmain,
NlaStrip * strip,
bool use_same_action,
int flag )

Copy NLA strip

Parameters
use_same_actionWhen true, the existing action is used (instead of being duplicated)
flagControl ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.hh

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

References NlaStrip::act, BKE_fcurves_copy(), BKE_id_copy_ex(), BKE_nlastrip_copy(), BLI_addtail(), BLI_listbase_clear(), copy_fmodifiers(), NlaStrip::fcurves, flag, bAction::id, id_us_plus(), LIB_ID_CREATE_NO_USER_REFCOUNT, LISTBASE_FOREACH, MEM_dupallocN(), NlaStrip::modifiers, NlaStrip::next, NlaStrip::prev, and NlaStrip::strips.

Referenced by BKE_nlastrip_copy(), BKE_nlatrack_copy(), nlaedit_duplicate_exec(), and nlaedit_split_strip_actclip().

◆ BKE_nlastrip_distance_to_frame()

float BKE_nlastrip_distance_to_frame ( const NlaStrip * strip,
float timeline_frame )

Return the distance from the given frame to the NLA strip, measured in frames. If the given frame intersects the NLA strip, the distance is zero.

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

References NlaStrip::end, and NlaStrip::start.

Referenced by nlaedit_strip_at_region_position().

◆ BKE_nlastrip_find_active()

NlaStrip * BKE_nlastrip_find_active ( NlaTrack * nlt)

Find the active NLA-strip within the given track.

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

References nlastrip_find_active(), and NlaTrack::strips.

Referenced by BKE_nla_tweakedit_remap(), nla_panel_context(), and nla_tweakmode_find_active().

◆ BKE_nlastrip_find_by_name()

NlaStrip * BKE_nlastrip_find_by_name ( NlaTrack * nlt,
const char * name )

Find the NLA-strip with the given name within the given track.

Returns
pointer to the strip, or nullptr when not found.

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

References name, nlastrip_find_by_name(), and NlaTrack::strips.

◆ BKE_nlastrip_free()

void BKE_nlastrip_free ( NlaStrip * strip,
bool do_id_user )

◆ BKE_nlastrip_has_curves_for_property()

bool BKE_nlastrip_has_curves_for_property ( const PointerRNA * ptr,
const PropertyRNA * prop )

Check if the given RNA pointer + property combo should be handled by NLA strip curves or not.

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

References ELEM, ptr, and RNA_struct_type_find_property().

Referenced by BKE_fcurve_find_by_rna_context_ui(), and delete_key_button_exec().

◆ BKE_nlastrip_new()

NlaStrip * BKE_nlastrip_new ( bAction * act,
ID & animated_id )

Create a NLA Strip referencing the given Action.

If this is a layered Action, a suitable slot is automatically chosen. If there is none available, no slot will be assigned.

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

References nlastrip_new(), and nlastrip_set_initial_length().

Referenced by BKE_nlastrip_new_for_slot(), nlaedit_add_actionclip_exec(), blender::animrig::nla::tests::TEST_F(), and blender::animrig::nla::tests::TEST_F().

◆ BKE_nlastrip_new_for_slot()

NlaStrip * BKE_nlastrip_new_for_slot ( bAction * act,
blender::animrig::slot_handle_t slot_handle,
ID & animated_id )

Create a NLA Strip referencing the given Action & Slot.

If the Action is legacy, the slot is ignored.

This can return nullptr only when act == nullptr or when the slot ID type does not match the given animated ID.

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

References blender::animrig::nla::assign_action_slot_handle(), BKE_nlastrip_free(), BKE_nlastrip_new(), BLI_assert_unreachable, blender::animrig::MissingAction, nlastrip_set_initial_length(), blender::animrig::OK, result, blender::animrig::SlotNotFromAction, and blender::animrig::SlotNotSuitable.

Referenced by BKE_nla_action_stash(), and BKE_nlastack_add_strip().

◆ BKE_nlastrip_next_in_track()

NlaStrip * BKE_nlastrip_next_in_track ( NlaStrip * strip,
bool skip_transitions )

Returns the next strip in this strip's NLA track, or a null pointer.

Parameters
stripThe strip to find the next trip from.
check_transitionsWhether or not to skip transitions.
Returns
The next strip in the track, or NULL if none are present.

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

References next, NlaStrip::next, and NLASTRIP_TYPE_TRANSITION.

Referenced by blender::ed::transform::nlastrip_fix_overlapping().

◆ BKE_nlastrip_prev_in_track()

NlaStrip * BKE_nlastrip_prev_in_track ( NlaStrip * strip,
bool skip_transitions )

Returns the previous strip in this strip's NLA track, or a null pointer.

Parameters
stripThe strip to find the previous trip from.
check_transitionsWhether or not to skip transitions.
Returns
The previous strip in the track, or NULL if none are present.

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

References NLASTRIP_TYPE_TRANSITION, and NlaStrip::prev.

Referenced by blender::ed::transform::nlastrip_fix_overlapping().

◆ BKE_nlastrip_recalculate_blend()

void BKE_nlastrip_recalculate_blend ( NlaStrip * strip)

Recalculate the blend-in and blend-out values after a strip transform update.

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

References NlaStrip::blendin, NlaStrip::blendout, CLAMP, CLAMP_MIN, NlaStrip::end, and NlaStrip::start.

Referenced by BKE_nla_validate_state(), and blender::bke::tests::TEST().

◆ BKE_nlastrip_recalculate_bounds()

void BKE_nlastrip_recalculate_bounds ( NlaStrip * strip)

Recalculate the start and end frames for the current strip, after changing the extents of the action or the mapping (repeats or scale factor) info.

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

References BKE_nla_clip_length_get_nonzero(), NlaStrip::end, IS_EQF, nlastrip_fix_resize_overlaps(), NLASTRIP_TYPE_CLIP, NlaStrip::repeat, NlaStrip::scale, NlaStrip::start, and NlaStrip::type.

Referenced by BKE_nlastrip_recalculate_bounds_sync_action().

◆ BKE_nlastrip_recalculate_bounds_sync_action()

void BKE_nlastrip_recalculate_bounds_sync_action ( NlaStrip * strip)

Recalculate the start and end frames for the strip to match the bounds of its action such that the overall NLA animation result is unchanged.

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

References NlaStrip::act, NlaStrip::actend, NlaStrip::action_slot_handle, NlaStrip::actstart, BKE_nla_clip_length_ensure_nonzero(), BKE_nlastrip_recalculate_bounds(), NLASTRIP_TYPE_CLIP, NlaStrip::scale, NlaStrip::start, and NlaStrip::type.

Referenced by animsys_create_tweak_strip(), nla_tweakmode_exit_sync_strip_lengths(), and nlaedit_sync_actlen_exec().

◆ BKE_nlastrip_remove()

void BKE_nlastrip_remove ( ListBase * strips,
NlaStrip * strip )

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

References BLI_assert, and BLI_remlink().

Referenced by BKE_nlastrip_remove_and_free(), and BKE_nlatrack_remove_strip().

◆ BKE_nlastrip_remove_and_free()

void BKE_nlastrip_remove_and_free ( ListBase * strips,
NlaStrip * strip,
const bool do_id_user )

◆ BKE_nlastrip_set_active()

void BKE_nlastrip_set_active ( AnimData * adt,
NlaStrip * strip )

Make the given NLA-Strip the active one within the given block.

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

References LISTBASE_FOREACH, AnimData::nla_tracks, NLASTRIP_FLAG_ACTIVE, and NlaStrip::strips.

Referenced by BKE_nla_action_pushdown().

◆ BKE_nlastrip_validate_autoblends()

◆ BKE_nlastrip_validate_fcurves()

◆ BKE_nlastrip_validate_name()

◆ BKE_nlastrip_within_bounds()

bool BKE_nlastrip_within_bounds ( NlaStrip * strip,
float min,
float max )

Does the given NLA-strip fall within the given bounds (times)?.

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

References NlaStrip::end, fabsf, IN_RANGE, IS_EQF, max, min, and NlaStrip::start.

Referenced by box_select_nla_strips(), get_visible_nla_strips(), nlaedit_select_leftright(), and nlaedit_strip_at_region_position().

◆ BKE_nlastrips_add_strip()

bool BKE_nlastrips_add_strip ( ListBase * strips,
NlaStrip * strip )

NULL checks incoming strip and verifies no overlap / invalid configuration against other strips in NLA Track before calling BKE_nlastrips_add_strip_unsafe.

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

References BKE_nlastrips_add_strip_unsafe(), BKE_nlastrips_has_space(), ELEM, NlaStrip::end, and NlaStrip::start.

Referenced by BKE_nlameta_add_strip(), BKE_nlatrack_add_strip(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ BKE_nlastrips_add_strip_unsafe()

void BKE_nlastrips_add_strip_unsafe ( ListBase * strips,
NlaStrip * strip )

Add the given NLA-Strip to the given list of strips, assuming that it isn't currently a member of another list, NULL, or conflicting with existing strips position.

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

References BLI_addtail(), BLI_assert, BLI_insertlinkbefore(), ELEM, LISTBASE_FOREACH, and NlaStrip::start.

Referenced by BKE_nlastrips_add_strip(), blender::ed::transform::nlastrip_shuffle_transformed(), and blender::ed::transform::recalcData_nla().

◆ BKE_nlastrips_clear_metas()

void BKE_nlastrips_clear_metas ( ListBase * strips,
bool only_sel,
bool only_temp )

Remove meta-strips (i.e. flatten the list of strips) from the top-level of the list of strips.

Parameters
only_selonly consider selected meta-strips, otherwise all meta-strips are removed
only_temponly remove the 'temporary' meta-strips used for transforms

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

References BKE_nlastrips_clear_metastrip(), ELEM, ListBase::first, NlaStrip::flag, NlaStrip::next, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_TEMP_META, NLASTRIP_TYPE_META, and NlaStrip::type.

Referenced by blender::ed::transform::createTransNlaData(), nlaedit_remove_meta_exec(), nlaedit_snap_exec(), nlaedit_swap_exec(), and blender::ed::transform::special_aftertrans_update__nla().

◆ BKE_nlastrips_clear_metastrip()

void BKE_nlastrips_clear_metastrip ( ListBase * strips,
NlaStrip * strip )

Split a meta-strip into a set of normal strips.

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

References BKE_nlastrip_remove_and_free(), BLI_insertlinkbefore(), BLI_remlink(), ELEM, ListBase::first, NlaStrip::next, and NlaStrip::strips.

Referenced by BKE_nlastrips_clear_metas(), and nlaedit_split_strip_meta().

◆ BKE_nlastrips_has_space()

bool BKE_nlastrips_has_space ( ListBase * strips,
float start,
float end )

Check if there is any space in the given list to add the given strip.

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

References IS_EQF, and LISTBASE_FOREACH.

Referenced by BKE_nlameta_add_strip(), BKE_nlastrips_add_strip(), BKE_nlatrack_has_space(), and nlaedit_swap_exec().

◆ BKE_nlastrips_make_metas()

void BKE_nlastrips_make_metas ( ListBase * strips,
bool is_temp )

Convert 'islands' (i.e. continuous string of) selected strips to be contained within 'Meta-Strips' which act as strips which contain strips.

Parameters
is_tempare the meta-strips to be created 'temporary' ones used for transforms?

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

References BLI_addtail(), BLI_insertlinkbefore(), BLI_remlink(), ELEM, NlaStrip::end, ListBase::first, NlaStrip::flag, MEM_callocN(), NlaStrip::next, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_TEMP_META, NLASTRIP_TYPE_META, NlaStrip::repeat, NlaStrip::scale, NlaStrip::start, NlaStrip::strips, and NlaStrip::type.

Referenced by blender::ed::transform::createTransNlaData(), nlaedit_add_meta_exec(), nlaedit_snap_exec(), and nlaedit_swap_exec().

◆ BKE_nlastrips_sort_strips()

void BKE_nlastrips_sort_strips ( ListBase * strips)

Rearrange the strips in the track so that they are always in order (usually only needed after a strip has been moved)

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

References BLI_addhead(), BLI_insertlinkafter(), BLI_remlink(), ELEM, ListBase::first, ListBase::last, LISTBASE_FOREACH_BACKWARD, NlaStrip::next, and NlaStrip::start.

Referenced by BKE_nlatrack_sort_strips().

◆ BKE_nlatrack_add_strip()

◆ BKE_nlatrack_copy()

NlaTrack * BKE_nlatrack_copy ( Main * bmain,
NlaTrack * nlt,
bool use_same_actions,
int flag )

Copy a single NLA Track.

Parameters
flagControl ID pointers management, see LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_lib_id.hh

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

References BKE_nlastrip_copy(), BLI_addtail(), BLI_listbase_clear(), flag, LISTBASE_FOREACH, MEM_dupallocN(), NlaTrack::next, NlaTrack::prev, and NlaTrack::strips.

Referenced by BKE_nla_tracks_copy().

◆ BKE_nlatrack_find_active()

NlaTrack * BKE_nlatrack_find_active ( ListBase * tracks)

Find the active NLA-track for the given stack.

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

References ELEM, LISTBASE_FOREACH, NLATRACK_ACTIVE, and tracks.

Referenced by BKE_nla_tweakedit_remap().

◆ BKE_nlatrack_find_tweaked()

NlaTrack * BKE_nlatrack_find_tweaked ( AnimData * adt)

Get the NLA Track that the active action/action strip comes from, since this info is not stored in AnimData. It also isn't as simple as just using the active track, since multiple tracks may have been entered at the same time.

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

References AnimData::actstrip, BLI_findindex(), G, G_DEBUG, LISTBASE_FOREACH, NlaStrip::name, AnimData::nla_tracks, NLATRACK_ACTIVE, NLATRACK_DISABLED, and printf.

Referenced by BKE_nla_tweakedit_remap(), and nlaedit_enable_tweakmode_exec().

◆ BKE_nlatrack_free()

void BKE_nlatrack_free ( NlaTrack * nlt,
bool do_id_user )

Remove & Frees all NLA strips from the given NLA track, then frees (doesn't remove) the track itself.

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

References BKE_nlastrip_remove_and_free(), ListBase::first, MEM_freeN(), NlaStrip::next, and NlaTrack::strips.

Referenced by BKE_nlatrack_remove_and_free().

◆ BKE_nlatrack_get_bounds()

bool BKE_nlatrack_get_bounds ( NlaTrack * nlt,
float bounds[2] )

Get the extents of the given NLA-Track including gaps between strips, returning whether this succeeded or not

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

References ELEM, NlaStrip::end, ListBase::first, ListBase::last, NlaStrip::start, and NlaTrack::strips.

◆ BKE_nlatrack_has_animated_strips()

bool BKE_nlatrack_has_animated_strips ( NlaTrack * nlt)

Check if the given NLA-Track has any strips with their own F-Curves.

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

References ELEM, ListBase::first, LISTBASE_FOREACH, and NlaTrack::strips.

Referenced by BKE_nlatracks_have_animated_strips().

◆ BKE_nlatrack_has_space()

bool BKE_nlatrack_has_space ( NlaTrack * nlt,
float start,
float end )

Check if there is any space in the given track to add a strip of the given length.

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

References BKE_nlastrips_has_space(), NlaTrack::flag, IS_EQF, NLATRACK_PROTECTED, and NlaTrack::strips.

Referenced by nlaedit_move_down_exec(), and nlaedit_move_up_exec().

◆ BKE_nlatrack_has_strips()

bool BKE_nlatrack_has_strips ( ListBase * tracks)

Check to see if there are any NLA strips in the NLA tracks.

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

References BLI_listbase_count(), BLI_listbase_is_empty(), LISTBASE_FOREACH, and tracks.

Referenced by version_nla_action_strip_hold().

◆ BKE_nlatrack_insert_after()

void BKE_nlatrack_insert_after ( ListBase * nla_tracks,
NlaTrack * prev,
NlaTrack * new_track,
bool is_liboverride )

◆ BKE_nlatrack_insert_before()

void BKE_nlatrack_insert_before ( ListBase * nla_tracks,
NlaTrack * next,
NlaTrack * new_track,
bool is_liboverride )

Inserts a given NLA track before a specified NLA track within the passed NLA track list.

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

References BKE_nlatrack_insert_after(), BLI_findindex(), BLI_insertlinkbefore(), BLI_uniquename(), DATA_, NlaTrack::index, name, NlaTrack::name, next, NLATRACK_OVERRIDELIBRARY_LOCAL, offsetof, and STRNCPY_UTF8.

Referenced by BKE_nlatrack_new_before(), and blender::ed::transform::recalcData_nla().

◆ BKE_nlatrack_is_enabled()

bool BKE_nlatrack_is_enabled ( const AnimData & adt,
const NlaTrack & nlt )

Return whether this NLA track is enabled.

If any track is solo'ed: returns true when this is the solo'ed one. If no track is solo'ed: returns true when this track is not muted.

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

References ADT_NLA_SOLO_TRACK, AnimData::flag, NlaTrack::flag, NLATRACK_MUTED, and NLATRACK_SOLO.

Referenced by adt_apply_all_fcurves_cb(), animsys_evaluate_nla_domain(), blender::deg::DepsgraphNodeBuilder::build_animdata(), blender::deg::DepsgraphRelationBuilder::build_animdata_curves(), and is_nlatrack_evaluatable().

◆ BKE_nlatrack_is_nonlocal_in_liboverride()

bool BKE_nlatrack_is_nonlocal_in_liboverride ( const ID * id,
const NlaTrack * nlt )

◆ BKE_nlatrack_new()

NlaTrack * BKE_nlatrack_new ( )

Create new NLA Track. The returned pointer is owned by the caller.

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

References NlaTrack::flag, MEM_callocN(), NLATRACK_OVERRIDELIBRARY_LOCAL, and NLATRACK_SELECTED.

Referenced by BKE_nlatrack_new_after(), BKE_nlatrack_new_before(), and blender::ed::transform::recalcData_nla().

◆ BKE_nlatrack_new_after()

NlaTrack * BKE_nlatrack_new_after ( ListBase * nla_tracks,
NlaTrack * prev,
bool is_liboverride )

Calls BKE_nlatrack_new to create a new NLA track, inserts it after the given NLA track with BKE_nlatrack_insert_after.

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

References BKE_nlatrack_insert_after(), and BKE_nlatrack_new().

Referenced by BKE_nla_action_stash(), BKE_nlatrack_new_tail(), nlaedit_add_tracks_existing(), nlaedit_duplicate_exec(), and nlaedit_snap_exec().

◆ BKE_nlatrack_new_before()

NlaTrack * BKE_nlatrack_new_before ( ListBase * nla_tracks,
NlaTrack * next,
bool is_liboverride )

Calls BKE_nlatrack_new to create a new NLA track, inserts it before the given NLA track with BKE_nlatrack_insert_before.

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

References BKE_nlatrack_insert_before(), BKE_nlatrack_new(), and next.

Referenced by BKE_nlatrack_new_head().

◆ BKE_nlatrack_new_head()

NlaTrack * BKE_nlatrack_new_head ( ListBase * nla_tracks,
bool is_liboverride )

Calls BKE_nlatrack_new to create a new NLA track, inserts it as the head of the NLA track list with BKE_nlatrack_new_before.

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

References BKE_nlatrack_new_before(), and ListBase::first.

Referenced by blender::animrig::tests::KeyframingTest::SetUp(), and blender::bke::tests::TEST().

◆ BKE_nlatrack_new_tail()

◆ BKE_nlatrack_remove()

void BKE_nlatrack_remove ( ListBase * tracks,
NlaTrack * nlt )

Removes the given NLA track from the list of tracks provided.

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

References BLI_assert, BLI_remlink(), and tracks.

Referenced by BKE_nlatrack_remove_and_free().

◆ BKE_nlatrack_remove_and_free()

void BKE_nlatrack_remove_and_free ( ListBase * tracks,
NlaTrack * nlt,
bool do_id_user )

◆ BKE_nlatrack_remove_strip()

void BKE_nlatrack_remove_strip ( NlaTrack * track,
NlaStrip * strip )

◆ BKE_nlatrack_set_active()

void BKE_nlatrack_set_active ( ListBase * tracks,
NlaTrack * nlt )

Make the given NLA-track the active one for the given stack. If no track is provided, this function can be used to simply deactivate all the NLA tracks in the given stack too.

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

References ELEM, NlaTrack::flag, LISTBASE_FOREACH, NLATRACK_ACTIVE, and tracks.

Referenced by BKE_nla_action_stash(), BKE_nlastack_add_strip(), nlaedit_add_actionclip_exec(), nlaedit_add_sound_exec(), nlaedit_add_tracks_empty(), nlaedit_add_tracks_existing(), nlaedit_duplicate_exec(), nlaedit_snap_exec(), blender::ed::object::object_speaker_add_exec(), and blender::ed::transform::recalcData_nla().

◆ BKE_nlatrack_solo_toggle()

void BKE_nlatrack_solo_toggle ( AnimData * adt,
NlaTrack * nlt )

Toggle the 'solo' setting for the given NLA-track, making sure that it is the only one that has this status in its AnimData block.

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

References ADT_NLA_SOLO_TRACK, ELEM, ListBase::first, AnimData::flag, NlaTrack::flag, LISTBASE_FOREACH, AnimData::nla_tracks, and NLATRACK_SOLO.

Referenced by achannel_nlatrack_solo_widget_cb(), nlaedit_disable_tweakmode(), and nlaedit_enable_tweakmode_exec().

◆ BKE_nlatrack_sort_strips()

void BKE_nlatrack_sort_strips ( NlaTrack * nlt)

Rearrange the strips in the track so that they are always in order (usually only needed after a strip has been moved).

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

References BKE_nlastrips_sort_strips(), ELEM, ListBase::first, and NlaTrack::strips.

Referenced by blender::ed::transform::special_aftertrans_update__nla().

◆ BKE_nlatracks_have_animated_strips()

bool BKE_nlatracks_have_animated_strips ( ListBase * tracks)

Check if given NLA-Tracks have any strips with their own F-Curves.

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

References BKE_nlatrack_has_animated_strips(), ELEM, LISTBASE_FOREACH, and tracks.

◆ blend_data_read_nla_strips()

◆ blend_write_nla_strips()

◆ find_active_strip_from_listbase()

NlaStrip * find_active_strip_from_listbase ( const NlaStrip * active_strip,
const ListBase * strips_source,
const ListBase * strips_dest )
static

Find active_strip in strips_source, then return the strip with the same index from strips_dest.

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

References BLI_assert_msg, BLI_listbase_count(), find_active_strip_from_listbase(), ListBase::first, LISTBASE_FOREACH, NlaStrip::next, NLASTRIP_TYPE_META, NlaStrip::strips, and NlaStrip::type.

Referenced by find_active_strip_from_listbase(), and update_active_strip().

◆ is_nla_in_tweakmode()

bool is_nla_in_tweakmode ( AnimData * adt)
static

◆ nla_tweakmode_exit_nofollowptr()

void nla_tweakmode_exit_nofollowptr ( AnimData * adt)
static

◆ nla_tweakmode_exit_sync_strip_lengths()

◆ nla_tweakmode_find_active()

void nla_tweakmode_find_active ( const ListBase * nla_tracks,
NlaTrack ** r_track_of_active_strip,
NlaStrip ** r_active_strip )
static

Find the active track and strip.

The active strip may or may not be on the active track.

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

References BKE_nlastrip_find_active(), LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_SELECT, NLATRACK_ACTIVE, NLATRACK_SELECTED, and NlaTrack::strips.

Referenced by BKE_nla_liboverride_post_process(), and BKE_nla_tweakmode_enter().

◆ nlastrip_find_active()

NlaStrip * nlastrip_find_active ( ListBase * strips)
static

◆ nlastrip_find_by_name()

NlaStrip * nlastrip_find_by_name ( ListBase * strips,
const char * name )
static

◆ nlastrip_fix_resize_overlaps()

void nlastrip_fix_resize_overlaps ( NlaStrip * strip)
static

◆ nlastrip_get_endpoint_overlaps()

void nlastrip_get_endpoint_overlaps ( NlaStrip * strip,
NlaTrack * track,
float ** start,
float ** end )
static

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

◆ nlastrip_get_frame_actionclip()

◆ nlastrip_get_frame_transition()

float nlastrip_get_frame_transition ( NlaStrip * strip,
float cframe,
short mode )
static

◆ nlastrip_new()

NlaStrip * nlastrip_new ( bAction * act,
ID & animated_id )
static

Create a new strip for the given Action, auto-choosing a suitable Slot.

This does not sync the Action length. This way the caller can determine whether to do that immediately after, or whether an explicit slot should be chosen first.

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

References ACT_FRAME_RANGE, blender::animrig::nla::assign_action(), bAction::flag, NlaStrip::flag, blender::animrig::Action::is_cyclic(), MEM_callocN(), NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_SYNC_LENGTH, NLASTRIP_FLAG_USR_TIME_CYCLIC, NlaStrip::repeat, and NlaStrip::scale.

Referenced by BKE_nlastrip_new().

◆ nlastrip_set_initial_length()

void nlastrip_set_initial_length ( NlaStrip * strip)
static

◆ nlastrip_validate_transition_start_end()

bool nlastrip_validate_transition_start_end ( ListBase * strips,
NlaStrip * strip )
static

Ensure every transition's start/end properly set. Strip will be removed / freed if it doesn't fit (invalid). Return value indicates if passed strip is valid/fixed or invalid/removed.

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

References BKE_nlastrip_remove_and_free(), NlaStrip::end, NlaStrip::next, NLASTRIP_TYPE_TRANSITION, NlaStrip::prev, NlaStrip::start, and NlaStrip::type.

Referenced by BKE_nla_validate_state().

◆ update_active_strip()

void update_active_strip ( AnimData * adt_dest,
NlaTrack * track_dest,
const AnimData * adt_source,
const NlaTrack * track_source )
static

◆ update_active_track()

◆ visit_strip()

bool visit_strip ( NlaStrip * strip,
blender::FunctionRef< bool(NlaStrip *)> callback )
static

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"anim.nla"}
static

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