|
Blender V4.3
|
#include <ANIM_action.hh>
Inherits ActionStrip.
Public Types | |
| enum class | Type : int8_t { Keyframe = 0 } |
Public Member Functions | |
| Strip ()=delete | |
| Strip (const Strip &other) | |
| Type | type () const |
| bool | is_infinite () const |
| bool | contains_frame (float frame_time) const |
| bool | is_last_frame (float frame_time) const |
| void | resize (float frame_start, float frame_end) |
| template<typename T > | |
| const T & | data (const Action &owning_action) const |
| template<typename T > | |
| T & | data (Action &owning_action) |
| void | slot_data_remove (Action &owning_action, slot_handle_t slot_handle) |
| template<> | |
| const StripKeyframeData & | data (const Action &owning_action) const |
| template<> | |
| StripKeyframeData & | data (Action &owning_action) |
Static Public Member Functions | |
| static Strip & | create (Action &owning_action, const Strip::Type type) |
Additional Inherited Members | |
Public Attributes inherited from ActionStrip | |
| int8_t | strip_type |
| uint8_t | _pad0 [3] |
| int | data_index |
| float | frame_start |
| float | frame_end |
| float | frame_offset |
| uint8_t | _pad1 [4] |
Strips define how the actual animation data is mapped onto the layers.
Strips do not technically own their own data, but instead refer to data that's stored in arrays directly on the action itself, and specify how that data is mapped onto a layer.
Different strips can refer to different types of data, although at the moment only one type of strip data is implemented: keyframe animation data.
Definition at line 405 of file ANIM_action.hh.
|
strong |
The possible types of strip data.
Each enum value here corresponds to one data type. It is used to record which type of data a strip refers to in the strip's data_type field (also returned by Strip::type()). Each data type also knows which enum value it corresponds to, stored in the type's static TYPE field.
| Enumerator | |
|---|---|
| Keyframe | |
Definition at line 415 of file ANIM_action.hh.
|
delete |
|
inlineexplicit |
Make a shallow copy, effectively creating an instance of a strip.
Does not make a copy of the strip's data, which is stored in an array on the owning action.
Definition at line 427 of file ANIM_action.hh.
| bool Strip::contains_frame | ( | float | frame_time | ) | const |
Definition at line 1509 of file animrig/intern/action.cc.
References ActionStrip::frame_end, and ActionStrip::frame_start.
Referenced by blender::animrig::tests::TEST_F().
Creates a new strip of type type for owning_action, with the strip's data created on the relevant data array on owning_action.
NOTE: strongly prefer using Layer::strip_add(), which creates a strip directly on a layer and sidesteps any ambiguities about ownership.
This method does not add the strip to a layer. That is the responsibility of the caller.
The strip is heap-allocated, and the caller is responsible for ensuring that it gets freed or is given an owner (such as a layer) that will later free it.
The new strip is initialized to have infinite extent and zero time offset.
Layer::strip_add() Definition at line 1479 of file animrig/intern/action.cc.
References BLI_assert_msg, ActionStrip::data_index, DNA_struct_default_get, blender::animrig::Action::strip_keyframe_data_append(), and ActionStrip::strip_type.
| StripKeyframeData & blender::animrig::Strip::data | ( | Action & | owning_action | ) |
Definition at line 1539 of file animrig/intern/action.cc.
References BLI_assert, ActionStrip::data_index, blender::animrig::Action::strip_keyframe_data(), blender::animrig::StripKeyframeData::TYPE, and type().
Fetch the strip's data from its owning action.
T must correspond to the strip's data type. In other words, this must hold true: T::TYPE == strip.type().
Referenced by blender::animrig::tests::add_fcurve_to_action(), blender::animrig::legacy::channelbag_ensure(), blender::animrig::legacy::channelbag_get(), convert_action_in_place(), blender::animrig::convert_to_layered_action(), blender::animrig::evaluate_strip(), blender::animrig::fcurve_find_in_action(), blender::animrig::insert_key_layer(), 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(), 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().
| const StripKeyframeData & blender::animrig::Strip::data | ( | const Action & | owning_action | ) | const |
Definition at line 1533 of file animrig/intern/action.cc.
References BLI_assert, ActionStrip::data_index, blender::animrig::Action::strip_keyframe_data(), blender::animrig::StripKeyframeData::TYPE, and type().
| bool Strip::is_infinite | ( | ) | const |
Definition at line 1503 of file animrig/intern/action.cc.
References ActionStrip::frame_end, and ActionStrip::frame_start.
Referenced by blender::animrig::assert_baklava_phase_1_invariants(), and blender::animrig::tests::TEST_F().
| bool Strip::is_last_frame | ( | float | frame_time | ) | const |
Definition at line 1514 of file animrig/intern/action.cc.
References ActionStrip::frame_end.
Referenced by blender::animrig::tests::TEST_F().
Set the start and end frame.
Note that this does not do anything else. There is no check whether the frame numbers are valid (i.e. frame_start <= frame_end). Infinite values (negative for frame_start, positive for frame_end) are supported.
Definition at line 1521 of file animrig/intern/action.cc.
References BLI_assert, BLI_assert_msg, ActionStrip::frame_end, and ActionStrip::frame_start.
Referenced by blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| void Strip::slot_data_remove | ( | Action & | owning_action, |
| slot_handle_t | slot_handle ) |
Remove all data belonging to the given slot.
This is typically only called from Layer::slot_data_remove().
Definition at line 1546 of file animrig/intern/action.cc.
References data, Keyframe, and type().
Referenced by blender::animrig::Layer::slot_data_remove().
|
inline |
Strip type.
Convenience wrapper to avoid having to do the cast from int to Strip::Type everywhere.
Definition at line 458 of file ANIM_action.hh.
Referenced by blender::animrig::assert_baklava_phase_1_invariants(), data(), data(), blender::animrig::evaluate_strip(), slot_data_remove(), blender::animrig::Layer::strip_remove(), and blender::animrig::tests::TEST_F().