Blender V4.3
blender::animrig::Strip Class Reference

#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 Tdata (const Action &owning_action) const
 
template<typename T >
Tdata (Action &owning_action)
 
void slot_data_remove (Action &owning_action, slot_handle_t slot_handle)
 
template<>
const StripKeyframeDatadata (const Action &owning_action) const
 
template<>
StripKeyframeDatadata (Action &owning_action)
 

Static Public Member Functions

static Stripcreate (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]
 

Detailed Description

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.

Member Enumeration Documentation

◆ Type

enum class blender::animrig::Strip::Type : int8_t
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.

Constructor & Destructor Documentation

◆ Strip() [1/2]

blender::animrig::Strip::Strip ( )
delete

◆ Strip() [2/2]

blender::animrig::Strip::Strip ( const Strip & other)
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.

Member Function Documentation

◆ contains_frame()

bool Strip::contains_frame ( float frame_time) const

◆ create()

Strip & Strip::create ( Action & owning_action,
const Strip::Type type )
static

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.

See also
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.

◆ data() [1/4]

template<typename T >
T & blender::animrig::Strip::data ( Action & owning_action)

◆ data() [2/4]

template<>
StripKeyframeData & blender::animrig::Strip::data ( Action & owning_action)

◆ data() [3/4]

◆ data() [4/4]

template<>
const StripKeyframeData & blender::animrig::Strip::data ( const Action & owning_action) const

◆ is_infinite()

◆ is_last_frame()

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().

◆ resize()

void Strip::resize ( float frame_start,
float frame_end )

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().

◆ slot_data_remove()

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().

◆ type()

Type blender::animrig::Strip::type ( ) const
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().


The documentation for this class was generated from the following files: