blob: 5905b2f01a13859b1a8845298c8d491f2f906c93 [file]
#include "rive/animation/keyframe.hpp"
#include "rive/animation/cubic_interpolator.hpp"
#include "rive/animation/keyed_property.hpp"
#include "rive/core_context.hpp"
#include "rive/importers/import_stack.hpp"
#include "rive/importers/keyed_property_importer.hpp"
using namespace rive;
void KeyFrame::computeSeconds(int fps) { m_seconds = frame() / (float)fps; }
// `KeyFrame::frameChanged` lives in
// `editor_native/native/src/editor/animation/keyframe_editor.cpp`
// — see the matching comment in `keyed_property.cpp`.
StatusCode KeyFrame::import(ImportStack& importStack)
{
auto importer =
importStack.latest<KeyedPropertyImporter>(KeyedProperty::typeKey);
if (importer == nullptr)
{
return StatusCode::MissingObject;
}
importer->addKeyFrame(std::unique_ptr<KeyFrame>(this));
return Super::import(importStack);
}