Blender V5.0
blender::animrig::Layer Class Reference

#include <ANIM_action.hh>

Inherits ActionLayer.

Public Types

enum class  Flags : uint8_t { Enabled = (1 << 0) }
enum class  MixMode : int8_t {
  Replace = 0 , Offset = 1 , Add = 2 , Subtract = 3 ,
  Multiply = 4
}

Public Member Functions

 Layer ()=default
 Layer (const Layer &other)=delete
 ~Layer ()
Layerduplicate_with_shallow_strip_copies (StringRefNull allocation_name) const
Flags flags () const
MixMode mix_mode () const
blender::Span< const Strip * > strips () const
blender::Span< Strip * > strips ()
const Stripstrip (int64_t index) const
Stripstrip (int64_t index)
Stripstrip_add (Action &owning_action, Strip::Type strip_type)
bool strip_remove (Action &owning_action, Strip &strip)

Protected Member Functions

int64_t find_strip_index (const Strip &strip) const

Additional Inherited Members

Public Attributes inherited from ActionLayer
char name [64]
float influence
uint8_t layer_flags
int8_t layer_mix_mode
uint8_t _pad0 [2]
struct ActionStrip ** strip_array
int strip_array_num
uint8_t _pad1 [4]

Detailed Description

Layers can be stacked on top of each other to define the animation. Each layer has a mix mode and an influence (0-1), which define how it is mixed with the layers below it.

Layers contain one or more Strips, which in turn contain the animation data itself.

Temporary limitation: at most one strip may exist on a layer, and it extends from negative to positive infinity.

Note: the invariants around multiple strips (such as strip overlap, ordering within the strip array, etc.) have not yet been decided. These will be decided and documented when support for multiple strips is added.

Definition at line 669 of file ANIM_action.hh.

Member Enumeration Documentation

◆ Flags

enum class blender::animrig::Layer::Flags : uint8_t
strong
Enumerator
Enabled 

Definition at line 690 of file ANIM_action.hh.

◆ MixMode

enum class blender::animrig::Layer::MixMode : int8_t
strong
Enumerator
Replace 

Channels in this layer override the same channels from underlying layers.

Offset 

Channels in this layer are added to underlying layers as sequential operations.

Add 

Channels in this layer are added to underlying layers on a per-channel basis.

Subtract 

Channels in this layer are subtracted to underlying layers on a per-channel basis.

Multiply 

Channels in this layer are multiplied with underlying layers on a per-channel basis.

Definition at line 701 of file ANIM_action.hh.

Constructor & Destructor Documentation

◆ Layer() [1/2]

blender::animrig::Layer::Layer ( )
default

◆ Layer() [2/2]

blender::animrig::Layer::Layer ( const Layer & other)
delete

◆ ~Layer()

blender::animrig::Layer::~Layer ( )

Member Function Documentation

◆ duplicate_with_shallow_strip_copies()

Layer * blender::animrig::Layer::duplicate_with_shallow_strip_copies ( StringRefNull allocation_name) const

Duplicate the layer and its strips, but only make shallow copies of the strips.

Specifically, this doesn't duplicate the strip data that's stored in the layer's owning action, leaving the fields of the strips themselves exactly as-is.

WARNING: this method is primarily used in the code that makes full duplicates of actions, where the arrays of strip data are copied separately for efficiency. This method's applications are narrow and you probably shouldn't use it unless you really know what you're doing.

Definition at line 916 of file animrig/intern/action.cc.

References blender::StringRefNull::c_str(), copy(), i, Layer(), MEM_calloc_arrayN(), MEM_callocN(), ActionLayer::strip_array_num, and strips().

Referenced by blender::bke::action_copy_data(), and Layer().

◆ find_strip_index()

int64_t blender::animrig::Layer::find_strip_index ( const Strip & strip) const
protected

Return the index of strip in this layer's strip array, or -1 if not found in this layer.

Definition at line 1002 of file animrig/intern/action.cc.

References strip(), strips(), and visit_strip().

Referenced by strip_remove().

◆ flags()

Flags blender::animrig::Layer::flags ( ) const
inline

Definition at line 696 of file ANIM_action.hh.

References ActionLayer::layer_flags.

◆ mix_mode()

MixMode blender::animrig::Layer::mix_mode ( ) const
inline

Definition at line 714 of file ANIM_action.hh.

References ActionLayer::layer_mix_mode.

Referenced by blender::animrig::blend_layer_results().

◆ strip() [1/2]

Strip * blender::animrig::Layer::strip ( int64_t index)

Definition at line 955 of file animrig/intern/action.cc.

References ActionLayer::strip_array.

◆ strip() [2/2]

◆ strip_add()

◆ strip_remove()

bool blender::animrig::Layer::strip_remove ( Action & owning_action,
Strip & strip )

Remove the strip from this layer.

After this call, the passed reference is no longer valid, as the memory will have been freed.

Returns
true when the strip was found & removed, false if it wasn't found.

Definition at line 976 of file animrig/intern/action.cc.

References find_strip_index(), blender::dna::array::remove_index(), strip(), ActionLayer::strip_array, ActionLayer::strip_array_num, blender::animrig::Action::strip_keyframe_data_remove_if_unused(), and blender::animrig::strip_ptr_destructor().

Referenced by blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().

◆ strips() [1/2]

blender::Span< Strip * > blender::animrig::Layer::strips ( )

◆ strips() [2/2]


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