Blender
V3.3
|
#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]") |
Variables | |
static CLG_LogRef | LOG = {"bke.nla"} |
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().
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().
"Stash" an action (i.e. store it as a track/layer in the NLA, but non-contributing) to retain it in the file for future uses.
Definition at line 1841 of file nla.c.
References AnimData::action, BKE_nla_action_is_stashed(), BKE_nlastrip_new(), BKE_nlastrip_validate_name(), BKE_nlatrack_add(), BKE_nlatrack_add_strip(), BLI_addhead(), BLI_assert, BLI_remlink(), BLI_strncpy(), BLI_uniquename(), CLOG_ERROR, ELEM, NlaStrip::flag, NlaTrack::flag, ListBase::last, LOG, NlaTrack::name, AnimData::nla_tracks, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_SYNC_LENGTH, NLATRACK_MUTED, NLATRACK_PROTECTED, NULL, NlaTrack::prev, and STASH_TRACK_NAME.
Referenced by action_new_exec(), action_stash_create_exec(), and action_stash_exec().
NlaStrip* BKE_nla_add_soundstrip | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
struct Speaker * | speaker | ||
) |
Add a NLA Strip referencing the given speaker's sound.
Definition at line 477 of file nla.c.
References BKE_sound_info_get(), ceil(), NlaStrip::end, NlaStrip::extendmode, NlaStrip::flag, float(), FPS, SoundInfo::length, MEM_callocN, NLASTRIP_EXTEND_NOTHING, NLASTRIP_FLAG_SELECT, NLASTRIP_TYPE_SOUND, NlaStrip::repeat, NlaStrip::scale, scene, Speaker::sound, NlaStrip::type, and UNUSED_VARS.
Referenced by nlaedit_add_sound_exec(), and object_speaker_add_exec().
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().
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().
void BKE_nla_blend_read_lib | ( | BlendLibReader * | reader, |
ID * | id, | ||
ListBase * | tracks | ||
) |
Definition at line 2239 of file nla.c.
References blend_lib_read_nla_strips(), ID_IS_LINKED, LISTBASE_FOREACH, NLATRACK_OVERRIDELIBRARY_LOCAL, and tracks.
Referenced by BKE_animdata_blend_read_lib().
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().
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().
Copy all NLA data.
flag | Control 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().
void BKE_nla_tracks_copy_from_adt | ( | Main * | bmain, |
AnimData * | adt_dest, | ||
const AnimData * | adt_source, | ||
const int | flag | ||
) |
Definition at line 339 of file nla.c.
References AnimData::act_track, AnimData::actstrip, BKE_nla_tracks_copy(), AnimData::nla_tracks, NULL, and update_active_track().
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().
Non clipped mapping for strip-time <-> global time: mode = eNlaTime_ConvertModes -> NLATIME_CONVERT_*
Public API method - perform this mapping using the given AnimData block and perform any necessary sanity checks on the value
Definition at line 642 of file nla.c.
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(), NlaStrip::flag, AnimData::flag, AnimData::nla_tracks, NLASTRIP_FLAG_USR_TIME, nlastrip_get_frame(), and NULL.
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_shapekey_cb(), actkeys_find_key_in_list_element(), actkeys_mselect_column(), ANIM_draw_action_framerange(), applyTimeScaleValue(), applyTimeSlideValue(), bezt_nlamapping_apply(), bezt_nlamapping_restore(), bezt_to_transdata(), box_select_action(), columnselect_action_keys(), columnselect_graph_keys(), createTransActionData(), delete_key_v3d_without_keying_set(), delete_keyframe(), draw_fcurve_curve(), draw_fcurve_modifier_controls_envelope(), flushTransGraphData(), get_keyframe_extents(), graphkeys_click_insert_exec(), graphkeys_mselect_column(), initTimeSlide(), insert_fcurve_key(), insert_graph_keys(), nla_time_remap(), object_frame_has_keyframe(), pose_slide_apply(), pose_slide_init(), pose_slide_invoke_common(), rectf_curve_intersection(), region_select_action_keys(), summary_keyframes_loop(), transform_snap_anim_flush_data(), and ui_but_anim_flag().
Find the active strip + track combination, and set them up as the tweaking track, and return if successful or not.
Definition at line 2019 of file nla.c.
References NlaStrip::act, AnimData::act_track, AnimData::action, AnimData::actstrip, ADT_NLA_EDIT_ON, ADT_NLA_EVAL_UPPER_TRACKS, ELEM, ListBase::first, NlaStrip::flag, NlaTrack::flag, AnimData::flag, G, G_DEBUG, bAction::id, id_us_plus(), NlaStrip::next, NlaTrack::next, AnimData::nla_tracks, nla_tweakmode_find_active(), NLASTRIP_FLAG_TWEAKUSER, NLATRACK_DISABLED, NULL, NlaTrack::strips, and AnimData::tmpact.
Referenced by action_layer_switch_strip(), and nlaedit_enable_tweakmode_exec().
Exit tweak-mode for this AnimData block.
Definition at line 2092 of file nla.c.
References NlaStrip::act, AnimData::act_track, AnimData::action, AnimData::actstrip, ADT_NLA_EDIT_ON, BKE_nlastrip_recalculate_bounds_sync_action(), ELEM, ListBase::first, NlaStrip::flag, NlaTrack::flag, AnimData::flag, bAction::id, id_us_min(), NlaStrip::next, NlaTrack::next, AnimData::nla_tracks, NLASTRIP_FLAG_SYNC_LENGTH, NLASTRIP_FLAG_TWEAKUSER, NLASTRIP_TYPE_CLIP, NLATRACK_DISABLED, NULL, NlaTrack::strips, AnimData::tmpact, and NlaStrip::type.
Referenced by action_layer_next_exec(), action_layer_switch_strip(), ED_animedit_unlink_action(), nlaedit_delete_exec(), and nlaedit_disable_tweakmode().
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().
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.
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().
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().
Compute the left-hand-side 'frame limit' of that strip, in its NLA track.
This is either :
strip | The strip to compute the left-hand-side 'frame limit' of. |
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.
Compute the right-hand-side 'frame limit' of that strip, in its NLA track.
This is either :
strip | The strip to compute the right-hand-side 'frame limit' of. |
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.
NlaStrip* BKE_nlastrip_copy | ( | struct Main * | bmain, |
struct NlaStrip * | strip, | ||
bool | use_same_action, | ||
int | flag | ||
) |
Copy NLA strip
use_same_action | When true, the existing action is used (instead of being duplicated) |
flag | Control 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().
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().
Remove the given NLA strip from the NLA track it occupies, free the strip's data, and the strip itself.
Definition at line 64 of file nla.c.
References NlaStrip::act, BKE_fcurves_free(), BKE_nlastrip_free(), BLI_freelinkN(), NlaStrip::fcurves, ListBase::first, free_fmodifiers(), bAction::id, id_us_min(), MEM_freeN, NlaStrip::modifiers, NlaStrip::next, NULL, and NlaStrip::strips.
Referenced by BKE_nlastrip_free(), BKE_nlastrips_clear_metastrip(), BKE_nlatrack_free(), ED_animedit_unlink_action(), and nlaedit_delete_exec().
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.
Create a NLA Strip referencing the given Action.
Definition at line 396 of file nla.c.
References NlaStrip::act, ACT_FRAME_RANGE, NlaStrip::actend, NlaStrip::actstart, BKE_action_get_frame_range(), BKE_action_is_cyclic(), NlaStrip::end, bAction::flag, NlaStrip::flag, bAction::id, id_us_plus(), IS_EQF, MEM_callocN, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_SYNC_LENGTH, NLASTRIP_FLAG_USR_TIME_CYCLIC, NULL, NlaStrip::repeat, NlaStrip::scale, and NlaStrip::start.
Referenced by BKE_nla_action_stash(), BKE_nlastack_add_strip(), and nlaedit_add_actionclip_exec().
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().
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().
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().
Definition at line 1742 of file nla.c.
References NlaStrip::blendin, NlaStrip::blendout, ELEM, NlaStrip::end, NlaStrip::flag, IS_EQF, NlaStrip::next, NlaTrack::next, NLASTRIP_FLAG_AUTO_BLENDS, nlastrip_get_endpoint_overlaps(), NULL, NlaStrip::prev, NlaTrack::prev, and NlaStrip::start.
Referenced by BKE_nla_validate_state().
Validate the NLA-Strips 'control' F-Curves based on the flags set.
Definition at line 1523 of file nla.c.
References FCurve::auto_smoothing, FCurve::bezt, BKE_fcurve_create(), BKE_fcurve_find(), BLI_addtail(), BLI_strdupn(), FCURVE_SELECTED, FCURVE_VISIBLE, NlaStrip::fcurves, FCurve::flag, NlaStrip::flag, BezTriple::h1, BezTriple::h2, NlaStrip::influence, BezTriple::ipo, MEM_callocN, NLASTRIP_FLAG_USR_INFLUENCE, NLASTRIP_FLAG_USR_TIME, NULL, FCurve::rna_path, NlaStrip::start, FCurve::totvert, and BezTriple::vec.
Referenced by animrecord_check_state(), and BKE_nla_action_pushdown().
Find (and set) a unique name for a strip from the whole AnimData block Uses a similar method to the BLI method, but is implemented differently as we need to ensure that the name is unique over several lists of tracks, not just a single track.
Definition at line 1625 of file nla.c.
References NlaStrip::act, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_str_new(), BLI_strncpy(), BLI_uniquename_cb(), DATA_, ELEM, ListBase::first, bAction::id, NlaStrip::name, ID::name, NlaStrip::next, NlaTrack::next, nla_editbone_name_check(), AnimData::nla_tracks, NLASTRIP_TYPE_CLIP, NLASTRIP_TYPE_META, NLASTRIP_TYPE_TRANSITION, NULL, NlaTrack::strips, and NlaStrip::type.
Referenced by BKE_nla_action_stash(), BKE_nlastack_add_strip(), nlaedit_add_actionclip_exec(), nlaedit_add_meta_exec(), nlaedit_add_sound_exec(), nlaedit_add_transition_exec(), nlaedit_duplicate_exec(), nlaedit_split_strip_actclip(), nlastrips_to_animdata(), and object_speaker_add_exec().
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().
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().
Remove meta-strips (i.e. flatten the list of strips) from the top-level of the list of strips.
only_sel | only consider selected meta-strips, otherwise all meta-strips are removed |
only_temp | only 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().
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().
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().
Convert 'islands' (i.e. continuous string of) selected strips to be contained within 'Meta-Strips' which act as strips which contain strips.
is_temp | are 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().
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().
Add a NLA Track to the given AnimData.
prev | NLA-Track to add the new one after. |
Definition at line 353 of file nla.c.
References BKE_nlatrack_set_active(), BLI_addtail(), BLI_insertlinkafter(), BLI_listbase_count(), BLI_uniquename(), DATA_, NlaTrack::flag, NlaTrack::index, MEM_callocN, NlaTrack::name, blender::meshintersect::SymEdge< Arith_t >::next, NlaTrack::next, AnimData::nla_tracks, NLATRACK_OVERRIDELIBRARY_LOCAL, NLATRACK_SELECTED, NULL, blender::meshintersect::prev(), and NlaTrack::prev.
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(), nlastrips_to_animdata(), and object_speaker_add_exec().
Add the given NLA-Strip to the given NLA-Track, assuming that it isn't currently attached to another one.
Definition at line 1168 of file nla.c.
References BKE_nlastrips_add_strip(), ELEM, NlaTrack::flag, NLATRACK_OVERRIDELIBRARY_LOCAL, NLATRACK_PROTECTED, NULL, and NlaTrack::strips.
Referenced by BKE_nla_action_stash(), BKE_nlastack_add_strip(), nlaedit_add_actionclip_exec(), nlaedit_add_sound_exec(), nlaedit_duplicate_exec(), nlaedit_move_down_exec(), nlaedit_move_up_exec(), nlaedit_snap_exec(), nlaedit_swap_exec(), nlastrips_to_animdata(), object_speaker_add_exec(), and recalcData_nla().
NlaTrack* BKE_nlatrack_copy | ( | struct Main * | bmain, |
struct NlaTrack * | nlt, | ||
bool | use_same_actions, | ||
int | flag | ||
) |
Copy a single NLA Track.
flag | Control 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().
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().
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().
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().
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.
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().
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().
Definition at line 1214 of file nla.c.
References NlaTrack::flag, ID_IS_OVERRIDE_LIBRARY, NLATRACK_OVERRIDELIBRARY_LOCAL, and NULL.
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().
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().
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().
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.
|
static |
Definition at line 2168 of file nla.c.
References BKE_fcurve_blend_read_data(), BKE_fmodifiers_blend_read_data(), BLO_read_list(), LISTBASE_FOREACH, and NULL.
Referenced by BKE_nla_blend_read_data().
|
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().
|
static |
Definition at line 2199 of file nla.c.
References BKE_fcurve_blend_read_expand(), BKE_fmodifiers_blend_read_expand(), BLO_expand, and LISTBASE_FOREACH.
Referenced by BKE_nla_blend_read_expand().
|
static |
Definition at line 2155 of file nla.c.
References BKE_fcurve_blend_write(), BKE_fmodifiers_blend_write(), BLO_write_struct_list, and LISTBASE_FOREACH.
Referenced by BKE_nla_blend_write().
|
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().
Definition at line 1620 of file nla.c.
References BLI_ghash_haskey().
Referenced by BKE_nlastrip_validate_name().
|
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().
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().
Definition at line 1337 of file nla.c.
References ceilf, NlaStrip::end, NlaStrip::next, NLASTRIP_TYPE_TRANSITION, offset, NlaStrip::prev, NlaStrip::start, and NlaStrip::type.
Referenced by BKE_nlastrip_recalculate_bounds().
|
static |
Definition at line 1697 of file nla.c.
References NlaStrip::end, ListBase::first, IS_EQF, NlaStrip::next, NULL, NlaStrip::prev, NlaStrip::start, and NlaTrack::strips.
Referenced by BKE_nlastrip_validate_autoblends().
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().
Definition at line 534 of file nla.c.
References NlaStrip::actend, NlaStrip::actstart, NlaStrip::end, fabsf, NlaStrip::flag, floorf, fmodf, IS_EQF, NLASTRIP_FLAG_REVERSE, NLATIME_CONVERT_MAP, NLATIME_CONVERT_UNMAP, NlaStrip::repeat, NlaStrip::scale, and NlaStrip::start.
Referenced by nlastrip_get_frame().
Definition at line 605 of file nla.c.
References NlaStrip::end, NlaStrip::flag, blender::math::length(), NLASTRIP_FLAG_REVERSE, NLATIME_CONVERT_MAP, and NlaStrip::start.
Referenced by nlastrip_get_frame().
|
static |
Definition at line 291 of file nla.c.
References AnimData::actstrip, BLI_assert, BLI_listbase_count(), find_active_strip_from_listbase(), and NlaTrack::strips.
Referenced by update_active_track().
Definition at line 304 of file nla.c.
References AnimData::act_track, AnimData::actstrip, BLI_assert, BLI_assert_msg, BLI_listbase_count(), ListBase::first, LISTBASE_FOREACH, NlaTrack::next, AnimData::nla_tracks, NULL, and update_active_strip().
Referenced by BKE_nla_tracks_copy_from_adt().
|
static |
Definition at line 48 of file nla.c.
Referenced by BKE_nla_action_pushdown(), and BKE_nla_action_stash().