Blender  V3.3
Macros | Functions | Variables
nla.c File Reference
#include <float.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_sound_types.h"
#include "DNA_speaker_types.h"
#include "BKE_action.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_nla.h"
#include "BKE_sound.h"
#include "BLO_read_write.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "nla_private.h"

Go to the source code of this file.

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 (ListBase *strips, NlaStrip *strip, bool do_id_user)
 
void BKE_nlatrack_free (ListBase *tracks, NlaTrack *nlt, 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_add (AnimData *adt, NlaTrack *prev, const bool is_liboverride)
 
NlaStripBKE_nlastrip_new (bAction *act)
 
NlaStripBKE_nlastack_add_strip (AnimData *adt, bAction *act, const bool is_liboverride)
 
NlaStripBKE_nla_add_soundstrip (Main *bmain, Scene *scene, Speaker *speaker)
 
void BKE_nla_strip_foreach_id (NlaStrip *strip, LibraryForeachIDData *data)
 
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, float cframe, short mode)
 
bool BKE_nlastrips_has_space (ListBase *strips, float start, float end)
 
void BKE_nlastrips_sort_strips (ListBase *strips)
 
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)
 
void BKE_nlatrack_sort_strips (NlaTrack *nlt)
 
bool BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip, const bool is_liboverride)
 
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_find_active (NlaTrack *nlt)
 
void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip)
 
bool BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max)
 
static void nlastrip_fix_resize_overlaps (NlaStrip *strip)
 
void BKE_nlastrip_recalculate_bounds_sync_action (NlaStrip *strip)
 
void BKE_nlastrip_recalculate_bounds (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_has_curves_for_property (const PointerRNA *ptr, const PropertyRNA *prop)
 
static bool nla_editbone_name_check (void *arg, const char *name)
 
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)
 
void BKE_nla_validate_state (AnimData *adt)
 
bool BKE_nla_action_is_stashed (AnimData *adt, bAction *act)
 
bool BKE_nla_action_stash (AnimData *adt, const bool is_liboverride)
 
void BKE_nla_action_pushdown (AnimData *adt, const bool is_liboverride)
 
bool BKE_nla_tweakmode_enter (AnimData *adt)
 
void BKE_nla_tweakmode_exit (AnimData *adt)
 
static void blend_write_nla_strips (BlendWriter *writer, ListBase *strips)
 
static void blend_data_read_nla_strips (BlendDataReader *reader, ListBase *strips)
 
static void blend_lib_read_nla_strips (BlendLibReader *reader, ID *id, ListBase *strips)
 
static void blend_read_expand_nla_strips (BlendExpander *expander, ListBase *strips)
 
void BKE_nla_blend_write (BlendWriter *writer, ListBase *tracks)
 
void BKE_nla_blend_read_data (BlendDataReader *reader, ListBase *tracks)
 
void BKE_nla_blend_read_lib (BlendLibReader *reader, ID *id, ListBase *tracks)
 
void BKE_nla_blend_read_expand (struct BlendExpander *expander, struct ListBase *tracks)
 

Variables

static CLG_LogRef LOG = {"bke.nla"}
 

Macro Definition Documentation

◆ STASH_TRACK_NAME

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

Definition at line 1821 of file nla.c.

Function Documentation

◆ BKE_nla_action_is_stashed()

bool BKE_nla_action_is_stashed ( struct AnimData adt,
struct bAction act 
)

Check if an action is "stashed" in the NLA already

The criteria for this are: 1) The action 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 1823 of file nla.c.

References NlaStrip::act, ListBase::first, NlaTrack::name, NlaStrip::next, NlaTrack::next, AnimData::nla_tracks, STASH_TRACK_NAME, and NlaTrack::strips.

Referenced by BKE_nla_action_stash().

◆ BKE_nla_action_pushdown()

