summaryrefslogtreecommitdiffstats
path: root/src/animation/backend/clipanimator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation/backend/clipanimator.cpp')
-rw-r--r--src/animation/backend/clipanimator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/animation/backend/clipanimator.cpp b/src/animation/backend/clipanimator.cpp
index ea31698d0..9a5cce2e2 100644
--- a/src/animation/backend/clipanimator.cpp
+++ b/src/animation/backend/clipanimator.cpp
@@ -53,6 +53,7 @@ ClipAnimator::ClipAnimator()
: BackendNode(ReadWrite)
, m_clipId()
, m_mapperId()
+ , m_clockId()
, m_running(false)
, m_loops(1)
, m_startGlobalTime(0)
@@ -67,6 +68,7 @@ void ClipAnimator::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr
const auto &data = typedChange->data;
m_clipId = data.clipId;
m_mapperId = data.mapperId;
+ m_clockId = data.clockId;
m_running = data.running;
m_loops = data.loops;
setDirty(Handler::ClipAnimatorDirty);
@@ -84,6 +86,12 @@ void ClipAnimator::setMapperId(Qt3DCore::QNodeId mapperId)
setDirty(Handler::ClipAnimatorDirty);
}
+void ClipAnimator::setClockId(Qt3DCore::QNodeId clockId)
+{
+ m_clockId = clockId;
+ setDirty(Handler::ClipAnimatorDirty);
+}
+
void ClipAnimator::setRunning(bool running)
{
m_running = running;
@@ -98,6 +106,7 @@ void ClipAnimator::cleanup()
m_handler = nullptr;
m_clipId = Qt3DCore::QNodeId();
m_mapperId = Qt3DCore::QNodeId();
+ m_clockId = Qt3DCore::QNodeId();
m_running = false;
m_loops = 1;
}
@@ -111,6 +120,8 @@ void ClipAnimator::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
setClipId(change->value().value<Qt3DCore::QNodeId>());
else if (change->propertyName() == QByteArrayLiteral("channelMapper"))
setMapperId(change->value().value<Qt3DCore::QNodeId>());
+ else if (change->propertyName() == QByteArrayLiteral("clock"))
+ setClockId(change->value().value<Qt3DCore::QNodeId>());
else if (change->propertyName() == QByteArrayLiteral("running"))
setRunning(change->value().toBool());
else if (change->propertyName() == QByteArrayLiteral("loops"))