// // AnimationObject.cpp // libraries/animation/src/ // // Created by Andrzej Kapolka on 4/17/14. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // Copyright 2022-2023 Overte e.V. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // SPDX-License-Identifier: Apache-2.0 // #include "AnimationObject.h" #include #include #include #include #include "AnimationCache.h" STATIC_SCRIPT_TYPES_INITIALIZER(+[](ScriptManager* manager) { registerAnimationTypes(manager->engine().get()); }); STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager) { registerAnimationPrototypes(manager->engine().get()); }); QStringList AnimationObject::getJointNames() const { return scriptvalue_cast(thisObject())->getJointNames(); } QVector AnimationObject::getFrames() const { return scriptvalue_cast(thisObject())->getFrames(); } QVector AnimationFrameObject::getRotations() const { return scriptvalue_cast(thisObject()).rotations; } void registerAnimationTypes(ScriptEngine* engine) { scriptRegisterSequenceMetaType >(engine); } void registerAnimationPrototypes(ScriptEngine* engine) { engine->setDefaultPrototype(qMetaTypeId(), engine->newQObject( new AnimationFrameObject(), ScriptEngine::ScriptOwnership)); engine->setDefaultPrototype(qMetaTypeId(), engine->newQObject( new AnimationObject(), ScriptEngine::ScriptOwnership)); }