25#include "testing/testing.h"
54 Slot &slot_cube = action->slot_add();
55 Slot &slot_suzanne = action->slot_add();
61 Layer &
layer = action->layer_add(
"Kübus layer");
69 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 0}, {1.0f, 0.25f}, settings));
72 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 1}, {1.0f, 0.25f}, settings));
75 strip_data.
keyframe_insert(bmain, slot_suzanne, {
"location", 0}, {1.0f, 0.25f}, settings));
78 strip_data.
keyframe_insert(bmain, slot_suzanne, {
"location", 1}, {1.0f, 0.25f}, settings));
81 ASSERT_NE(
nullptr, cube_channelbag);
84 ASSERT_NE(
nullptr, fcu_cube_loc_x);
85 ASSERT_NE(
nullptr, fcu_cube_loc_y);
107 ListBaseT<bAnimListElem> anim_data = {
nullptr,
nullptr};
116 ASSERT_GE(num_entries, 1)
117 <<
"Missing 1st ANIMTYPE_ACTION_SLOT entry, stopping to prevent crash";
121 EXPECT_EQ(&cube->id, first_ale->
id) <<
"id should be the animated ID (" << cube->id.name
122 <<
") but is (" << first_ale->
id->
name <<
")";
123 EXPECT_EQ(cube->adt, first_ale->
adt) <<
"adt should be the animated ID's animation data";
129 ASSERT_GE(num_entries, 2)
130 <<
"Missing 2nd ANIMTYPE_ACTION_SLOT entry, stopping to prevent crash";
144 ListBaseT<bAnimListElem> anim_data = {
nullptr,
nullptr};
154 ASSERT_GE(num_entries, 1) <<
"Missing 1st ale, stopping to prevent crash";
160 ASSERT_GE(num_entries, 2) <<
"Missing 2nd ale, stopping to prevent crash";
166 ASSERT_GE(num_entries, 3) <<
"Missing 3rd ale, stopping to prevent crash";
173 ASSERT_GE(num_entries, 4) <<
"Missing 4th ale, stopping to prevent crash";
191 ListBaseT<bAnimListElem> anim_data = {
nullptr,
nullptr};
216 Slot &slot_cube = action->slot_add();
221 Layer &
layer = action->layer_add(
"Kübus layer");
229 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 0}, {1.0f, 0.25f}, settings));
232 strip_data.
keyframe_insert(bmain, slot_cube, {
"location", 1}, {1.0f, 0.25f}, settings));
238 ASSERT_NE(
nullptr, cube_channelbag);
261 ListBaseT<bAnimListElem> anim_data = {
nullptr,
nullptr};
Functions and classes to work with Actions.
Functions to modify FCurves.
Blender kernel action and pose functionality.
General operations, lookup, etc. for blender objects.
Object is a sort of wrapper for general info.
const FCurve * fcurve_find(const FCurveDescriptor &fcurve_descriptor) const
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
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)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
void BKE_main_free(Main *bmain)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
void * BKE_id_new(Main *bmain, short type, const char *name)
eDopeSheet_FilterFlag filterflag