Blender V4.3
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)
 
void slot_data_remove (Action &owning_action, slot_handle_t slot_handle)
 

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.

Definition at line 506 of file ANIM_action.hh.

Member Enumeration Documentation

◆ Flags

Enumerator
Enabled 

Definition at line 527 of file ANIM_action.hh.

◆ MixMode

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 538 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 e.g. Action::strip_keyframe_data_array, and it leaves 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 876 of file animrig/intern/action.cc.

References blender::StringRefNull::c_str(), copy(), ActionLayer::strip_array, ActionLayer::strip_array_num, and strips().

Referenced by blender::bke::action_copy_data().

◆ find_strip_index()

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

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

Definition at line 962 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 533 of file ANIM_action.hh.

◆ mix_mode()

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

Definition at line 551 of file ANIM_action.hh.

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

◆ slot_data_remove()

void blender::animrig::Layer::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 Action::slot_remove().

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

References blender::animrig::Strip::slot_data_remove(), strip(), and strips().

◆ strip() [1/2]

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

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

References ActionLayer::strip_array.

◆ strip() [2/2]

◆ strip_add()

Strip & blender::animrig::Layer::strip_add ( Action & owning_action,
Strip::Type strip_type )

◆ 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 936 of file animrig/intern/action.cc.

References ActionStrip::data_index, 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(), blender::animrig::strip_ptr_destructor(), and blender::animrig::Strip::type().

◆ strips() [1/2]

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

◆ strips() [2/2]


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