19 for (
Strip *strip : layer->strips()) {
20 if (strip->type() == Strip::Type::Keyframe) {
33 if (!action.
slots().is_empty()) {
34 return *action.
slot(0);
44 if (action.
slots().is_empty()) {
66 if (action.
layers().is_empty()) {
80template<
typename ActionType,
84 typename StripKeyframeDataType,
85 typename ChannelbagType>
89 if (action.is_action_legacy()) {
92 legacy_fcurves.
append(fcurve);
94 return legacy_fcurves;
101 for (LayerType *layer : action.layers()) {
102 for (
StripType *strip : layer->strips()) {
103 switch (strip->type()) {
104 case Strip::Type::Keyframe: {
106 for (ChannelbagType *bag : strip_data.channelbags()) {
107 for (FCurveType *fcurve : bag->fcurves()) {
108 all_fcurves.
append(fcurve);
145 Action &action_wrap = action->wrap();
151 if (action_wrap.
slots().is_empty()) {
158template<
typename ActionType,
162 typename StripKeyframeDataType,
163 typename ChannelbagType>
168 if (action.is_action_legacy()) {
200 const Channelbag>(action->wrap(), slot_handle);
205 if (!adt || !adt->
action) {
212 if (!adt || !adt->
action) {
221 if (adt ==
nullptr || adt->
action ==
nullptr) {
240 Action &action_wrap = action->wrap();
246 legacy_groups.
append(group);
248 return legacy_groups;
254 for (
Strip *strip : layer->strips()) {
255 switch (strip->type()) {
256 case Strip::Type::Keyframe: {
259 all_groups.
extend(bag->channel_groups());
270 if (!adt || !adt->
action) {
298 return !action.wrap().is_action_layered();
310 Action &action_wrapped = action.wrap();
315 bool any_removed =
false;
317 if (!fcurve->rna_path) {
336 bool any_removed =
false;
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
void BKE_fcurve_free(FCurve *fcu)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
BMesh const char void * data
constexpr bool is_empty() const
constexpr const char * c_str() const
void append(const T &value)
void extend(Span< T > array)
void slot_display_name_define(Slot &slot, StringRefNull new_display_name)
const Layer * layer(int64_t index) const
const Slot * slot(int64_t index) const
blender::Span< const Layer * > layers() const
bool is_action_legacy() const
bool has_keyframes(slot_handle_t action_slot_handle) const ATTR_WARN_UNUSED_RESULT
blender::Span< const Slot * > slots() const
Layer & layer_add(std::optional< StringRefNull > name)
const FCurve * fcurve(int64_t index) const
void fcurve_remove_by_index(int64_t fcurve_index)
blender::Span< const bActionGroup * > channel_groups() const
blender::Span< const Strip * > strips() const
const Strip * strip(int64_t index) const
Strip & strip_add(Action &owning_action, Strip::Type strip_type)
blender::Span< const Channelbag * > channelbags() const
const T & data(const Action &owning_action) const
Slot & slot_ensure(Action &action)
Channelbag & channelbag_ensure(Action &action)
constexpr const char * DEFAULT_LEGACY_LAYER_NAME
Vector< FCurve * > fcurves_for_action_slot(bAction *action, slot_handle_t slot_handle)
static Vector< FCurveType * > fcurves_all_templated(ActionType &action)
Vector< bActionGroup * > channel_groups_for_assigned_slot(AnimData *adt)
Vector< const FCurve * > fcurves_all(const bAction *action)
static Strip * first_keyframe_strip(Action &action)
Channelbag * channelbag_get(Action &action)
bool action_fcurves_remove(bAction &action, slot_handle_t slot_handle, StringRefNull rna_path_prefix)
Vector< FCurve * > fcurves_first_slot(bAction *action)
Vector< FCurve * > fcurves_for_assigned_action(AnimData *adt)
bool assigned_action_has_keyframes(AnimData *adt)
constexpr const char * DEFAULT_LEGACY_SLOT_NAME
Vector< bActionGroup * > channel_groups_all(bAction *action)
static Vector< FCurveType * > fcurves_for_action_slot_templated(ActionType &action, const slot_handle_t slot_handle)
bool action_treat_as_legacy(const bAction &action)
void assert_baklava_phase_1_invariants(const Action &action)
const animrig::Channelbag * channelbag_for_action_slot(const Action &action, slot_handle_t slot_handle)
decltype(::ActionSlot::handle) slot_handle_t
Span< FCurve * > fcurves_for_action_slot(Action &action, slot_handle_t slot_handle)
Vector< T * > listbase_to_vector(ListBase &list)