summaryrefslogtreecommitdiffstats
path: root/src/animation/backend/animationclip_p.h
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2017-08-02 22:50:58 +0200
committerWieland Hagen <wieland.hagen@kdab.com>2017-09-08 11:53:24 +0000
commitcef1c7fe3c650f6fad4760230d3cf7052ed70253 (patch)
tree7275017003db416aa57dc253cb727ce2962c34c1 /src/animation/backend/animationclip_p.h
parentcc815a6146c9397539d5a639f29004a5aaeb6a5b (diff)
Re-build Blend-Trees when Clips have been loaded
We need to notify the BlendedClipAnimators, when any of the clips it depends on have been loaded. So we register each animator at the clips that it depends on, mark the animator dirty when the clip has been loaded and thus trigger a re-run of the BuildBlendTreesJob. Make sure to guard accesses to the Handler via mutexes, because backend objects can be marked dirty from various threads. Task-number: QTBUG-61941 Change-Id: I4890d0d76d3118538537252f920d9477bed8f934 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/animation/backend/animationclip_p.h')
-rw-r--r--src/animation/backend/animationclip_p.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/animation/backend/animationclip_p.h b/src/animation/backend/animationclip_p.h
index 7ff79c01a..7570c76ce 100644
--- a/src/animation/backend/animationclip_p.h
+++ b/src/animation/backend/animationclip_p.h
@@ -53,6 +53,7 @@
#include <Qt3DAnimation/qanimationcliploader.h>
#include <Qt3DAnimation/private/fcurve_p.h>
#include <QtCore/qurl.h>
+#include <QtCore/qmutex.h>
QT_BEGIN_NAMESPACE
@@ -73,6 +74,9 @@ public:
QAnimationClipLoader::Status status() const { return m_status; }
void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) Q_DECL_OVERRIDE;
+ void addDependingClipAnimator(const Qt3DCore::QNodeId &id);
+ void addDependingBlendedClipAnimator(const Qt3DCore::QNodeId &id);
+
QString name() const { return m_name; }
const QVector<Channel> &channels() const { return m_channels; }
@@ -106,6 +110,8 @@ private:
float findDuration();
int findChannelComponentCount();
+ QMutex m_mutex;
+
QUrl m_source;
QAnimationClipLoader::Status m_status;
QAnimationClipData m_clipData;
@@ -115,6 +121,9 @@ private:
QVector<Channel> m_channels;
float m_duration;
int m_channelComponentCount;
+
+ Qt3DCore::QNodeIdVector m_dependingAnimators;
+ Qt3DCore::QNodeIdVector m_dependingBlendedAnimators;
};
#ifndef QT_NO_DEBUG_STREAM