|
Blender V5.0
|
#include <ANIM_action.hh>
Inherits ActionSlot.
Public Types | |
| enum class | Flags : uint8_t { Expanded = (1 << 0) , Selected = (1 << 1) , Active = (1 << 2) } |
Public Member Functions | |
| Slot () | |
| Slot (const Slot &other) | |
| ~Slot () | |
| void | blend_read_post () |
| std::string | idtype_string () const |
| StringRef | identifier_prefix () const |
| StringRefNull | identifier_without_prefix () const |
| bool | is_suitable_for (const ID &animated_id) const |
| bool | has_idtype () const |
| Flags | flags () const |
| bool | is_expanded () const |
| void | set_expanded (bool expanded) |
| bool | is_selected () const |
| void | set_selected (bool selected) |
| bool | is_active () const |
| Span< ID * > | users (Main &bmain) const |
| Vector< ID * > | runtime_users () |
| void | users_add (ID &animated_id) |
| void | users_remove (ID &animated_id) |
| void | identifier_ensure_prefix () |
Static Public Member Functions | |
| static void | users_invalidate (Main &bmain) |
Static Public Attributes | |
| static constexpr slot_handle_t | unassigned = 0 |
| static constexpr int | identifier_length_min = 3 |
| static constexpr int | identifier_length_max = MAX_ID_NAME |
Protected Member Functions | |
| void | set_active (bool active) |
Protected Attributes | |
| friend | Action |
Additional Inherited Members | |
| Public Attributes inherited from ActionSlot | |
| char | identifier [258] |
| int16_t | idtype |
| int32_t | handle |
| int8_t | slot_flags |
| uint8_t | _pad1 [7] |
| ActionSlotRuntimeHandle * | runtime |
Identifier for a sub-set of the animation data inside an Action.
An animatable ID specifies both an Action* and an ActionSlot::handle to identify which F-Curves (and in the future other animation data) it will be animated by.
Definition at line 765 of file ANIM_action.hh.
|
strong |
| blender::animrig::Slot::Slot | ( | ) |
Definition at line 1015 of file animrig/intern/action.cc.
References ActionSlot::runtime.
Referenced by Slot().
|
explicit |
Definition at line 1022 of file animrig/intern/action.cc.
References ActionSlot::runtime, and Slot().
| blender::animrig::Slot::~Slot | ( | ) |
Definition at line 1027 of file animrig/intern/action.cc.
References ActionSlot::runtime.
| void blender::animrig::Slot::blend_read_post | ( | ) |
Update the Slot after reading it from a blend file.
This is a low-level function and should not typically be used. It's only here to let blenkernel allocate the runtime struct when reading a Slot from disk, without having to share the struct definition itself.
Definition at line 1032 of file animrig/intern/action.cc.
References BLI_assert, and ActionSlot::runtime.
| Slot::Flags blender::animrig::Slot::flags | ( | ) | const |
Definition at line 1055 of file animrig/intern/action.cc.
References ActionSlot::slot_flags.
| bool blender::animrig::Slot::has_idtype | ( | ) | const |
Return whether this Slot has a specified intended ID type (idtype) set.
Definition at line 1050 of file animrig/intern/action.cc.
References ActionSlot::idtype.
Referenced by blender::animrig::assign_action_ensure_slot_for_keying(), blender::animrig::generic_slot_for_autoassign(), getname_anim_fcurve_for_slot(), identifier_ensure_prefix(), idtype_string(), is_suitable_for(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| void blender::animrig::Slot::identifier_ensure_prefix | ( | ) |
Ensure the first two characters of this Slot's identifier match its intended ID type.
This typically does not need to be called outside of some low-level functions. Aside from versioning code that upgrades legacy actions, Slots should always be created with a specific intended ID type and corresponding identifier prefix that never changes after creation, making this method unnecessary.
In the rare cases that a Slot does not have a specified intended ID type, this method still should typically not be called directly. In those cases prefer assigning to an ID (e.g. via Action::assign_action_slot()), which will set the Slot's intended ID type and identifier prefix to match the given ID's type, as well as ensure identifier uniqueness within the Action.
Definition at line 1169 of file animrig/intern/action.cc.
References BLI_assert, has_idtype(), ActionSlot::identifier, identifier_length_min, ActionSlot::idtype, and size().
Referenced by blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| StringRef blender::animrig::Slot::identifier_prefix | ( | ) | const |
Return the two-character type prefix of this Slot's identifier.
This corresponds to the intended ID type of the slot, e.g "OB" for object, "CA" for camera, etc.
This is subtly different from idtype_string(). See its documentation for details.
Definition at line 1150 of file animrig/intern/action.cc.
References BLI_assert, and ActionSlot::identifier.
Referenced by blender::animrig::tests::TEST_F().
| StringRefNull blender::animrig::Slot::identifier_without_prefix | ( | ) | const |
Return this Slot's identifier without the prefix, also known as the "display name".
E.g. if the identifier is "OBCube", then "Cube" is returned.
Definition at line 1158 of file animrig/intern/action.cc.
References BLI_assert, ActionSlot::identifier, identifier_length_min, and size().
Referenced by acf_action_slot_name().
| std::string blender::animrig::Slot::idtype_string | ( | ) | const |
Return a string that represents the Slot's 'idtype'.
E.g "OB" for object, "CA" for camera, etc.
This is different from identifier_prefix(): this constructs a string directly from the actual 'idtype' field of the Slot, whereas identifier_prefix() returns the first two characters of the identifier string.
This distinction matters in some lower-level code where the two can momentarily be out of sync, although this should always be corrected before exiting such code so that it's never observable in higher-level code.
Definition at line 1139 of file animrig/intern/action.cc.
References has_idtype(), ActionSlot::idtype, and name.
Referenced by blender::animrig::versioning::convert_legacy_animato_action(), and blender::animrig::tests::TEST_F().
| bool blender::animrig::Slot::is_active | ( | ) | const |
Definition at line 1087 of file animrig/intern/action.cc.
References Active, and ActionSlot::slot_flags.
Referenced by ANIM_is_active_channel(), and blender::animrig::tests::TEST_F().
| bool blender::animrig::Slot::is_expanded | ( | ) | const |
Definition at line 1059 of file animrig/intern/action.cc.
References Expanded, and ActionSlot::slot_flags.
Referenced by ANIM_animfilter_action_slot().
| bool blender::animrig::Slot::is_selected | ( | ) | const |
Definition at line 1073 of file animrig/intern/action.cc.
References Selected, and ActionSlot::slot_flags.
Referenced by ANIM_animfilter_action_slot(), anim_channels_selection_flag_for_toggle(), click_select_channel_action_slot(), blender::ed::animation::pastebuf_find_matching_copybuf_item(), and rearrange_layered_action_slots().
| bool blender::animrig::Slot::is_suitable_for | ( | const ID & | animated_id | ) | const |
Return whether this Slot is suitable to be used by the given ID.
"Suitable" means that one of the following is true:
If either of those hold true, the Slot is considered suitable for the ID. Otherwise it is considered unsuitable.
Note that it is possible, but odd, for an ID to use a Slot that is not suitable for it. This is discouraged, and a best effort is made to prevent this in typical cases, but it is not possible to completely prevent due to library linking (e.g. an Action linked from another file may be replaced in that other file, causing its Slots to effectively change). Therefore this method returning false should NOT be taken as a guarantee that this Slot will never be used by the given ID or other IDs of the same type.
Definition at line 1038 of file animrig/intern/action.cc.
References GS, has_idtype(), ActionSlot::idtype, and ID::name.
Referenced by blender::animrig::nla::assign_action(), blender::animrig::assign_action_ensure_slot_for_keying(), blender::animrig::generic_assign_action_slot(), and blender::animrig::generic_slot_for_autoassign().
Directly return the runtime users vector.
This function does not refresh the users cache, so it may be out of date.
This is a low-level function, and should only be used when calling users(bmain) is not appropriate.
Definition at line 1110 of file animrig/intern/action.cc.
References BLI_assert_msg, and ActionSlot::runtime.
Referenced by blender::animrig::nla::tests::TEST_F(), blender::animrig::nla::tests::TEST_F(), and blender::animrig::tests::TEST_F().
|
protected |
Set the 'Active' flag. Only allowed to be called by Action.
Definition at line 1091 of file animrig/intern/action.cc.
References Active, active, and ActionSlot::slot_flags.
| void blender::animrig::Slot::set_expanded | ( | bool | expanded | ) |
Definition at line 1063 of file animrig/intern/action.cc.
References Expanded, and ActionSlot::slot_flags.
Referenced by blender::animrig::tests::TEST_F().
| void blender::animrig::Slot::set_selected | ( | bool | selected | ) |
Definition at line 1077 of file animrig/intern/action.cc.
References Selected, and ActionSlot::slot_flags.
Referenced by click_select_channel_action_slot(), mouse_action_keys(), and blender::animrig::tests::TEST_F().
Return the set of IDs that are animated by this Slot.
Definition at line 1101 of file animrig/intern/action.cc.
References BLI_assert, Main::is_action_slot_to_id_map_dirty, blender::animrig::internal::rebuild_slot_user_cache(), and ActionSlot::runtime.
Referenced by acf_action_slot_name(), acf_fcurve_name(), achannel_is_part_of_disconnected_slot(), blender::animrig::action_slot_get_id_best_guess(), blender::animrig::action_slot_get_id_for_keying(), getname_anim_fcurve_for_slot(), blender::animrig::move_slot(), blender::animrig::tests::TEST_F(), and users_remove().
| void blender::animrig::Slot::users_add | ( | ID & | animated_id | ) |
Register this ID as animated by this Slot.
This is a low-level function and should not typically be used. Use #Action::assign_id(slot, animated_id) instead.
Definition at line 1116 of file animrig/intern/action.cc.
References BLI_assert, and ActionSlot::runtime.
Referenced by BKE_nla_tweakmode_exit(), and blender::animrig::generic_assign_action_slot().
|
static |
Mark the users cache as 'dirty', triggering a full rebuild next time it is accessed.
This is typically not necessary, and only called from low-level code.
Definition at line 1134 of file animrig/intern/action.cc.
References Main::is_action_slot_to_id_map_dirty.
Referenced by blender::bke::action_foreach_id(), blender::bke::animdata::action_slots_user_cache_invalidate(), and BKE_animdata_copy_in_lib().
| void blender::animrig::Slot::users_remove | ( | ID & | animated_id | ) |
Register this ID as no longer animated by this Slot.
This is a low-level function and should not typically be used. Use #Action::assign_id(nullptr, animated_id) instead.
Definition at line 1122 of file animrig/intern/action.cc.
References BLI_assert, ActionSlot::runtime, and users().
Referenced by blender::animrig::generic_assign_action_slot().
|
protected |
Definition at line 955 of file ANIM_action.hh.
|
staticconstexpr |
Definition at line 790 of file ANIM_action.hh.
Referenced by blender::animrig::versioning::convert_legacy_action_assignments(), and blender::animrig::generic_assign_action_slot().
|
staticconstexpr |
Slot identifiers consist of a two-character ID code, then the display name. This means that the minimum length of a valid identifier is 3 characters.
Definition at line 788 of file ANIM_action.hh.
Referenced by identifier_ensure_prefix(), identifier_without_prefix(), and blender::animrig::Action::slot_identifier_define().
|
staticconstexpr |
Slot handle value indicating that there is no slot assigned.
Definition at line 782 of file ANIM_action.hh.
Referenced by acf_fcurve_name(), animfilter_action(), blender::animrig::nla::assign_action(), BKE_animdata_fix_paths_rename(), BKE_animdata_transfer_by_basepath(), BKE_animsys_evaluate_animdata(), BKE_nla_tweakmode_exit(), blender::animrig::channelbag_for_action_slot(), blender::animrig::StripKeyframeData::channelbag_for_slot_add(), clear_anim_vse_exec(), delete_key_vse_without_keying_set(), blender::ed::animrig::extract_pose(), blender::animrig::first_slot_handle(), blender::animrig::generic_assign_action(), blender::animrig::generic_assign_action_slot(), blender::animrig::generic_assign_action_slot_handle(), blender::io::fbx::import_animations(), blender::animrig::Action::is_slot_animated(), nla_tweakmode_exit_nofollowptr(), blender::animrig::Action::slot_for_handle(), blender::animrig::nla::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::ed::animation::tests::TEST_F(), blender::ed::animation::tests::TEST_F(), and blender::ed::animation::tests::TEST_F().