25#include "testing/testing.h"
68 Slot &slot_cube = action->slot_add();
69 Slot &slot_suzanne = action->slot_add();
75 Layer &layer = action->layer_add(
"Kübus layer");
76 Strip &key_strip = layer.
strip_add(*action, Strip::Type::Keyframe);
83 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 0}, {1.0f, 0.25f}, settings));
86 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 1}, {1.0f, 0.25f}, settings));
89 strip_data.
keyframe_insert(bmain, slot_suzanne, {
"location", 0}, {1.0f, 0.25f}, settings));
92 strip_data.
keyframe_insert(bmain, slot_suzanne, {
"location", 1}, {1.0f, 0.25f}, settings));
95 ASSERT_NE(
nullptr, cube_channelbag);
98 ASSERT_NE(
nullptr, fcu_cube_loc_x);
99 ASSERT_NE(
nullptr, fcu_cube_loc_y);
121 ListBase anim_data = {
nullptr,
nullptr};
130 ASSERT_GE(num_entries, 1)
131 <<
"Missing 1st ANIMTYPE_ACTION_SLOT entry, stopping to prevent crash";
135 EXPECT_EQ(&cube->id, first_ale->
id) <<
"id should be the animated ID (" << cube->id.name
136 <<
") but is (" << first_ale->
id->
name <<
")";
137 EXPECT_EQ(cube->adt, first_ale->
adt) <<
"adt should be the animated ID's animation data";
143 ASSERT_GE(num_entries, 2)
144 <<
"Missing 2nd ANIMTYPE_ACTION_SLOT entry, stopping to prevent crash";
158 ListBase anim_data = {
nullptr,
nullptr};
168 ASSERT_GE(num_entries, 1) <<
"Missing 1st ale, stopping to prevent crash";
174 ASSERT_GE(num_entries, 2) <<
"Missing 2nd ale, stopping to prevent crash";
180 ASSERT_GE(num_entries, 3) <<
"Missing 3rd ale, stopping to prevent crash";
187 ASSERT_GE(num_entries, 4) <<
"Missing 4th ale, stopping to prevent crash";
205 ListBase anim_data = {
nullptr,
nullptr};
230 Slot &slot_cube = action->slot_add();
235 Layer &layer = action->layer_add(
"Kübus layer");
236 Strip &key_strip = layer.
strip_add(*action, Strip::Type::Keyframe);
243 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 0}, {1.0f, 0.25f}, settings));
246 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 1}, {1.0f, 0.25f}, settings));
252 ASSERT_NE(
nullptr, cube_channelbag);
275 ListBase anim_data = {
nullptr,
nullptr};
Functions and classes to work with Actions.
Functions to modify FCurves.
Blender kernel action and pose functionality.
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_main_free(Main *bmain)
General operations, lookup, etc. for blender objects.
Object * BKE_object_add_only_object(Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Object is a sort of wrapper for general info.
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
void ANIM_animdata_freelist(ListBase *anim_data)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
const FCurve * fcurve_find(const FCurveDescriptor &fcurve_descriptor) const
Strip & strip_add(Action &owning_action, Strip::Type strip_type)
void set_expanded(bool expanded)
void set_selected(bool selected)
const Channelbag * channelbag_for_slot(const Slot &slot) const
SingleKeyingResult keyframe_insert(Main *bmain, const Slot &slot, const FCurveDescriptor &fcurve_descriptor, float2 time_value, const KeyframeSettings &settings, eInsertKeyFlags insert_key_flags=INSERTKEY_NOFLAGS, std::optional< float2 > cycle_range=std::nullopt)
const T & data(const Action &owning_action) const
static void SetUpTestSuite()
static void TearDownTestSuite()
TEST_F(ActionIteratorsTest, iterate_all_fcurves_of_slot)
KeyframeSettings get_keyframe_settings(bool from_userprefs)
ActionSlotAssignmentResult assign_action_and_slot(Action *action, Slot *slot_to_assign, ID &animated_id)
bool assign_action(bAction *action, ID &animated_id)
ActionSlotAssignmentResult assign_action_slot(Slot *slot_to_assign, ID &animated_id)