26#include "testing/testing.h"
69 Slot &slot_cube = action->slot_add();
70 Slot &slot_suzanne = action->slot_add();
76 Layer &layer = action->layer_add(
"Kübus layer");
77 Strip &key_strip = layer.strip_add(*action, Strip::Type::Keyframe);
84 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 0}, {1.0f, 0.25f}, settings));
87 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 1}, {1.0f, 0.25f}, settings));
90 strip_data.
keyframe_insert(bmain, slot_suzanne, {
"location", 0}, {1.0f, 0.25f}, settings));
93 strip_data.
keyframe_insert(bmain, slot_suzanne, {
"location", 1}, {1.0f, 0.25f}, settings));
96 ASSERT_NE(
nullptr, cube_channel_bag);
99 ASSERT_NE(
nullptr, fcu_cube_loc_x);
100 ASSERT_NE(
nullptr, fcu_cube_loc_y);
122 ListBase anim_data = {
nullptr,
nullptr};
131 ASSERT_GE(num_entries, 1)
132 <<
"Missing 1st ANIMTYPE_ACTION_SLOT entry, stopping to prevent crash";
136 EXPECT_EQ(&cube->id, first_ale->
id) <<
"id should be the animated ID (" << cube->id.name
137 <<
") but is (" << first_ale->
id->
name <<
")";
138 EXPECT_EQ(cube->adt, first_ale->
adt) <<
"adt should be the animated ID's animation data";
144 ASSERT_GE(num_entries, 2)
145 <<
"Missing 2nd ANIMTYPE_ACTION_SLOT entry, stopping to prevent crash";
159 ListBase anim_data = {
nullptr,
nullptr};
169 ASSERT_GE(num_entries, 1) <<
"Missing 1st ale, stopping to prevent crash";
175 ASSERT_GE(num_entries, 2) <<
"Missing 2nd ale, stopping to prevent crash";
181 ASSERT_GE(num_entries, 3) <<
"Missing 3rd ale, stopping to prevent crash";
188 ASSERT_GE(num_entries, 4) <<
"Missing 4th ale, stopping to prevent crash";
202 fcu_cube_loc_x->
flag &= ~FCURVE_SELECTED;
206 ListBase anim_data = {
nullptr,
nullptr};
231 Slot &slot_cube = action->slot_add();
236 Layer &layer = action->layer_add(
"Kübus layer");
237 Strip &key_strip = layer.strip_add(*action, Strip::Type::Keyframe);
244 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 0}, {1.0f, 0.25f}, settings));
247 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 1}, {1.0f, 0.25f}, settings));
253 ASSERT_NE(
nullptr, cube_channel_bag);
257 fcurve_other->
flag &= ~FCURVE_ACTIVE;
276 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)
Main * BKE_main_new(void)
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 struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct 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(FCurveDescriptor fcurve_descriptor) const
void set_expanded(bool expanded)
void set_selected(bool selected)
SingleKeyingResult keyframe_insert(Main *bmain, const Slot &slot, FCurveDescriptor fcurve_descriptor, float2 time_value, const KeyframeSettings &settings, eInsertKeyFlags insert_key_flags=INSERTKEY_NOFLAGS)
const ChannelBag * channelbag_for_slot(const Slot &slot) const
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)
float wrap(float value, float max, float min)
int32_t action_slot_handle