|
Blender V5.0
|
#include <ANIM_action.hh>
Inherits ActionStrip.
Public Types | |
| enum class | Type : int8_t { Keyframe = 0 } |
Public Member Functions | |
| Strip ()=delete | |
| Strip (const Strip &other)=default | |
| 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) |
| 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 551 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 561 of file ANIM_action.hh.
|
explicitdefault |
| bool Strip::contains_frame | ( | float | frame_time | ) | const |
Return whether the given frame is within the strip's frame range.
Definition at line 1659 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.
Definition at line 1629 of file animrig/intern/action.cc.
References BLI_assert_msg, ActionStrip::data_index, DNA_struct_default_get, MEM_callocN(), Strip(), blender::animrig::Action::strip_keyframe_data_append(), ActionStrip::strip_type, and type().
Referenced by Strip().
| T & blender::animrig::Strip::data | ( | Action & | owning_action | ) |
References T.
| StripKeyframeData & blender::animrig::Strip::data | ( | Action & | owning_action | ) |
Definition at line 1689 of file animrig/intern/action.cc.
References BLI_assert, ActionStrip::data_index, blender::animrig::Action::strip_keyframe_data(), blender::animrig::StripKeyframeData::TYPE, and type().
| const T & blender::animrig::Strip::data | ( | const Action & | owning_action | ) | const |
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().
For example, to get a keyframe strip's data:
References T.
Referenced by blender::animrig::tests::add_fcurve_to_action(), blender::animrig::legacy::channelbag_ensure(), blender::animrig::legacy::channelbag_get(), blender::animrig::versioning::convert_legacy_animato_action(), blender::animrig::convert_to_layered_action(), blender::animrig::evaluate_strip(), blender::animrig::fcurve_find_in_action(), blender::io::fbx::import_animations(), blender::animrig::insert_key_layer(), blender::animrig::tests::PoseTest::SetUp(), 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(), 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 1683 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 |
Return whether the strip's frame range extends from -infinity to +infinity.
Definition at line 1653 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 |
Return whether the end of the strip's frame range matches the given frame time.
Definition at line 1664 of file animrig/intern/action.cc.
References ActionStrip::frame_end.
Referenced by blender::animrig::tests::TEST_F().
Set the start and end frame.
This directly sets the start/end frames to the values given. It is up to the caller to ensure the invariants of the strip itself and of the layer it belongs to.
frame_start must be less than or equal to frame_end. Infinite values (negative for frame_start, positive for frame_end) are supported.
Definition at line 1671 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().
|
inline |
Strip type.
Convenience wrapper to avoid having to do the cast from int to Strip::Type everywhere.
Definition at line 601 of file ANIM_action.hh.
References ActionStrip::strip_type.
Referenced by blender::animrig::assert_baklava_phase_1_invariants(), create(), data(), data(), blender::animrig::evaluate_strip(), Strip(), and blender::animrig::tests::TEST_F().