Blender V4.5
blender::ed::animation::KeyframeCopyBuffer Struct Reference

#include <keyframes_general_intern.hh>

Public Member Functions

 KeyframeCopyBuffer ()=default
 
 KeyframeCopyBuffer (const KeyframeCopyBuffer &other)=delete
 
 ~KeyframeCopyBuffer ()=default
 
bool is_empty () const
 
bool is_single_fcurve () const
 
bool is_bone (const FCurve &fcurve) const
 
int num_slots () const
 
animrig::Channelbagchannelbag_for_slot (StringRef slot_identifier)
 
void debug_print () const
 

Public Attributes

animrig::StripKeyframeData keyframe_data
 
animrig::slot_handle_t last_used_slot_handle = DEFAULT_LAST_USED_SLOT_HANDLE
 
Map< animrig::slot_handle_t, std::string > slot_identifiers
 
Map< animrig::slot_handle_t, ID * > slot_animated_ids
 
Set< const FCurve * > bone_fcurves
 
float first_frame = std::numeric_limits<float>::infinity()
 
float last_frame = -std::numeric_limits<float>::infinity()
 
float current_frame = 0.0f
 

Static Public Attributes

static constexpr const char * SLOTLESS_SLOT_IDENTIFIER = ""
 
static constexpr animrig::slot_handle_t DEFAULT_LAST_USED_SLOT_HANDLE = 0x1acca
 

Detailed Description

Global copy/paste buffer for multi-slotted keyframe data.

All the animation data managed by this struct is copied into it, and thus owned by this struct.

Definition at line 33 of file keyframes_general_intern.hh.

Constructor & Destructor Documentation

◆ KeyframeCopyBuffer() [1/2]

blender::ed::animation::KeyframeCopyBuffer::KeyframeCopyBuffer ( )
default

◆ KeyframeCopyBuffer() [2/2]

blender::ed::animation::KeyframeCopyBuffer::KeyframeCopyBuffer ( const KeyframeCopyBuffer & other)
delete

◆ ~KeyframeCopyBuffer()

blender::ed::animation::KeyframeCopyBuffer::~KeyframeCopyBuffer ( )
default

Member Function Documentation

◆ channelbag_for_slot()

◆ debug_print()

◆ is_bone()

◆ is_empty()

bool blender::ed::animation::KeyframeCopyBuffer::is_empty ( ) const

◆ is_single_fcurve()

bool blender::ed::animation::KeyframeCopyBuffer::is_single_fcurve ( ) const

◆ num_slots()

int blender::ed::animation::KeyframeCopyBuffer::num_slots ( ) const

Member Data Documentation

◆ bone_fcurves

Set<const FCurve *> blender::ed::animation::KeyframeCopyBuffer::bone_fcurves

Pointers to F-Curves in this->keyframe_data that animate bones.

This is mostly to indicate which F-Curves are flipped when pasting flipped.

Definition at line 90 of file keyframes_general_intern.hh.

Referenced by copy_animedit_keys(), and is_bone().

◆ current_frame

float blender::ed::animation::KeyframeCopyBuffer::current_frame = 0.0f

The current scene frame when copying. Used for the 'relative' paste method.

Definition at line 97 of file keyframes_general_intern.hh.

Referenced by copy_animedit_keys(), debug_print(), and paste_animedit_keys().

◆ DEFAULT_LAST_USED_SLOT_HANDLE

animrig::slot_handle_t blender::ed::animation::KeyframeCopyBuffer::DEFAULT_LAST_USED_SLOT_HANDLE = 0x1acca
staticconstexpr

Just a more-or-less randomly chosen number to start at.

Having this distinctly different from DNA_DEFAULT_ACTION_LAST_SLOT_HANDLE makes it easier to spot bugs.

Definition at line 58 of file keyframes_general_intern.hh.

◆ first_frame

float blender::ed::animation::KeyframeCopyBuffer::first_frame = std::numeric_limits<float>::infinity()

◆ keyframe_data

animrig::StripKeyframeData blender::ed::animation::KeyframeCopyBuffer::keyframe_data

The copied keyframes, in a ChannelBag per slot.

Note that the slot handles are arbitrary, and are likely different from the handles of the original slots (i.e. the ones that the copied F-Curves were for). This is to make it possible to copy from different Actions (like is possible on the dope sheet) and still distinguish between their slots.

Definition at line 42 of file keyframes_general_intern.hh.

Referenced by channelbag_for_slot(), debug_print(), is_empty(), is_single_fcurve(), num_slots(), paste_animedit_keys(), and blender::ed::animation::pastebuf_find_matching_copybuf_item().

◆ last_frame

float blender::ed::animation::KeyframeCopyBuffer::last_frame = -std::numeric_limits<float>::infinity()

◆ last_used_slot_handle

animrig::slot_handle_t blender::ed::animation::KeyframeCopyBuffer::last_used_slot_handle = DEFAULT_LAST_USED_SLOT_HANDLE

Definition at line 59 of file keyframes_general_intern.hh.

◆ slot_animated_ids

Map<animrig::slot_handle_t, ID *> blender::ed::animation::KeyframeCopyBuffer::slot_animated_ids

Mapping from slot handles to the ID that they were copied from.

Multiple IDs can be animated by a single slot, in which case an arbitrary one is stored here. This pointer is only used to resolve RNA paths to find the property name, and thus the exact ID doesn't matter much.

TODO(@sybren): it would be better to track the ID name here, instead of the pointer. That'll make it safer to work with when pasting into another file, or after the copied-from ID has been deleted. For now I am trying to keep things feature-par with the original code this is replacing.

Definition at line 83 of file keyframes_general_intern.hh.

Referenced by blender::ed::animation::pastebuf_match_path_property().

◆ slot_identifiers

Map<animrig::slot_handle_t, std::string> blender::ed::animation::KeyframeCopyBuffer::slot_identifiers

Mapping from slot handles to their identifiers.

Since the StripKeyframeData only stores slot handles, and not their identifiers, this has to be stored here. An alternative would be to store the copied data into an Action, but that would allow for multi-layer, multi-strip data which is overkill for the functionality needed here.

Definition at line 69 of file keyframes_general_intern.hh.

Referenced by channelbag_for_slot(), debug_print(), and blender::ed::animation::pastebuf_match_path_property().

◆ SLOTLESS_SLOT_IDENTIFIER

const char* blender::ed::animation::KeyframeCopyBuffer::SLOTLESS_SLOT_IDENTIFIER = ""
staticconstexpr

Slot identifier used for slotless keyframes.

These are keyframes copied from F-Curves not owned by an Action, such as drivers and NLA control curves.

Definition at line 50 of file keyframes_general_intern.hh.

Referenced by debug_print(), and blender::ed::animation::pastebuf_find_matching_copybuf_item().


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