|
Blender V5.0
|
#include "DNA_listBase.h"#include "BKE_action.hh"#include "BKE_anim_data.hh"#include "BLI_function_ref.hh"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::nla |
Macros | |
| #define | NLASTRIP_MIN_LEN_THRESH 0.1f |
Enumerations | |
| enum | eNlaTime_ConvertModes { NLATIME_CONVERT_EVAL = 0 , NLATIME_CONVERT_UNMAP , NLATIME_CONVERT_MAP } |
| #define NLASTRIP_MIN_LEN_THRESH 0.1f |
Temp constant defined for these functions only.
Definition at line 12 of file BKE_nla.hh.
Referenced by BKE_nlastrip_compute_frame_from_previous_strip(), and BKE_nlastrip_compute_frame_to_next_strip().
| Enumerator | |
|---|---|
| NLATIME_CONVERT_EVAL | |
| NLATIME_CONVERT_UNMAP | |
| NLATIME_CONVERT_MAP | |
Definition at line 544 of file BKE_nla.hh.
| 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().
| 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().
| bool BKE_nla_action_stash | ( | OwnedAnimData | owned_adt, |
| bool | is_liboverride ) |
"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 2157 of file blenkernel/intern/nla.cc.
References AnimData::action, OwnedAnimData::adt, BKE_nla_action_slot_is_stashed(), BKE_nlastrip_new_for_slot(), BKE_nlastrip_validate_name(), BKE_nlatrack_add_strip(), BKE_nlatrack_new_after(), BKE_nlatrack_set_active(), BLI_addhead(), BLI_assert, BLI_remlink(), BLI_uniquename(), CLOG_ERROR, ELEM, NlaStrip::flag, NlaTrack::flag, ListBase::last, LOG, name, NlaTrack::name, AnimData::nla_tracks, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_SYNC_LENGTH, NLATRACK_MUTED, NLATRACK_PROTECTED, offsetof, OwnedAnimData::owner_id, NlaTrack::prev, AnimData::slot_handle, STASH_TRACK_NAME, and STRNCPY_UTF8.
Referenced by action_new_exec(), action_stash_create_exec(), and action_stash_exec().
Add a NLA Strip referencing the given speaker's sound.
Definition at line 608 of file blenkernel/intern/nla.cc.
References BKE_sound_info_get(), ceil, NlaStrip::end, NlaStrip::extendmode, NlaStrip::flag, float, SoundInfo::length, MEM_callocN(), NLASTRIP_EXTEND_NOTHING, NLASTRIP_FLAG_SELECT, NLASTRIP_TYPE_SOUND, NlaStrip::repeat, NlaStrip::scale, Speaker::sound, NlaStrip::type, and UNUSED_VARS.
Referenced by nlaedit_add_sound_exec(), and blender::ed::object::object_speaker_add_exec().
| void BKE_nla_blend_read_data | ( | BlendDataReader * | reader, |
| ID * | id_owner, | ||
| ListBase * | tracks ) |
Definition at line 2736 of file blenkernel/intern/nla.cc.
References blend_data_read_nla_strips(), BLO_read_struct_list, ID_IS_LINKED, LISTBASE_FOREACH, NLATRACK_OVERRIDELIBRARY_LOCAL, NlaStrip::strips, and tracks.
Referenced by BKE_animdata_blend_read_data().
| void BKE_nla_blend_write | ( | BlendWriter * | writer, |
| ListBase * | tracks ) |
Definition at line 2724 of file blenkernel/intern/nla.cc.
References blend_write_nla_strips(), BLO_write_struct, LISTBASE_FOREACH, and tracks.
Referenced by BKE_animdata_blend_write().
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().
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().
Print the ADT flags, NLA tracks, strips, their flags, and other info, to the console.
| adt | the ADT to show. If NULL, it will be determined from owner_id. |
| owner_id | the ID that owns this ADT. If given, its name will be printed in the console output. If NULL, that won't happen. |
Either of the parameters can be NULL, but not both.
Definition at line 2566 of file blenkernel/intern/nla.cc.
References AnimData::act_track, AnimData::actstrip, ADT_NLA_EDIT_NOMAP, ADT_NLA_EDIT_ON, ADT_NLA_EVAL_OFF, ADT_NLA_EVAL_UPPER_TRACKS, ADT_NLA_SKEYS_COLLAPSED, ADT_NLA_SOLO_TRACK, BKE_animdata_from_id(), BLI_listbase_is_empty(), AnimData::flag, NlaTrack::index, LISTBASE_FOREACH, ID::name, NlaStrip::name, NlaTrack::name, AnimData::nla_tracks, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_AUTO_BLENDS, NLASTRIP_FLAG_EDIT_TOUCHED, NLASTRIP_FLAG_INVALID_LOCATION, NLASTRIP_FLAG_MUTED, NLASTRIP_FLAG_NO_TIME_MAP, NLASTRIP_FLAG_REVERSE, NLASTRIP_FLAG_SELECT, NLASTRIP_FLAG_SYNC_LENGTH, NLASTRIP_FLAG_TEMP_META, NLASTRIP_FLAG_TWEAKUSER, NLASTRIP_FLAG_USR_INFLUENCE, NLASTRIP_FLAG_USR_TIME, NLASTRIP_FLAG_USR_TIME_CYCLIC, NLATRACK_ACTIVE, NLATRACK_DISABLED, NLATRACK_MUTED, NLATRACK_OVERRIDELIBRARY_LOCAL, NLATRACK_PROTECTED, NLATRACK_SELECTED, NLATRACK_SOLO, NLATRACK_TEMPORARILY_ADDED, printf, and NlaStrip::strips.
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().
| void BKE_nla_strip_foreach_id | ( | NlaStrip * | strip, |
| LibraryForeachIDData * | data ) |
Callback used by lib_query to walk over all ID usages (mimics foreach_id callback of IDTypeInfo structure).
Definition at line 644 of file blenkernel/intern/nla.cc.
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.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().
| 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().
| 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().
| 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.
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().
| 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().
| bool BKE_nla_tweakmode_enter | ( | OwnedAnimData | owned_adt | ) |
Find the active strip + track combination, and set them up as the tweaking track, and return if successful or not.
Definition at line 2333 of file blenkernel/intern/nla.cc.
References NlaStrip::act, AnimData::act_track, AnimData::action, NlaStrip::action_slot_handle, AnimData::actstrip, OwnedAnimData::adt, ADT_NLA_EDIT_ON, ADT_NLA_EVAL_UPPER_TRACKS, blender::animrig::assign_action_and_slot(), blender::animrig::assign_tmpaction_and_slot_handle(), BLI_assert_msg, BLI_assert_unreachable, ELEM, ListBase::first, AnimData::flag, NlaStrip::flag, NlaTrack::flag, G, G_DEBUG, bAction::id, id_us_plus(), ActionSlot::identifier, blender::animrig::Action::is_action_layered(), LISTBASE_FOREACH, NlaTrack::next, AnimData::nla_tracks, nla_tweakmode_find_active(), NLASTRIP_FLAG_TWEAKUSER, NLATRACK_DISABLED, blender::animrig::OK, OwnedAnimData::owner_id, printf, result, blender::animrig::Action::slot_for_handle(), AnimData::slot_handle, NlaStrip::strips, blender::animrig::unassign_action(), and UNUSED_VARS_NDEBUG.
Referenced by nlaedit_enable_tweakmode_exec(), and blender::animrig::tests::KeyframingTest::SetUp().
| void BKE_nla_tweakmode_exit | ( | OwnedAnimData | owned_adt | ) |
Exit tweak-mode for this AnimData block.
Definition at line 2501 of file blenkernel/intern/nla.cc.
References AnimData::action, NlaStrip::action_slot_handle, AnimData::actstrip, OwnedAnimData::adt, blender::animrig::nla::assign_action_slot_handle(), BLI_assert_msg, blender::animrig::generic_assign_action(), blender::animrig::Action::is_action_layered(), is_nla_in_tweakmode(), AnimData::last_slot_identifier, nla_tweakmode_exit_nofollowptr(), nla_tweakmode_exit_sync_strip_lengths(), blender::animrig::OK, OwnedAnimData::owner_id, result, blender::animrig::Action::slot_for_handle(), AnimData::slot_handle, blender::animrig::Slot::unassigned, UNUSED_VARS_NDEBUG, and blender::animrig::Slot::users_add().
Referenced by BKE_animdata_free(), BKE_nla_liboverride_post_process(), ED_animedit_unlink_action(), nlaedit_delete_exec(), nlaedit_disable_tweakmode(), and version_nla_tweakmode_incomplete().
| 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().
| void BKE_nla_validate_state | ( | AnimData * | adt | ) |
Ensure that auto-blending and other settings are set correctly.
Definition at line 2109 of file blenkernel/intern/nla.cc.
References BKE_nlastrip_recalculate_blend(), BKE_nlastrip_validate_autoblends(), ELEM, ListBase::first, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, AnimData::nla_tracks, nlastrip_validate_transition_start_end(), printf, and NlaStrip::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 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.
| void BKE_nlameta_flush_transforms | ( | 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 1102 of file blenkernel/intern/nla.cc.
References BKE_nlameta_flush_transforms(), ELEM, NlaStrip::end, ListBase::first, IS_EQF, ListBase::last, LISTBASE_FOREACH, NLASTRIP_TYPE_META, ptr, RNA_float_set(), RNA_pointer_create_discrete(), NlaStrip::start, NlaStrip::strips, and NlaStrip::type.
Referenced by BKE_nlameta_flush_transforms(), nlaedit_snap_exec(), nlaedit_swap_exec(), blender::ed::transform::nlastrip_shuffle_transformed(), and blender::ed::transform::recalcData_nla().
| NlaStrip * BKE_nlastack_add_strip | ( | OwnedAnimData | owned_adt, |
| const 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 571 of file blenkernel/intern/nla.cc.
References AnimData::action, OwnedAnimData::adt, BKE_nlastrip_new_for_slot(), BKE_nlastrip_validate_name(), BKE_nlatrack_add_strip(), BKE_nlatrack_new_tail(), BKE_nlatrack_set_active(), ELEM, bAction::id, ListBase::last, ID::name, NlaTrack::name, AnimData::nla_tracks, OwnedAnimData::owner_id, AnimData::slot_handle, and STRNCPY_UTF8.
Referenced by blender::ed::transform::animrecord_check_state(), BKE_nla_action_pushdown(), and blender::animrig::tests::KeyframingTest::SetUp().
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 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.
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 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.
Delete the NLA-Strip's control F-Curve.
This also ensures that the strip's flags are correctly updated.
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().
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.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().
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().
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().
Find the NLA-strip with the given name within the given track.
Definition at line 1548 of file blenkernel/intern/nla.cc.
References name, nlastrip_find_by_name(), and NlaTrack::strips.
| void BKE_nlastrip_free | ( | NlaStrip * | strip, |
| bool | do_id_user ) |
Frees the given NLA strip, and calls BKE_nlastrip_remove_and_free to remove and free all children strips.
Definition at line 70 of file blenkernel/intern/nla.cc.
References NlaStrip::act, BKE_fcurves_free(), BKE_nlastrip_remove_and_free(), NlaStrip::fcurves, ListBase::first, free_fmodifiers(), bAction::id, id_us_min(), MEM_freeN(), NlaStrip::modifiers, NlaStrip::next, and NlaStrip::strips.
Referenced by BKE_nlastrip_new_for_slot(), and BKE_nlastrip_remove_and_free().
| 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().
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().
| 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().
Returns the next strip in this strip's NLA track, or a null pointer.
| strip | The strip to find the next trip from. |
| check_transitions | Whether or not to skip transitions. |
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().
Returns the previous strip in this strip's NLA track, or a null pointer.
| strip | The strip to find the previous trip from. |
| check_transitions | Whether or not to skip transitions. |
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().
| 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().
| 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().
| 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().
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().
Definition at line 1502 of file blenkernel/intern/nla.cc.
References BKE_nlastrip_free(), and BKE_nlastrip_remove().
Referenced by BKE_nlastrip_free(), BKE_nlastrips_clear_metastrip(), BKE_nlatrack_free(), ED_animedit_unlink_action(), nlaedit_delete_exec(), and nlastrip_validate_transition_start_end().
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().
| void BKE_nlastrip_validate_fcurves | ( | NlaStrip * | strip | ) |
Validate the NLA-Strips 'control' F-Curves based on the flags set.
Definition at line 1802 of file blenkernel/intern/nla.cc.
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, FCurve::rna_path, NlaStrip::start, FCurve::totvert, U, and BezTriple::vec.
Referenced by blender::ed::transform::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 1916 of file blenkernel/intern/nla.cc.
References NlaStrip::act, BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_str_new(), BLI_uniquename_cb(), BLT_I18NCONTEXT_ID_ACTION, blender::StringRefNull::c_str(), CTX_DATA_, DATA_, ELEM, bAction::id, LISTBASE_FOREACH, ID::name, NlaStrip::name, AnimData::nla_tracks, NLASTRIP_TYPE_CLIP, NLASTRIP_TYPE_META, NLASTRIP_TYPE_TRANSITION, NlaStrip::strips, STRNCPY_UTF8, 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(), and blender::ed::object::object_speaker_add_exec().
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().
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().
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().
| 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.
| 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 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().
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().
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().
| 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.
| is_temp | are 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().
| 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().
Add the given NLA-Strip to the given NLA-Track. Calls BKE_nlastrips_add_strip to check if strip can be added.
Definition at line 1342 of file blenkernel/intern/nla.cc.
References BKE_nlastrips_add_strip(), ELEM, NlaTrack::flag, NLATRACK_OVERRIDELIBRARY_LOCAL, NLATRACK_PROTECTED, 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(), blender::ed::transform::nlastrip_shuffle_transformed(), blender::ed::object::object_speaker_add_exec(), blender::animrig::nla::tests::TEST_F(), and blender::animrig::nla::tests::TEST_F().
Copy a single NLA Track.
| flag | Control 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().
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().
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().
| 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().
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.
| 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().
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().
| 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().
| void BKE_nlatrack_insert_after | ( | ListBase * | nla_tracks, |
| NlaTrack * | prev, | ||
| NlaTrack * | new_track, | ||
| bool | is_liboverride ) |
Inserts a given NLA track after a specified NLA track within the passed NLA track list.
Definition at line 385 of file blenkernel/intern/nla.cc.
References BLI_assert, BLI_findindex(), BLI_insertlinkafter(), BLI_uniquename(), DATA_, ListBase::first, NlaTrack::flag, NlaTrack::index, name, NlaTrack::name, NlaTrack::next, NLATRACK_OVERRIDELIBRARY_LOCAL, offsetof, and NlaTrack::prev.
Referenced by BKE_nlatrack_insert_before(), BKE_nlatrack_new_after(), and blender::ed::transform::recalcData_nla().
| 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().
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().
Check whether given NLA track is not local (i.e. from linked data) when the object is a library override.
| nlt | May be NULL, in which case we consider it as a non-local track case. |
Definition at line 1397 of file blenkernel/intern/nla.cc.
References NlaTrack::flag, ID_IS_OVERRIDE_LIBRARY, and NLATRACK_OVERRIDELIBRARY_LOCAL.
Referenced by nla_fmodifier_add_exec(), nla_fmodifier_paste_exec(), nlaedit_add_meta_exec(), nlaedit_delete_exec(), nlaedit_delete_tracks_exec(), nlaedit_move_down_exec(), nlaedit_move_up_exec(), nlaedit_remove_meta_exec(), nlaedit_split_exec(), nlaedit_swap_exec(), rearrange_animchannels_filter_visible(), rearrange_nla_tracks(), blender::ed::transform::recalcData_nla(), and blender::ed::transform::transdata_get_track_shuffle_offset_side().
| struct 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().
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().
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().
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().
Calls BKE_nlatrack_new to create a new NLA track, inserts it as the tail of the NLA track list with BKE_nlatrack_new_after.
Definition at line 449 of file blenkernel/intern/nla.cc.
References BKE_nlatrack_new_after(), and ListBase::last.
Referenced by BKE_nlastack_add_strip(), nlaedit_add_actionclip_exec(), nlaedit_add_sound_exec(), nlaedit_add_tracks_empty(), nlaedit_add_tracks_existing(), blender::ed::object::object_speaker_add_exec(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::animrig::nla::tests::TEST_F(), and blender::animrig::nla::tests::TEST_F().
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().
Remove the given NLA track from the list of NLA tracks, free the track's data, and the track itself.
Definition at line 665 of file blenkernel/intern/nla.cc.
References BKE_nlatrack_free(), BKE_nlatrack_remove(), and tracks.
Referenced by BKE_nla_tracks_free(), ED_animedit_unlink_action(), nlaedit_delete_tracks_exec(), blender::ed::transform::nlatrack_truncate_temporary_tracks(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
Remove the NLA-Strip from the given NLA-Track.
Definition at line 1362 of file blenkernel/intern/nla.cc.
References BKE_nlastrip_remove(), BLI_assert, and NlaTrack::strips.
Referenced by nlaedit_move_down_exec(), nlaedit_move_up_exec(), blender::ed::transform::nlastrip_shuffle_transformed(), blender::ed::transform::recalcData_nla(), and blender::bke::tests::TEST().
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().
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().
| 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().
| 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.