void BKE_nla_action_pushdown ( struct AnimData 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 1909 of file nla.c.

References AnimData::act_blendmode, AnimData::act_extendmode, AnimData::act_influence, AnimData::action, action_has_motion(), BKE_nlastack_add_strip(), BKE_nlastrip_set_active(), BKE_nlastrip_validate_fcurves(), NlaStrip::blendmode, CLOG_ERROR, ELEM, NlaStrip::extendmode, NlaStrip::flag, bAction::id, id_us_min(), NlaStrip::influence, LOG, NLASTRIP_FLAG_USR_INFLUENCE, and NULL.

Referenced by action_pushdown_exec(), and nlachannels_pushdown_exec().

◆ BKE_nla_action_stash()

bool BKE_nla_action_stash ( struct AnimData adt,
bool  is_liboverride 
)

◆ BKE_nla_add_soundstrip()

NlaStrip* BKE_nla_add_soundstrip ( struct Main bmain,
struct Scene scene,
struct Speaker speaker 
)

◆ BKE_nla_blend_read_data()

void BKE_nla_blend_read_data ( BlendDataReader reader,
ListBase tracks 
)

Definition at line 2228 of file nla.c.

References blend_data_read_nla_strips(), BLO_read_list(), LISTBASE_FOREACH, and tracks.

Referenced by BKE_animdata_blend_read_data().

◆ BKE_nla_blend_read_expand()

void BKE_nla_blend_read_expand ( struct BlendExpander expander,
struct ListBase tracks 
)

Definition at line 2252 of file nla.c.

References blend_read_expand_nla_strips(), LISTBASE_FOREACH, and tracks.

Referenced by BKE_animdata_blend_read_expand().

◆ BKE_nla_blend_read_lib()

void BKE_nla_blend_read_lib ( BlendLibReader reader,
ID id,
ListBase tracks 
)

◆ BKE_nla_blend_write()

void BKE_nla_blend_write ( BlendWriter writer,
ListBase tracks 
)

Definition at line 2216 of file nla.c.

References blend_write_nla_strips(), BLO_write_struct, LISTBASE_FOREACH, and tracks.

Referenced by BKE_animdata_blend_write().

◆ BKE_nla_strip_foreach_id()

void BKE_nla_strip_foreach_id ( struct NlaStrip strip,
struct LibraryForeachIDData data 
)

Callback used by lib_query to walk over all ID usages (mimics foreach_id callback of IDTypeInfo structure).

Definition at line 513 of file nla.c.

References NlaStrip::act, BKE_fcurve_foreach_id(), BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_nla_strip_foreach_id(), data, NlaStrip::fcurves, IDWALK_CB_USER, LISTBASE_FOREACH, and NlaStrip::strips.

Referenced by BKE_animdata_foreach_id(), and BKE_nla_strip_foreach_id().

◆ BKE_nla_tracks_copy()

void BKE_nla_tracks_copy ( struct 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.h

Definition at line 226 of file nla.c.

References BKE_nlatrack_copy(), BLI_addtail(), BLI_listbase_clear(), ELEM, NlaTrack::next, NULL, and src.

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,
const int  flag 
)

◆ 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 127 of file nla.c.

References BKE_nlatrack_free(), BLI_listbase_clear(), ELEM, ListBase::first, NlaTrack::next, NULL, and tracks.

Referenced by BKE_animdata_free().

◆ BKE_nla_tweakedit_remap()

float BKE_nla_tweakedit_remap ( struct AnimData adt,
float  cframe,
short  mode 
)

◆ BKE_nla_tweakmode_enter()

bool BKE_nla_tweakmode_enter ( struct AnimData adt)

◆ BKE_nla_tweakmode_exit()

void BKE_nla_tweakmode_exit ( struct AnimData adt)

◆ BKE_nla_validate_state()

void BKE_nla_validate_state ( struct AnimData adt)

Ensure that auto-blending and other settings are set correctly.

Definition at line 1798 of file nla.c.

References BKE_nlastrip_validate_autoblends(), ELEM, ListBase::first, NlaStrip::next, NlaTrack::next, AnimData::nla_tracks, NULL, and NlaTrack::strips.

Referenced by ED_nla_postop_refresh().

◆ BKE_nlameta_add_strip()

bool BKE_nlameta_add_strip ( struct NlaStrip mstrip,
struct 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 902 of file nla.c.

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

◆ BKE_nlameta_flush_transforms()

void BKE_nlameta_flush_transforms ( struct NlaStrip mstrip)

Adjust the settings of NLA-Strips contained within a Meta-Strip (recursively), until the Meta-Strips children all fit within the Meta-Strip's new dimensions

Definition at line 950 of file nla.c.

References BKE_nlameta_flush_transforms(), ELEM, NlaStrip::end, ListBase::first, IS_EQF, ListBase::last, NlaStrip::next, NLASTRIP_TYPE_META, NULL, offset, ptr, RNA_float_set(), RNA_pointer_create(), NlaStrip::start, NlaStrip::strips, and NlaStrip::type.

Referenced by BKE_nlameta_flush_transforms(), nlaedit_snap_exec(), nlaedit_swap_exec(), and recalcData_nla().

◆ BKE_nlastack_add_strip()

NlaStrip* BKE_nlastack_add_strip ( struct AnimData adt,
struct bAction act,
bool  is_liboverride 
)

Add new NLA-strip to the top of the NLA stack - i.e. into the last track if space, or a new one otherwise.

Definition at line 445 of file nla.c.

References BKE_nlastrip_new(), BKE_nlastrip_validate_name(), BKE_nlatrack_add(), BKE_nlatrack_add_strip(), ELEM, ListBase::last, AnimData::nla_tracks, and NULL.

Referenced by animrecord_check_state(), and BKE_nla_action_pushdown().

◆ BKE_nlastrip_compute_frame_from_previous_strip()

float BKE_nlastrip_compute_frame_from_previous_strip ( struct 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 1242 of file nla.c.

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 ( struct 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 1259 of file nla.c.

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

◆ BKE_nlastrip_copy()

NlaStrip* BKE_nlastrip_copy ( struct Main bmain,
struct 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.h

Definition at line 148 of file nla.c.

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

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

◆ BKE_nlastrip_find_active()

NlaStrip* BKE_nlastrip_find_active ( struct NlaTrack nlt)

Find the active NLA-strip within the given track.

Definition at line 1276 of file nla.c.

References nlastrip_find_active(), NULL, and NlaTrack::strips.

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

◆ BKE_nlastrip_free()

void BKE_nlastrip_free ( ListBase strips,
struct 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 
)

Definition at line 1586 of file nla.c.

References ELEM, NULL, ptr, RNA_struct_type_find_property(), and PointerRNA::type.

◆ BKE_nlastrip_new()

NlaStrip* BKE_nlastrip_new ( struct bAction act)

◆ BKE_nlastrip_recalculate_bounds()

void BKE_nlastrip_recalculate_bounds ( struct 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 1452 of file nla.c.

References NlaStrip::actend, NlaStrip::actstart, NlaStrip::end, IS_EQF, nlastrip_fix_resize_overlaps(), NLASTRIP_TYPE_CLIP, NULL, 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 ( struct 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 1435 of file nla.c.

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

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

◆ BKE_nlastrip_set_active()

void BKE_nlastrip_set_active ( struct AnimData adt,
struct NlaStrip strip 
)

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

Definition at line 1285 of file nla.c.

References ListBase::first, NlaStrip::flag, NlaStrip::next, NlaTrack::next, AnimData::nla_tracks, NLASTRIP_FLAG_ACTIVE, NULL, and NlaTrack::strips.

Referenced by BKE_nla_action_pushdown().

◆ BKE_nlastrip_validate_autoblends()

static void BKE_nlastrip_validate_autoblends ( NlaTrack nlt,
NlaStrip nls 
)
static

◆ BKE_nlastrip_validate_fcurves()

void BKE_nlastrip_validate_fcurves ( struct NlaStrip strip)

◆ BKE_nlastrip_validate_name()

void BKE_nlastrip_validate_name ( struct AnimData adt,
struct NlaStrip strip 
)

◆ BKE_nlastrip_within_bounds()

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

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

Definition at line 1308 of file nla.c.

References NlaStrip::end, fabsf, IN_RANGE, IS_EQF, max, min, NULL, 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,
struct NlaStrip strip 
)

Add the given NLA-Strip to the given list of strips, assuming that it isn't currently a member of another list

Definition at line 767 of file nla.c.

References BKE_nlastrips_has_space(), BLI_addtail(), BLI_insertlinkbefore(), ELEM, NlaStrip::end, ListBase::first, NlaStrip::next, NULL, and NlaStrip::start.

Referenced by BKE_nlameta_add_strip(), and BKE_nlatrack_add_strip().

◆ 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 877 of file nla.c.

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

Referenced by createTransNlaData(), nlaedit_remove_meta_exec(), nlaedit_snap_exec(), nlaedit_swap_exec(), and special_aftertrans_update__nla().

◆ BKE_nlastrips_clear_metastrip()

void BKE_nlastrips_clear_metastrip ( ListBase strips,
struct NlaStrip strip 
)

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

Definition at line 855 of file nla.c.

References BKE_nlastrip_free(), BLI_insertlinkbefore(), BLI_remlink(), ELEM, ListBase::first, NlaStrip::next, NULL, 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 690 of file nla.c.

References NlaStrip::end, ListBase::first, IS_EQF, NlaStrip::next, NULL, NlaStrip::start, and SWAP.

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 802 of file nla.c.

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, NULL, NlaStrip::repeat, NlaStrip::scale, NlaStrip::start, NlaStrip::strips, and NlaStrip::type.

Referenced by 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 724 of file nla.c.

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

Referenced by BKE_nlatrack_sort_strips().

◆ BKE_nlatrack_add()

NlaTrack* BKE_nlatrack_add ( struct AnimData adt,
struct NlaTrack prev,
bool  is_liboverride 
)

◆ BKE_nlatrack_add_strip()

bool BKE_nlatrack_add_strip ( struct NlaTrack nlt,
struct NlaStrip strip,
bool  is_liboverride 
)

◆ BKE_nlatrack_copy()

NlaTrack* BKE_nlatrack_copy ( struct Main bmain,
struct 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.h

Definition at line 197 of file nla.c.

References BKE_nlastrip_copy(), BLI_addtail(), BLI_listbase_clear(), ListBase::first, MEM_dupallocN, NlaStrip::next, NlaTrack::next, NULL, 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 1032 of file nla.c.

References ELEM, ListBase::first, NlaTrack::flag, NlaTrack::next, NLATRACK_ACTIVE, NULL, and tracks.

Referenced by BKE_nla_tweakedit_remap().

◆ BKE_nlatrack_find_tweaked()

NlaTrack* BKE_nlatrack_find_tweaked ( struct 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 1052 of file nla.c.

References AnimData::actstrip, BLI_findindex(), ListBase::first, NlaTrack::flag, G, G_DEBUG, NlaStrip::name, NlaTrack::name, NlaTrack::next, AnimData::nla_tracks, NLATRACK_ACTIVE, NLATRACK_DISABLED, NULL, and NlaTrack::strips.

Referenced by action_layer_next_exec(), action_layer_prev_exec(), BKE_nla_tweakedit_remap(), and nlaedit_enable_tweakmode_exec().

◆ BKE_nlatrack_free()

void BKE_nlatrack_free ( ListBase tracks,
struct NlaTrack nlt,
bool  do_id_user 
)

Remove the given NLA track from the set of NLA tracks, free the track's data, and the track itself.

Definition at line 103 of file nla.c.

References BKE_nlastrip_free(), BLI_freelinkN(), ListBase::first, MEM_freeN, NlaStrip::next, NULL, NlaTrack::strips, and tracks.

Referenced by BKE_nla_tracks_free(), ED_animedit_unlink_action(), and nlaedit_delete_tracks_exec().

◆ BKE_nlatrack_get_bounds()

bool BKE_nlatrack_get_bounds ( struct 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 1185 of file nla.c.

References bounds(), ELEM, NlaStrip::end, ListBase::first, ListBase::last, NULL, NlaStrip::start, and NlaTrack::strips.

◆ BKE_nlatrack_has_animated_strips()

bool BKE_nlatrack_has_animated_strips ( struct NlaTrack nlt)

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

Definition at line 1483 of file nla.c.

References ELEM, NlaStrip::fcurves, ListBase::first, NlaStrip::next, NULL, and NlaTrack::strips.

Referenced by BKE_nlatracks_have_animated_strips().

◆ BKE_nlatrack_has_space()

bool BKE_nlatrack_has_space ( struct 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 1137 of file nla.c.

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

Referenced by nlaedit_move_down_exec(), nlaedit_move_up_exec(), and recalcData_nla().

◆ BKE_nlatrack_is_nonlocal_in_liboverride()

bool BKE_nlatrack_is_nonlocal_in_liboverride ( const ID id,
const NlaTrack nlt 
)

Definition at line 1214 of file nla.c.

References NlaTrack::flag, ID_IS_OVERRIDE_LIBRARY, NLATRACK_OVERRIDELIBRARY_LOCAL, and NULL.

◆ BKE_nlatrack_set_active()

void BKE_nlatrack_set_active ( ListBase tracks,
struct 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 1117 of file nla.c.

References ELEM, ListBase::first, NlaTrack::flag, NlaTrack::next, NLATRACK_ACTIVE, NULL, and tracks.

Referenced by BKE_nlatrack_add().

◆ BKE_nlatrack_solo_toggle()

void BKE_nlatrack_solo_toggle ( struct AnimData adt,
struct 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 1083 of file nla.c.

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

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

◆ BKE_nlatrack_sort_strips()

void BKE_nlatrack_sort_strips ( struct 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 1157 of file nla.c.

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

Referenced by 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 own F-Curves.

Definition at line 1503 of file nla.c.

References BKE_nlatrack_has_animated_strips(), ELEM, ListBase::first, NlaTrack::next, NULL, and tracks.

◆ blend_data_read_nla_strips()

static void blend_data_read_nla_strips ( BlendDataReader reader,
ListBase strips 
)
static

◆ blend_lib_read_nla_strips()

static void blend_lib_read_nla_strips ( BlendLibReader reader,
ID id,
ListBase strips 
)
static

Definition at line 2185 of file nla.c.

References BKE_fcurve_blend_read_lib(), BLO_read_id_address, id, ID::lib, and LISTBASE_FOREACH.

Referenced by BKE_nla_blend_read_lib().

◆ blend_read_expand_nla_strips()

static void blend_read_expand_nla_strips ( BlendExpander expander,
ListBase strips 
)
static

◆ blend_write_nla_strips()

static void blend_write_nla_strips ( BlendWriter writer,
ListBase strips 
)
static

◆ find_active_strip_from_listbase()

static 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 251 of file nla.c.

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

Referenced by update_active_strip().

◆ nla_editbone_name_check()

static bool nla_editbone_name_check ( void arg,
const char *  name 
)
static

Definition at line 1620 of file nla.c.

References BLI_ghash_haskey().

Referenced by BKE_nlastrip_validate_name().

◆ nla_tweakmode_find_active()

static 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 1964 of file nla.c.

References BKE_nlastrip_find_active(), ListBase::first, NlaStrip::flag, NlaTrack::flag, ListBase::last, NlaStrip::next, NlaTrack::next, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_SELECT, NLATRACK_ACTIVE, NLATRACK_SELECTED, NULL, NlaTrack::prev, and NlaTrack::strips.

Referenced by BKE_nla_tweakmode_enter().

◆ nlastrip_find_active()

static NlaStrip* nlastrip_find_active ( ListBase strips)
static

Definition at line 1222 of file nla.c.

References LISTBASE_FOREACH, NLASTRIP_FLAG_ACTIVE, NLASTRIP_TYPE_META, and NULL.

Referenced by BKE_nlastrip_find_active().

◆ nlastrip_fix_resize_overlaps()

static void nlastrip_fix_resize_overlaps ( NlaStrip strip)
static

◆ nlastrip_get_endpoint_overlaps()

static 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 628 of file nla.c.

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

static float nlastrip_get_frame_actionclip ( NlaStrip strip,
float  cframe,
short  mode 
)
static

◆ nlastrip_get_frame_transition()

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

◆ update_active_strip()

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

◆ update_active_track()

static void update_active_track ( AnimData adt_dest,
const AnimData adt_source 
)
static

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"bke.nla"}
static

Definition at line 48 of file nla.c.

Referenced by BKE_nla_action_pushdown(), and BKE_nla_action_stash().