#include "DataModel/Animation.hpp" #include "DataModel/KeyframeSequenceProvider.hpp" #include "DataModel/AnimationTrackState.hpp" #include "DataModel/PartInstance.hpp" #include "DataModel/JointInstance.hpp" namespace Aya { const char* const sAnimation = "Animation"; const Reflection::PropDescriptor prop_AnimationId( "AnimationId", category_Data, &Animation::getAssetId, &Animation::setAssetId); // const Reflection::PropDescriptor prop_Loop("Loop", category_Data, &Animation::getLoop, &Animation::setLoop); // const Reflection::EnumPropDescriptor prop_Priority("Priority", category_Data, &Animation::getPriority, // &Animation::setPriority); //////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // FRONTEND AND BACKEND Animation::Animation() : DescribedCreatable() { setName(sAnimation); } bool Animation::isEmbeddedAsset() const { return !assetId.isHttp() && !assetId.isAsset(); } shared_ptr Animation::getKeyframeSequence() const { return getKeyframeSequence(this); } shared_ptr Animation::getKeyframeSequence(const Instance* context) const { if (assetId.isNull()) { return shared_ptr(); } if (KeyframeSequenceProvider* keyframeSequenceProvider = ServiceProvider::create(context)) { return keyframeSequenceProvider->getKeyframeSequence(assetId, this); } return shared_ptr(); } void Animation::setAssetId(AnimationId value) { if (assetId != value) { assetId = value; raisePropertyChanged(prop_AnimationId); } } } // namespace Aya