|
Blender V5.3
|
#include <ANIM_action.hh>
Inherits blender::bAction.
Protected Member Functions | |
| int64_t | find_layer_index (const Layer &layer) const |
| int64_t | find_slot_index (const Slot &slot) const |
| int | strip_keyframe_data_append (StripKeyframeData *strip_data) |
| void | strip_keyframe_data_remove_if_unused (int index) |
Protected Attributes | |
| friend | Strip |
| friend | Layer |
Additional Inherited Members | |
| Public Attributes inherited from blender::bAction | |
| ID | id |
| struct ActionLayer ** | layer_array = nullptr |
| int | layer_array_num = 0 |
| int | layer_active_index = 0 |
| struct ActionSlot ** | slot_array = nullptr |
| int | slot_array_num = 0 |
| int32_t | last_slot_handle = DNA_DEFAULT_ACTION_LAST_SLOT_HANDLE |
| struct ActionStripKeyframeData ** | strip_keyframe_data_array = nullptr |
| int | strip_keyframe_data_array_num = 0 |
| char | _pad0 [4] = {} |
| ListBaseT< FCurve > | curves = {nullptr, nullptr} |
| ListBaseT< bActionGroup > | groups = {nullptr, nullptr} |
| ListBaseT< struct TimeMarker > | markers = {nullptr, nullptr} |
| eAction_Flags | flag = {} |
| int | active_marker = 0 |
| int | idroot = 0 |
| char | _pad1 [4] = {} |
| float | frame_start = 0 |
| float | frame_end = 0 |
| PreviewImage * | preview = nullptr |
Container of animation data for one or more animated IDs.
An Action broadly consists of four things:
StripData is not stored in the Strips themselves, but rather is stored separately at the top level of the Action, and each Strip references a StripData item. This allows Strip instancing by having more than one Strip reference the same StripData item.
Each Action has a set of Slots defined at its top level. The animation data within a StripData item is organized into one or more subsets, each of which is marked as being for a different Slot.
For an ID to be animated by an Action, the ID must specify both an Action and a Slot within that Action. The Slot that the ID uses determines which subset of the animation data throughout the Action it is animated by. If an Action but no Slot is specified, the ID is simply not animated.
Definition at line 88 of file ANIM_action.hh.
|
default |
Referenced by Action(), and slot_for_handle().
|
delete |
Copy constructor is deleted, as code should use regular ID library management functions to duplicate this data-block.
References Action(), blender::ATTR_WARN_UNUSED_RESULT, get_frame_range(), get_frame_range_of_keys(), get_frame_range_of_slot(), get_layer_for_keyframing(), has_keyframes(), has_single_frame(), is_cyclic(), is_empty(), is_slot_animated(), Layer, layer(), layer_add(), layer_keystrip_ensure(), layer_remove(), layers(), slot(), slot_active_get(), slot_active_set(), slot_add(), slot_add_for_id(), slot_add_for_id_type(), slot_display_name_define(), slot_display_name_set(), slot_find_by_identifier(), slot_for_handle(), slot_identifier_define(), slot_identifier_propagate(), slot_identifier_set(), slot_idtype_define(), slot_move_to_index(), slot_remove(), slot_setup_for_id(), slots(), and strip_keyframe_data().
Return the layer's index, or -1 if not found in this Action.
Definition at line 313 of file animrig/intern/action.cc.
References Layer, layer(), and layers().
Referenced by layer_remove().
Return the slot's index, or -1 if not found in this Action.
Definition at line 324 of file animrig/intern/action.cc.
References slot(), and slots().
Referenced by slot_remove().
| float2 blender::animrig::Action::get_frame_range | ( | ) | const |
Retrieve the intended playback frame range of the entire Action.
Definition at line 780 of file animrig/intern/action.cc.
References blender::ACT_FRAME_RANGE, blender::animrig::legacy::fcurves_all(), blender::bAction::flag, blender::bAction::frame_end, blender::bAction::frame_start, and blender::animrig::get_frame_range_of_fcurves().
Referenced by Action(), blender::draw_nla_main_data(), and blender::animrig::insert_key_layer().
| float2 blender::animrig::Action::get_frame_range_of_keys | ( | bool | include_modifiers | ) | const |
Calculate the extents of this Action.
Performs a scan of all F-Curves for their first & last key frames.
Definition at line 800 of file animrig/intern/action.cc.
References blender::animrig::legacy::fcurves_all(), and blender::animrig::get_frame_range_of_fcurves().
Referenced by Action(), and blender::animrig::tests::TEST_F().
| float2 blender::animrig::Action::get_frame_range_of_slot | ( | slot_handle_t | slot_handle | ) | const |
Retrieve the intended playback frame range of a slot.
Definition at line 790 of file animrig/intern/action.cc.
References blender::ACT_FRAME_RANGE, blender::animrig::fcurves_for_action_slot(), blender::bAction::flag, blender::bAction::frame_end, blender::bAction::frame_start, and blender::animrig::get_frame_range_of_fcurves().
Referenced by Action().
| Layer * blender::animrig::Action::get_layer_for_keyframing | ( | ) |
Get the layer that should be used for user-level keyframe insertion.
Definition at line 689 of file animrig/intern/action.cc.
References blender::animrig::assert_baklava_phase_1_invariants(), is_empty(), Layer, layer(), and layers().
Referenced by Action(), and blender::animrig::prep_action_layer_for_keying().
| bool blender::animrig::Action::has_keyframes | ( | slot_handle_t | action_slot_handle | ) | const |
Check if the slot with this handle has any keyframes.
Definition at line 724 of file animrig/intern/action.cc.
References blender::animrig::fcurves_for_action_slot().
Referenced by Action(), and blender::animrig::legacy::assigned_action_has_keyframes().
| bool blender::animrig::Action::has_single_frame | ( | ) | const |
Return whether the action has one unique point in time keyed.
This is mostly for the pose library, which will have different behavior depending on whether an Action corresponds to a "pose" (one keyframe) or "animation snippet" (multiple keyframes).
Definition at line 734 of file animrig/intern/action.cc.
References blender::compare_ff(), and blender::animrig::legacy::fcurves_all().
Referenced by Action(), and blender::animrig::tests::TEST_F().
| bool blender::animrig::Action::is_cyclic | ( | ) | const |
Returns whether this Action is configured as cyclic.
Definition at line 772 of file animrig/intern/action.cc.
References blender::ACT_CYCLIC, blender::ACT_FRAME_RANGE, and blender::bAction::flag.
Referenced by Action(), blender::animrig::insert_key_layer(), and blender::nlastrip_new().
| bool blender::animrig::Action::is_empty | ( | ) | const |
Return whether this Action has any data at all.
Definition at line 218 of file animrig/intern/action.cc.
References blender::bAction::groups, blender::bAction::layer_array_num, and blender::bAction::slot_array_num.
Referenced by Action(), blender::bke::action_free_data(), blender::animrig::animdata_remove_empty_action(), blender::animfilter_action(), blender::deg::DepsgraphRelationBuilder::build_action(), blender::deg::DepsgraphRelationBuilder::build_animdata_action_targets(), blender::animrig::versioning::convert_legacy_animato_actions(), get_layer_for_keyframing(), and layer_keystrip_ensure().
| bool blender::animrig::Action::is_slot_animated | ( | slot_handle_t | slot_handle | ) | const |
Return whether this Action actually has any animation data for the given slot.
Definition at line 614 of file animrig/intern/action.cc.
References blender::animrig::fcurves_for_action_slot(), blender::Span< T >::is_empty(), and blender::animrig::Slot::unassigned.
Referenced by Action(), and blender::BKE_animdata_id_is_animated().
Definition at line 240 of file animrig/intern/action.cc.
References Layer, and blender::bAction::layer_array.
Definition at line 236 of file animrig/intern/action.cc.
References Layer, and blender::bAction::layer_array.
Referenced by Action(), blender::animrig::action_channelbag_ensure(), blender::bke::action_copy_data(), blender::animrig::action_fcurve_attach(), blender::animrig::tests::add_fcurve_to_action(), blender::animrig::assert_baklava_phase_1_invariants(), blender::animrig::fcurve_find_by_rna_path(), blender::animrig::fcurve_find_in_action(), find_layer_index(), blender::animrig::tests::KeyframingTest::get_channelbag_in_first_layer(), get_layer_for_keyframing(), blender::io::fbx::import_animations(), layer_keystrip_ensure(), blender::animrig::move_slot(), strip_keyframe_data_remove_if_unused(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| Layer & blender::animrig::Action::layer_add | ( | std::optional< StringRefNull > | name | ) |
Create a new layer in this Action.
The new layer is added to the end of the layer array, and will be empty (no strips).
| name | The name to give the new layer. If no name is given, a default name is used. The name may be altered (e.g. appending ".001") to enforce uniqueness within the Action. |
Definition at line 245 of file animrig/intern/action.cc.
References blender::animrig::ActionLayer_alloc(), DATA_, blender::animrig::grow_array_and_append(), blender::bAction::idroot, Layer, blender::bAction::layer_active_index, blender::bAction::layer_array, blender::bAction::layer_array_num, blender::ActionLayer::name, and STRNCPY_UTF8.
Referenced by Action(), blender::animrig::versioning::convert_legacy_animato_action(), blender::ed::animrig::extract_pose(), layer_keystrip_ensure(), blender::separate_slots_exec(), blender::animrig::tests::AnimationEvaluationTest::SetUp(), blender::animrig::tests::PoseTest::SetUp(), blender::slot_channels_move_to_new_action_exec(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| void blender::animrig::Action::layer_keystrip_ensure | ( | ) |
Ensure that there is at least one layer with the infinite keyframe strip.
Definition at line 291 of file animrig/intern/action.cc.
References blender::animrig::assert_baklava_phase_1_invariants(), DATA_, is_empty(), blender::animrig::Strip::Keyframe, Layer, layer(), layer_add(), and layers().
Referenced by Action(), blender::animrig::action_channelbag_ensure(), blender::animrig::action_fcurve_attach(), blender::animrig::tests::add_fcurve_to_action(), blender::io::fbx::import_animations(), blender::animrig::move_slot(), blender::animrig::prep_action_layer_for_keying(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| bool blender::animrig::Action::layer_remove | ( | Layer & | layer_to_remove | ) |
Remove the layer from this Action.
After this call, the passed reference is no longer valid, as the memory will have been freed. Any strips on the layer will be freed too.
Definition at line 276 of file animrig/intern/action.cc.
References find_layer_index(), Layer, blender::bAction::layer_active_index, blender::bAction::layer_array, blender::bAction::layer_array_num, blender::animrig::layer_ptr_destructor(), and blender::dna::array::remove_index().
Referenced by Action().
Definition at line 232 of file animrig/intern/action.cc.
References Layer, blender::bAction::layer_array, and blender::bAction::layer_array_num.
Definition at line 228 of file animrig/intern/action.cc.
References Layer, blender::bAction::layer_array, and blender::bAction::layer_array_num.
Referenced by Action(), blender::bke::action_blend_write(), blender::bke::action_copy_data(), blender::animrig::action_fcurve_detach(), blender::bke::action_free_data(), blender::animrig::assert_baklava_phase_1_invariants(), blender::deg::DepsgraphRelationBuilder::build_animdata_action_targets(), blender::animrig::legacy::channel_groups_all(), blender::animrig::channelbag_for_action_slot(), blender::animrig::channelbags_for_action_slot(), blender::animrig::evaluate_action(), find_layer_index(), blender::animrig::foreach_fcurve_in_action(), blender::animrig::foreach_fcurve_in_action_slot(), blender::animrig::foreach_fcurve_in_action_slot_editable(), get_layer_for_keyframing(), layer_keystrip_ensure(), blender::animrig::move_slot(), strip_keyframe_data_remove_if_unused(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::ed::animrig::update_pose_action_from_scene().
Definition at line 347 of file animrig/intern/action.cc.
References blender::bAction::slot_array.
Definition at line 343 of file animrig/intern/action.cc.
References blender::bAction::slot_array.
Referenced by Action(), blender::bke::action_blend_write(), blender::bke::action_copy_data(), blender::animrig::tests::add_fcurve_to_action(), blender::animrig::nla::assign_action(), blender::animrig::assign_action_ensure_slot_for_keying(), blender::BKE_action_flip_with_pose(), find_slot_index(), blender::animrig::generic_slot_for_autoassign(), blender::animrig::get_best_pose_slot_for_id(), blender::rearrange_layered_action_slots(), blender::separate_slots_exec(), slot_active_get(), slot_active_set(), slot_add(), slot_add_for_id(), slot_add_for_id_type(), slot_display_name_define(), slot_display_name_set(), slot_find_by_identifier(), slot_for_handle(), slot_for_handle(), slot_identifier_define(), slot_identifier_propagate(), slot_identifier_set(), slot_idtype_define(), slot_move_to_index(), slot_setup_for_id(), and blender::animrig::tests::TEST_F().
| Slot * blender::animrig::Action::slot_active_get | ( | ) |
Get the active Slot.
This requires a linear scan of the slots, to find the one with the 'Active' flag set. Storing this on the Slot itself has the advantage that the 'active' status of a Slot can be determined without requiring access to the owning Action.
As this already does a linear scan for the active slot, the slot is returned as a pointer; obtaining the pointer from a handle would require another linear scan to get the pointer, whereas obtaining the handle from the pointer is a constant operation.
Definition at line 604 of file animrig/intern/action.cc.
References blender::animrig::Slot::is_active(), slot(), and slots().
Referenced by Action().
| void blender::animrig::Action::slot_active_set | ( | slot_handle_t | slot_handle | ) |
Set the active Slot, ensuring only one Slot is flagged as the Active one.
| slot_handle | if #Slot::unassigned, there will not be any active slot. Passing an unknown/invalid slot handle will result in no slot being active. |
Definition at line 597 of file animrig/intern/action.cc.
References blender::ActionSlot::handle, blender::animrig::Slot::set_active(), slot(), and slots().
Referenced by Action(), blender::click_select_channel_action_slot(), and blender::mouse_action_keys().
| Slot & blender::animrig::Action::slot_add | ( | ) |
Create a new Slot.
This method should generally not be used outside of low-level code and legacy action versioning code, because it creates a Slot with an unspecified intended ID type, which should be avoided. Prefer slot_add_for_id_type() and slot_add_for_id() for adding new slots.
TODO: we should probably rename this method to make it clear that it shouldn't be used as the standard way to add a slot.
The slot is given a default name and will be suitable for any ID type. After assigning the slot to an ID, it will be changed to only be suitable for that ID's type.
Definition at line 491 of file animrig/intern/action.cc.
References blender::ARRAY_SIZE(), blender::BLI_strncpy_utf8(), DATA_, blender::animrig::grow_array_and_append(), blender::ActionSlot::identifier, blender::bAction::idroot, slot(), blender::bAction::slot_array, blender::bAction::slot_array_num, blender::animrig::slot_identifier_ensure_unique(), and STRNCPY_UTF8.
Referenced by Action(), blender::animrig::tests::add_fcurve_to_action(), blender::animrig::versioning::convert_legacy_animato_action(), blender::animrig::duplicate_slot(), blender::animrig::move_slot(), blender::replace_action_new_exec(), blender::animrig::tests::AnimationEvaluationTest::SetUp(), slot_add_for_id(), slot_add_for_id_type(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
Create a new, unused Slot suitable for the given ID.
The slot will be named after animated_id.adt.last_slot_identifier, defaulting to the ID's name when that is not set. This is done so that toggling Actions works transparently, when toggling between this and the Action last assigned to the ID.
The slot will only be suitable for the ID's type.
Note that this assigns neither this Action nor the new Slot to the ID. This function merely initializes the Slot itself to suitable values to start animating this ID.
Definition at line 530 of file animrig/intern/action.cc.
References blender::BKE_animdata_from_id(), blender::animrig::Slot::identifier_ensure_prefix(), blender::ActionSlot::idtype, blender::blender::StringRefBase::is_empty(), blender::AnimData::last_slot_identifier, blender::ID::name, slot(), slot_add(), and slot_identifier_define().
Referenced by Action(), blender::animrig::assign_action_ensure_slot_for_keying(), blender::ensure_animdata_pair(), blender::ed::animrig::extract_pose(), blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert_finalize(), and blender::animrig::tests::TEST_F().
Create a new, unused Slot for the given ID type.
The returned slot will only be suitable for the specified ID type.
Definition at line 515 of file animrig/intern/action.cc.
References blender::ARRAY_SIZE(), blender::BLI_strncpy_utf8(), DATA_, blender::ActionSlot::identifier, blender::animrig::Slot::identifier_ensure_prefix(), blender::ActionSlot::idtype, slot(), slot_add(), and blender::animrig::slot_identifier_ensure_unique().
Referenced by Action(), and blender::io::fbx::import_animations().
| void blender::animrig::Action::slot_display_name_define | ( | Slot & | slot, |
| StringRefNull | new_display_name ) |
Set the slot display name (the part of the identifier after the two-letter ID prefix), and ensure the resulting identifier is unique.
This has to be done on the Action level to ensure each slot has a unique identifier within the Action.
Definition at line 397 of file animrig/intern/action.cc.
References blender::ARRAY_SIZE(), BLI_assert_msg, blender::BLI_strncpy_utf8(), blender::StringRefNull::c_str(), blender::ActionSlot::identifier, slot(), blender::animrig::slot_identifier_ensure_unique(), and blender::StringRef::StringRef().
Referenced by Action(), and slot_display_name_set().
| void blender::animrig::Action::slot_display_name_set | ( | Main & | bmain, |
| Slot & | slot, | ||
| StringRefNull | new_display_name ) |
Set the slot display name (the part of the identifier after the two-letter ID prefix), ensure the resulting identifier is unique, and propagate the new identifier to all data-blocks that use it
This has to be done on the Action level to ensure each slot has a unique identifier within the Action.
Definition at line 391 of file animrig/intern/action.cc.
References slot(), slot_display_name_define(), and slot_identifier_propagate().
Referenced by Action().
| Slot * blender::animrig::Action::slot_find_by_identifier | ( | StringRefNull | slot_identifier | ) |
Return the slot in this action with the given identifier, if any.
Definition at line 467 of file animrig/intern/action.cc.
References blender::StringRefNull::c_str(), blender::ActionSlot::identifier, slot(), slots(), and STREQ.
Referenced by Action(), and blender::animrig::generic_slot_for_autoassign().
| Slot * blender::animrig::Action::slot_for_handle | ( | slot_handle_t | handle | ) |
Return the Slot with the given handle.
| handle | can be Slot::unassigned, in which case nullptr is returned. |
Definition at line 352 of file animrig/intern/action.cc.
References Action(), slot(), and slot_for_handle().
Referenced by blender::acf_fcurve_name(), blender::achannel_is_part_of_disconnected_slot(), Action(), blender::animrig::action_fcurve_attach(), blender::animrig::action_slot_get_id_for_keying(), blender::action_slot_summary_to_keylist(), blender::ANIM_animchannel_keyframes_loop(), blender::animfilter_action(), blender::animrig::assign_action_ensure_slot_for_keying(), blender::animrig::nla::assign_action_slot_handle(), blender::BKE_nla_tweakmode_enter(), blender::BKE_nla_tweakmode_exit(), blender::deg::DepsgraphRelationBuilder::build_animdata_action_targets(), blender::animrig::delete_keyframe(), blender::ed::outliner::TreeElementIDAction::expand(), blender::animrig::fcurve_find_by_rna_path(), blender::animrig::generic_assign_action_slot(), blender::animrig::get_action_slot_pair(), blender::merge_actions_selection_exec(), blender::ed::animation::pastebuf_find_matching_copybuf_item(), blender::animrig::internal::rebuild_slot_user_cache(), blender::rotation_mode_convert_exec(), slot_for_handle(), blender::ed::object::test_constraint(), and blender::animrig::tests::TEST_F().
| const Slot * blender::animrig::Action::slot_for_handle | ( | slot_handle_t | handle | ) | const |
Definition at line 358 of file animrig/intern/action.cc.
References blender::ActionSlot::handle, slot(), slots(), and blender::animrig::Slot::unassigned.
| void blender::animrig::Action::slot_identifier_define | ( | Slot & | slot, |
| StringRefNull | new_identifier ) |
Set the slot identifier, and ensure it is unique.
Definition at line 427 of file animrig/intern/action.cc.
References BLI_assert_msg, blender::StringRefNull::c_str(), blender::ActionSlot::identifier, blender::animrig::Slot::identifier_length_min, slot(), blender::animrig::slot_identifier_ensure_unique(), blender::StringRef::StringRef(), and STRNCPY_UTF8.
Referenced by Action(), blender::animrig::versioning::convert_legacy_animato_action(), blender::io::fbx::import_animations(), blender::replace_action_new_exec(), slot_add_for_id(), slot_identifier_set(), and blender::animrig::tests::TEST_F().
Update the AnimData::last_slot_identifier field of any ID that is animated by this Slot.
Should be called after slot_identifier_define(slot). This is implemented as a separate function due to the need to access bmain, which is available in the RNA on-property-update handler, but not in the RNA property setter.
Definition at line 436 of file animrig/intern/action.cc.
References blender::AnimData::action, blender::BKE_animdata_from_id(), FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, blender::ActionSlot::handle, blender::bAction::id, blender::id_can_have_animdata(), blender::ActionSlot::identifier, blender::AnimData::last_slot_identifier, slot(), blender::AnimData::slot_handle, and STRNCPY_UTF8.
Referenced by Action(), slot_display_name_set(), and slot_identifier_set().
| void blender::animrig::Action::slot_identifier_set | ( | Main & | bmain, |
| Slot & | slot, | ||
| StringRefNull | new_identifier ) |
Set the slot identifier, ensure it is unique, and propagate the new identifier to all data-blocks that use it.
This has to be done on the Action level to ensure each slot has a unique identifier within the Action.
Definition at line 416 of file animrig/intern/action.cc.
References slot(), slot_identifier_define(), and slot_identifier_propagate().
Referenced by Action().
Set the slot's target ID type, updating the identifier prefix to match and ensuring that the resulting identifier is unique.
This has to be done on the Action level to ensure each slot has a unique identifier within the Action.
Definition at line 409 of file animrig/intern/action.cc.
References blender::animrig::Slot::identifier_ensure_prefix(), blender::ActionSlot::idtype, slot(), and blender::animrig::slot_identifier_ensure_unique().
Referenced by Action().
| void blender::animrig::Action::slot_move_to_index | ( | Slot & | slot, |
| int | to_slot_index ) |
Move the given slot to position to_slot_index among the slots of the action.
slot must belong to this action, and to_slot_index must be a valid index in the slot array.
Definition at line 586 of file animrig/intern/action.cc.
References blender::animrig::array_shift_range(), blender::BLI_assert(), BLI_assert_msg, slot(), blender::bAction::slot_array, blender::bAction::slot_array_num, and slots().
Referenced by Action(), and blender::rearrange_layered_action_slots().
| bool blender::animrig::Action::slot_remove | ( | Slot & | slot_to_remove | ) |
Remove a slot, and ALL animation data that belongs to it.
After this call, the reference is no longer valid as the slot will have been freed.
Note that this does NOT unassign this slot from all its users. When the Action is linked into another file, that other file cannot be updated, and so missing slots are something that has to be handled anyway. Also any new slot on this Action will NOT reuse this slot's handle.
Definition at line 564 of file animrig/intern/action.cc.
References find_slot_index(), blender::ActionSlot::handle, blender::dna::array::remove_index(), blender::bAction::slot_array, blender::bAction::slot_array_num, blender::animrig::slot_ptr_destructor(), and strip_keyframe_data().
Referenced by Action(), blender::animchannels_delete_containers(), and blender::animrig::move_slot().
Set the slot's ID type to that of the animated ID, ensure the identifier prefix is set accordingly, and that the identifier is unique within the Action.
This is a low-level function, and shouldn't be called directly outside of the generic slot-assignment functions.
Definition at line 706 of file animrig/intern/action.cc.
References blender::BLI_assert(), blender::GS(), blender::animrig::Slot::has_idtype(), ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, blender::ActionSlot::idtype, blender::ID::name, and slot().
Referenced by Action(), and blender::animrig::generic_assign_action_slot().
Definition at line 339 of file animrig/intern/action.cc.
References blender::bAction::slot_array, and blender::bAction::slot_array_num.
Definition at line 335 of file animrig/intern/action.cc.
References blender::bAction::slot_array, and blender::bAction::slot_array_num.
Referenced by Action(), blender::bke::action_blend_write(), blender::bke::action_copy_data(), blender::bke::action_foreach_id(), blender::bke::action_free_data(), blender::animfilter_action_slots(), blender::animrig::nla::assign_action(), blender::animrig::assign_action_ensure_slot_for_keying(), blender::do_versions_after_linking_405(), blender::animrig::duplicate_slot(), blender::ed::outliner::TreeElementIDAction::expand(), find_slot_index(), blender::animrig::generic_assign_action_slot(), blender::animrig::generic_slot_for_autoassign(), blender::animrig::move_slot(), blender::rearrange_layered_action_slots(), blender::animrig::internal::rebuild_slot_user_cache(), blender::replace_action_new_exec(), slot_active_get(), slot_active_set(), slot_find_by_identifier(), slot_for_handle(), blender::animrig::slot_identifier_ensure_unique(), slot_move_to_index(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| Span< StripKeyframeData * > blender::animrig::Action::strip_keyframe_data | ( | ) |
Definition at line 679 of file animrig/intern/action.cc.
References blender::bAction::strip_keyframe_data_array, and blender::bAction::strip_keyframe_data_array_num.
| Span< const StripKeyframeData * > blender::animrig::Action::strip_keyframe_data | ( | ) | const |
Strip data array access.
Definition at line 670 of file animrig/intern/action.cc.
References blender::bAction::strip_keyframe_data_array, and blender::bAction::strip_keyframe_data_array_num.
Referenced by Action(), blender::bke::action_blend_write(), blender::bke::action_copy_data(), blender::bke::action_free_data(), blender::animrig::Strip::data(), blender::animrig::Strip::data(), slot_remove(), blender::animrig::tests::TEST_F(), and blender::ed::animrig::update_pose_action_from_scene().
|
protected |
Append the given StripKeyframeData item to the action's keyframe data array.
Note: this takes ownership of strip_data.
Definition at line 624 of file animrig/intern/action.cc.
References blender::BLI_assert(), blender::animrig::grow_array_and_append(), blender::bAction::strip_keyframe_data_array, and blender::bAction::strip_keyframe_data_array_num.
Referenced by blender::animrig::Strip::create().
|
protected |
Remove the keyframe strip data at index if it is no longer used anywhere in the action.
If the strip data is unused, it is both removed from the array and freed. Otherwise no changes are made and the action remains as-is.
Note: this may alter the indices of some strip data items, due to items shifting around to fill the gap left by the removed item. This method ensures that all indices stored within the action (e.g. in the strips themselves) are properly updated to the new values so that everything is still referencing the same data. However, if any indices are stored outside the action, they will no longer be valid.
Definition at line 634 of file animrig/intern/action.cc.
References blender::BLI_assert(), blender::animrig::Strip::Keyframe, Layer, layer(), layers(), blender::animrig::shrink_array_and_swap_remove(), Strip, blender::bAction::strip_keyframe_data_array, blender::bAction::strip_keyframe_data_array_num, and blender::animrig::Layer::strips().
Referenced by blender::animrig::Layer::strip_remove().
|
protected |
Definition at line 427 of file ANIM_action.hh.
Referenced by Action(), find_layer_index(), get_layer_for_keyframing(), layer(), layer(), layer_add(), layer_keystrip_ensure(), layer_remove(), layers(), layers(), and strip_keyframe_data_remove_if_unused().
|
protected |
Definition at line 426 of file ANIM_action.hh.
Referenced by strip_keyframe_data_remove_if_unused().