diff options
Diffstat (limited to 'src/animation')
28 files changed, 105 insertions, 37 deletions
diff --git a/src/animation/backend/abstractevaluateclipanimatorjob.cpp b/src/animation/backend/abstractevaluateclipanimatorjob.cpp index 236a96efe..5267d4526 100644 --- a/src/animation/backend/abstractevaluateclipanimatorjob.cpp +++ b/src/animation/backend/abstractevaluateclipanimatorjob.cpp @@ -53,13 +53,8 @@ public: void postFrame(Qt3DCore::QAspectManager *manager) override; - Q_DECLARE_PUBLIC(AbstractEvaluateClipAnimatorJob) - AnimationRecord m_record; QVector<AnimationCallbackAndValue> m_callbacks; - -private: - AbstractEvaluateClipAnimatorJob *q_ptr; }; AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob() diff --git a/src/animation/backend/animationclip.cpp b/src/animation/backend/animationclip.cpp index 2dea81b52..2c7e4fffb 100644 --- a/src/animation/backend/animationclip.cpp +++ b/src/animation/backend/animationclip.cpp @@ -68,6 +68,7 @@ AnimationClip::AnimationClip() , m_name() , m_channels() , m_duration(0.0f) + , m_channelComponentCount(0) { } @@ -81,6 +82,7 @@ void AnimationClip::cleanup() m_dataType = Unknown; m_channels.clear(); m_duration = 0.0f; + m_channelComponentCount = 0; clearData(); } diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp index 3cfa81446..b4cc04323 100644 --- a/src/animation/backend/buildblendtreesjob.cpp +++ b/src/animation/backend/buildblendtreesjob.cpp @@ -50,8 +50,9 @@ namespace Animation { BuildBlendTreesJob::BuildBlendTreesJob() : Qt3DCore::QAspectJob() + , m_handler(nullptr) { - SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0); + SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0) } void BuildBlendTreesJob::setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles) diff --git a/src/animation/backend/channelmapping.cpp b/src/animation/backend/channelmapping.cpp index 83e7322da..1e3aa76f0 100644 --- a/src/animation/backend/channelmapping.cpp +++ b/src/animation/backend/channelmapping.cpp @@ -59,7 +59,6 @@ ChannelMapping::ChannelMapping() , m_componentCount(0) , m_propertyName(nullptr) , m_callback(nullptr) - , m_callbackFlags(0) , m_skeletonId() , m_mappingType(MappingType::ChannelMappingType) { @@ -74,7 +73,7 @@ void ChannelMapping::cleanup() m_propertyName = nullptr; m_componentCount = 0; m_callback = nullptr; - m_callbackFlags = 0; + m_callbackFlags = {}; m_skeletonId = Qt3DCore::QNodeId(); } @@ -106,9 +105,9 @@ void ChannelMapping::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firs const QCallbackMapping *callbackMapping = qobject_cast<const QCallbackMapping *>(frontEnd); if (callbackMapping) { m_mappingType = ChannelMappingType; - m_channelName = channelMapping->channelName(); + m_channelName = callbackMapping->channelName(); - const QCallbackMappingPrivate *d = static_cast<const QCallbackMappingPrivate *>(Qt3DCore::QNodePrivate::get(channelMapping)); + const QCallbackMappingPrivate *d = static_cast<const QCallbackMappingPrivate *>(Qt3DCore::QNodePrivate::get(callbackMapping)); m_type = d->m_type; m_callback = d->m_callback; m_callbackFlags = d->m_callbackFlags; diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp index 9b6802d3b..765531902 100644 --- a/src/animation/backend/evaluateblendclipanimatorjob.cpp +++ b/src/animation/backend/evaluateblendclipanimatorjob.cpp @@ -54,6 +54,7 @@ namespace Animation { EvaluateBlendClipAnimatorJob::EvaluateBlendClipAnimatorJob() : AbstractEvaluateClipAnimatorJob() + , m_handler(nullptr) { SET_JOB_RUN_STAT_TYPE(this, JobTypes::EvaluateBlendClipAnimator, 0) } diff --git a/src/animation/backend/evaluateclipanimatorjob.cpp b/src/animation/backend/evaluateclipanimatorjob.cpp index 7a568e829..914a38139 100644 --- a/src/animation/backend/evaluateclipanimatorjob.cpp +++ b/src/animation/backend/evaluateclipanimatorjob.cpp @@ -52,6 +52,7 @@ namespace Animation { EvaluateClipAnimatorJob::EvaluateClipAnimatorJob() : AbstractEvaluateClipAnimatorJob() + , m_handler(nullptr) { SET_JOB_RUN_STAT_TYPE(this, JobTypes::EvaluateClipAnimator, 0) } diff --git a/src/animation/backend/findrunningclipanimatorsjob.cpp b/src/animation/backend/findrunningclipanimatorsjob.cpp index fde3f7db8..1005914c7 100644 --- a/src/animation/backend/findrunningclipanimatorsjob.cpp +++ b/src/animation/backend/findrunningclipanimatorsjob.cpp @@ -48,8 +48,9 @@ namespace Animation { FindRunningClipAnimatorsJob::FindRunningClipAnimatorsJob() : Qt3DCore::QAspectJob() + , m_handler(nullptr) { - SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0); + SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0) } void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector<HClipAnimator> &clipAnimatorHandles) diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp index a2630fc5e..a5127efd0 100644 --- a/src/animation/backend/gltfimporter.cpp +++ b/src/animation/backend/gltfimporter.cpp @@ -35,6 +35,9 @@ ****************************************************************************/ #include "gltfimporter_p.h" + +#include <Qt3DCore/private/qloadgltf_p.h> + #include <Qt3DAnimation/private/animationlogging_p.h> #include <Qt3DAnimation/private/fcurve_p.h> #include <Qt3DAnimation/private/keyframe_p.h> @@ -434,12 +437,7 @@ GLTFImporter::GLTFImporter() bool GLTFImporter::load(QIODevice *ioDev) { - QByteArray jsonData = ioDev->readAll(); - QJsonDocument sceneDocument = QJsonDocument::fromBinaryData(jsonData); - if (sceneDocument.isNull()) - sceneDocument = QJsonDocument::fromJson(jsonData); - - if (Q_UNLIKELY(!setJSON(sceneDocument))) { + if (Q_UNLIKELY(!setJSON(qLoadGLTF(ioDev->readAll())))) { qWarning("not a JSON document"); return false; } diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp index 977564c7f..93d4c2d9d 100644 --- a/src/animation/backend/loadanimationclipjob.cpp +++ b/src/animation/backend/loadanimationclipjob.cpp @@ -64,6 +64,7 @@ public: LoadAnimationClipJob::LoadAnimationClipJob() : Qt3DCore::QAspectJob(*new LoadAnimationClipJobPrivate) , m_animationClipHandles() + , m_handler(nullptr) { SET_JOB_RUN_STAT_TYPE(this, JobTypes::LoadAnimationClip, 0) } diff --git a/src/animation/backend/skeleton.cpp b/src/animation/backend/skeleton.cpp index 60e436a71..3788fd0f1 100644 --- a/src/animation/backend/skeleton.cpp +++ b/src/animation/backend/skeleton.cpp @@ -35,7 +35,6 @@ ****************************************************************************/ #include "skeleton_p.h" -#include <Qt3DCore/qpropertyupdatedchange.h> #include <Qt3DCore/private/qabstractskeleton_p.h> QT_BEGIN_NAMESPACE diff --git a/src/animation/frontend/qabstractanimationclip.cpp b/src/animation/frontend/qabstractanimationclip.cpp index e662a1408..08133072c 100644 --- a/src/animation/frontend/qabstractanimationclip.cpp +++ b/src/animation/frontend/qabstractanimationclip.cpp @@ -36,7 +36,6 @@ #include "qabstractanimationclip.h" #include "qabstractanimationclip_p.h" -#include <Qt3DCore/qpropertyupdatedchange.h> QT_BEGIN_NAMESPACE @@ -122,7 +121,7 @@ void QAbstractAnimationClipPrivate::setDuration(float duration) animator->setRunning(true); \endcode - \sa QAnimationClip, QAnimationClipLoader + \sa Qt3DAnimation::QAnimationClip, Qt3DAnimation::QAnimationClipLoader */ /*! @@ -134,6 +133,11 @@ QAbstractAnimationClip::QAbstractAnimationClip(QAbstractAnimationClipPrivate &dd { } +// TODO Unused remove in Qt6 +void QAbstractAnimationClip::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) +{ +} + /*! Destroys this animation clip. */ diff --git a/src/animation/frontend/qabstractanimationclip.h b/src/animation/frontend/qabstractanimationclip.h index f68950c4c..fddee3dec 100644 --- a/src/animation/frontend/qabstractanimationclip.h +++ b/src/animation/frontend/qabstractanimationclip.h @@ -62,7 +62,8 @@ Q_SIGNALS: protected: QAbstractAnimationClip(QAbstractAnimationClipPrivate &dd, Qt3DCore::QNode *parent = nullptr); - + // TODO Unused remove in Qt6 + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) override; private: Q_DECLARE_PRIVATE(QAbstractAnimationClip) }; diff --git a/src/animation/frontend/qabstractchannelmapping.cpp b/src/animation/frontend/qabstractchannelmapping.cpp index 3249e6876..599ec6ed7 100644 --- a/src/animation/frontend/qabstractchannelmapping.cpp +++ b/src/animation/frontend/qabstractchannelmapping.cpp @@ -46,6 +46,7 @@ namespace Qt3DAnimation { QAbstractChannelMappingPrivate::QAbstractChannelMappingPrivate() : Qt3DCore::QNodePrivate() + , m_mappingType(QChannelMappingCreatedChangeBase::ChannelMapping) { } diff --git a/src/animation/frontend/qabstractclipanimator.cpp b/src/animation/frontend/qabstractclipanimator.cpp index cb4621182..8c282da49 100644 --- a/src/animation/frontend/qabstractclipanimator.cpp +++ b/src/animation/frontend/qabstractclipanimator.cpp @@ -122,6 +122,11 @@ QAbstractClipAnimator::QAbstractClipAnimator(QAbstractClipAnimatorPrivate &dd, Q { } +// TODO Unused remove in Qt6 +void QAbstractClipAnimator::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) +{ +} + QAbstractClipAnimator::~QAbstractClipAnimator() { } diff --git a/src/animation/frontend/qabstractclipanimator.h b/src/animation/frontend/qabstractclipanimator.h index 687589b5e..dc9dc9077 100644 --- a/src/animation/frontend/qabstractclipanimator.h +++ b/src/animation/frontend/qabstractclipanimator.h @@ -94,6 +94,8 @@ protected: explicit QAbstractClipAnimator(Qt3DCore::QNode *parent = nullptr); QAbstractClipAnimator(QAbstractClipAnimatorPrivate &dd, Qt3DCore::QNode *parent = nullptr); + // TODO Unused remove in Qt6 + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) override; private: Q_DECLARE_PRIVATE(QAbstractClipAnimator) }; diff --git a/src/animation/frontend/qanimationcallback.qdoc b/src/animation/frontend/qanimationcallback.qdoc new file mode 100644 index 000000000..5c6e8e212 --- /dev/null +++ b/src/animation/frontend/qanimationcallback.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \class Qt3DAnimation::QAnimationCallback + \inmodule Qt3DAnimation + \brief Represents an animation callback object. +*/ + +/*! + \enum Qt3DAnimation::QAnimationCallback::Flag + + Flags to indicate how the valueChanged() function is called. + + \value OnOwningThread + Callback function is called on the owning (GUI or main) thread. + \value OnThreadPool + Callback function is called on the thread pool's worker thread. +*/ + +/*! + \fn Qt3DAnimation::QAnimationCallback::valueChanged(const QVariant &value) + + Callback function that is triggered for changes in the animated \a value. + + \sa QCallbackMapping::setCallback() +*/ diff --git a/src/animation/frontend/qanimationclip.cpp b/src/animation/frontend/qanimationclip.cpp index d624a246a..74a9b8371 100644 --- a/src/animation/frontend/qanimationclip.cpp +++ b/src/animation/frontend/qanimationclip.cpp @@ -51,8 +51,8 @@ QAnimationClipPrivate::QAnimationClipPrivate() } /*! - \class QAnimationClip - \inherits QAbstractAnimationClip + \class Qt3DAnimation::QAnimationClip + \inherits Qt3dAnimation::QAbstractAnimationClip \inmodule Qt3DAnimation \brief Specifies key frame animation data. */ diff --git a/src/animation/frontend/qanimationclipdata.cpp b/src/animation/frontend/qanimationclipdata.cpp index 49de71e79..e105b7b43 100644 --- a/src/animation/frontend/qanimationclipdata.cpp +++ b/src/animation/frontend/qanimationclipdata.cpp @@ -53,7 +53,7 @@ public: }; /*! - \class QAnimationClipData + \class Qt3DAnimation::QAnimationClipData \inmodule Qt3DAnimation \brief Class containing the animation data. */ diff --git a/src/animation/frontend/qanimationcliploader.cpp b/src/animation/frontend/qanimationcliploader.cpp index 446995b17..bf901e54f 100644 --- a/src/animation/frontend/qanimationcliploader.cpp +++ b/src/animation/frontend/qanimationcliploader.cpp @@ -36,7 +36,6 @@ #include "qanimationcliploader.h" #include "qanimationcliploader_p.h" -#include <Qt3DCore/qpropertyupdatedchange.h> QT_BEGIN_NAMESPACE @@ -113,6 +112,11 @@ QAnimationClipLoader::QAnimationClipLoader(QAnimationClipLoaderPrivate &dd, Qt3D { } +// TODO Unused remove in Qt6 +void QAnimationClipLoader::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &) +{ +} + QAnimationClipLoader::~QAnimationClipLoader() { } diff --git a/src/animation/frontend/qanimationcliploader.h b/src/animation/frontend/qanimationcliploader.h index 1ff388297..1b68e852f 100644 --- a/src/animation/frontend/qanimationcliploader.h +++ b/src/animation/frontend/qanimationcliploader.h @@ -78,6 +78,8 @@ Q_SIGNALS: protected: explicit QAnimationClipLoader(QAnimationClipLoaderPrivate &dd, Qt3DCore::QNode *parent = nullptr); + // TODO Unused remove in Qt6 + void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) override; private: Q_DECLARE_PRIVATE(QAnimationClipLoader) diff --git a/src/animation/frontend/qcallbackmapping.cpp b/src/animation/frontend/qcallbackmapping.cpp index 53f7a5e33..a86785012 100644 --- a/src/animation/frontend/qcallbackmapping.cpp +++ b/src/animation/frontend/qcallbackmapping.cpp @@ -51,13 +51,12 @@ QCallbackMappingPrivate::QCallbackMappingPrivate() , m_channelName() , m_type(static_cast<int>(QVariant::Invalid)) , m_callback(nullptr) - , m_callbackFlags(0) { m_mappingType = QChannelMappingCreatedChangeBase::CallbackMapping; } /*! - \class QCallbackMapping + \class Qt3DAnimation::QCallbackMapping \inherits Qt3DCore::QAbstractChannelMapping \inmodule Qt3DAnimation \brief Allows to map the channels within the clip onto an invocation diff --git a/src/animation/frontend/qchannel.cpp b/src/animation/frontend/qchannel.cpp index eab7f0df4..1e0da3c3f 100644 --- a/src/animation/frontend/qchannel.cpp +++ b/src/animation/frontend/qchannel.cpp @@ -54,7 +54,7 @@ public: }; /*! - \class QChannel + \class Qt3DAnimation::QChannel \inmodule Qt3DAnimation \brief Defines a channel for a QAnimationClipData. The animation system interpolates each channel component independently diff --git a/src/animation/frontend/qchannelmapper.cpp b/src/animation/frontend/qchannelmapper.cpp index ab98039b4..c5909adbc 100644 --- a/src/animation/frontend/qchannelmapper.cpp +++ b/src/animation/frontend/qchannelmapper.cpp @@ -49,7 +49,7 @@ QChannelMapperPrivate::QChannelMapperPrivate() } /*! - \class QChannelMapper + \class Qt3DAnimation::QChannelMapper \inmodule Qt3DAnimation \brief Allows to map the channels within the clip onto properties of objects in the application. diff --git a/src/animation/frontend/qchannelmapping.cpp b/src/animation/frontend/qchannelmapping.cpp index 59620ab49..16651afe6 100644 --- a/src/animation/frontend/qchannelmapping.cpp +++ b/src/animation/frontend/qchannelmapping.cpp @@ -161,7 +161,7 @@ void QChannelMappingPrivate::updatePropertyNameTypeAndComponentCount() } /*! - \class QChannelMapping + \class Qt3DAnimation::QChannelMapping \inherits Qt3DCore::QNode \inmodule Qt3DAnimation \brief Allows to map the channels within the clip onto properties of diff --git a/src/animation/frontend/qclipanimator.cpp b/src/animation/frontend/qclipanimator.cpp index 03510aa93..ffad588c1 100644 --- a/src/animation/frontend/qclipanimator.cpp +++ b/src/animation/frontend/qclipanimator.cpp @@ -107,7 +107,8 @@ bool QClipAnimatorPrivate::canPlay() const The properties for controlling the animator are provided by the QAbstractClipAnimator base class. - \sa QAbstractClipAnimator, QAbstractAnimationClip, QChannelMapper, QBlendedClipAnimator + \sa Qt3DAnimation::QAbstractClipAnimator, Qt3DAnimation::QAbstractAnimationClip, + Qt3DAnimation::QChannelMapper, Qt3DAnimation::QBlendedClipAnimator */ QClipAnimator::QClipAnimator(Qt3DCore::QNode *parent) diff --git a/src/animation/frontend/qclipblendvalue.cpp b/src/animation/frontend/qclipblendvalue.cpp index 72a7dd796..053453e33 100644 --- a/src/animation/frontend/qclipblendvalue.cpp +++ b/src/animation/frontend/qclipblendvalue.cpp @@ -53,14 +53,14 @@ QClipBlendValuePrivate::QClipBlendValuePrivate() } /*! - \class QClipBlendValue + \class Qt3DAnimation::QClipBlendValue \inherits Qt3DAnimation::QAbstractClipBlendNode \inmodule Qt3DAnimation \brief Class used for including a clip in a blend tree. */ /*! \qmltype ClipBlendValue - \instantiates QClipBlendValue + \instantiates Qt3DAnimation::QClipBlendValue \inqmlmodule Qt3D.Animation \brief Type used for including a clip in a blend tree. */ diff --git a/src/animation/frontend/qmorphtarget.cpp b/src/animation/frontend/qmorphtarget.cpp index 76b1a598e..da068d477 100644 --- a/src/animation/frontend/qmorphtarget.cpp +++ b/src/animation/frontend/qmorphtarget.cpp @@ -86,8 +86,8 @@ namespace Qt3DAnimation { */ /*! \qmlmethod MorphTarget Qt3D.Animation::MorphTarget::fromGeometry(geometry, stringList) - Returns a morph target based on the attributes defined by the given stringList from - the given geometry. + Returns a morph target based on the attributes defined by the given \a stringList from + the given \a geometry. */ QMorphTargetPrivate::QMorphTargetPrivate() diff --git a/src/animation/frontend/qvertexblendanimation.cpp b/src/animation/frontend/qvertexblendanimation.cpp index 25468d4a7..143b9553a 100644 --- a/src/animation/frontend/qvertexblendanimation.cpp +++ b/src/animation/frontend/qvertexblendanimation.cpp @@ -192,8 +192,8 @@ void QVertexBlendAnimationPrivate::updateAnimation(float position) Qt3DRender::QGeometry *geometry = m_target->geometry(); // remove attributes from previous frame - if ((m_currentBase && (base != m_currentBase)) - || (m_currentTarget && (target != m_currentTarget))) { + if (m_currentBase && m_currentTarget && + (base != m_currentBase || target != m_currentTarget)) { const QVector<Qt3DRender::QAttribute *> baseAttributes = m_currentBase->attributeList(); const QVector<Qt3DRender::QAttribute *> targetAttributes = m_currentTarget->attributeList(); for (int i = 0; i < baseAttributes.size(); ++i) { |