summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-12-13 13:17:14 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-12-13 13:17:18 +0100
commit2ff27c75ed79f3c2fe5cd4c933011593312e962c (patch)
tree0960924e6589d0ff915e3049c4e6d28bf7e2cc0a /src
parent5caa5b0519e4d1e1dc8bacc600d1dea644cd4a99 (diff)
parent8cdb99c910f2f57972b652c3fb8d520ba615f110 (diff)
Merge remote-tracking branch 'origin/2.2'
Diffstat (limited to 'src')
-rw-r--r--src/imports/studio3d/q3dsstudio3ditem.cpp2
-rw-r--r--src/imports/studio3d/q3dsstudio3drenderer.cpp6
-rw-r--r--src/runtime/api/q3dspresentation.cpp35
-rw-r--r--src/runtime/api/q3dspresentation.h5
-rw-r--r--src/runtime/api/q3dspresentation_p.h4
-rw-r--r--src/runtime/api/q3dssurfaceviewer.cpp2
-rw-r--r--src/runtime/api/q3dsviewersettings.cpp4
-rw-r--r--src/runtime/api/q3dswidget.cpp2
-rw-r--r--src/runtime/doc/style/qt5-sidebar.html2
-rw-r--r--src/runtime/dragon/dragongraphicsutils_p.h1
-rw-r--r--src/runtime/dragon/dragonmutable_p.h1
-rw-r--r--src/runtime/dragon/dragonoffscreensurfacehelper.cpp3
-rw-r--r--src/runtime/dragon/dragonrenderer.cpp22
-rw-r--r--src/runtime/dragon/dragonrenderer_p.h2
-rw-r--r--src/runtime/dragon/dragontask_p.h3
-rw-r--r--src/runtime/dragon/geometry/dragonattribute.cpp1
-rw-r--r--src/runtime/dragon/jobs/dragonrenderviewjobs.cpp3
-rw-r--r--src/runtime/dragon/jobs/dragontransformjobs.cpp4
-rw-r--r--src/runtime/dragon/materialsystem/dragontechnique.cpp1
-rw-r--r--src/runtime/dragon/qdragonrenderaspect.cpp12
-rw-r--r--src/runtime/dragon/qdragonrenderaspect_p.h2
-rw-r--r--src/runtime/dragon/renderer/dragonuniform_p.h1
-rw-r--r--src/runtime/dragon/renderstates/dragonrenderstateset.cpp1
-rw-r--r--src/runtime/q3dsanimationmanager.cpp9
-rw-r--r--src/runtime/q3dsanimationmanager_p.h4
-rw-r--r--src/runtime/q3dsengine.cpp5
-rw-r--r--src/runtime/q3dsscenemanager.cpp2
-rw-r--r--src/runtime/q3dsslideplayer.cpp2
28 files changed, 73 insertions, 68 deletions
diff --git a/src/imports/studio3d/q3dsstudio3ditem.cpp b/src/imports/studio3d/q3dsstudio3ditem.cpp
index b4652e2..e5d94bb 100644
--- a/src/imports/studio3d/q3dsstudio3ditem.cpp
+++ b/src/imports/studio3d/q3dsstudio3ditem.cpp
@@ -427,7 +427,7 @@ void Q3DSStudio3DItem::createEngine()
if (m_sourceFlags.testFlag(Q3DSPresentationController::Profiling))
flags |= Q3DSEngine::EnableProfiling;
- if (m_sourceFlags.testFlag(Q3DSPresentationController::AwakenTheDragon))
+ if (qEnvironmentVariableIntValue("Q3DS_DRAGON"))
flags |= Q3DSEngine::AwakenTheDragon;
m_engine->setFlags(flags);
diff --git a/src/imports/studio3d/q3dsstudio3drenderer.cpp b/src/imports/studio3d/q3dsstudio3drenderer.cpp
index 6d6a6de..44270e6 100644
--- a/src/imports/studio3d/q3dsstudio3drenderer.cpp
+++ b/src/imports/studio3d/q3dsstudio3drenderer.cpp
@@ -113,6 +113,12 @@ Q3DSStudio3DRenderer::~Q3DSStudio3DRenderer()
if (m_renderAspectD != nullptr)
m_renderAspectD->renderShutdown();
+
+ if (m_dragonRenderAspect != nullptr) {
+ m_dragonRenderAspect->beginRenderShutdown();
+ m_currentFrame = Qt3DRender::Dragon::Renderer::Frame();
+ m_dragonRenderAspect->endRenderShutdown();
+ }
}
void Q3DSStudio3DRenderer::invalidateItem()
diff --git a/src/runtime/api/q3dspresentation.cpp b/src/runtime/api/q3dspresentation.cpp
index db2f77a..102f714 100644
--- a/src/runtime/api/q3dspresentation.cpp
+++ b/src/runtime/api/q3dspresentation.cpp
@@ -169,38 +169,6 @@ void Q3DSPresentation::setProfilingEnabled(bool enable)
}
/*!
- \property Q3DSPresentation::dragonRenderAspectEnabled
-
- When enabled, the new, experimental Qt3D render aspect
- (codenamed "Dragon") is enabled.
- This render aspect will replace the original render aspect
- in a future release.
- This property will be deprecated once the aspect has been
- replaced.
-
- The default value is \c false.
-
- \note Changing the value after the presentation has been loaded
- has no effect for the already loaded presentation. Therefore the
- changing of this property must happen before calling setSource().
-*/
-bool Q3DSPresentation::isDragonRenderAspectEnabled() const
-{
- Q_D(const Q3DSPresentation);
- return d->dragonRenderAspectEnabled;
-}
-
-void Q3DSPresentation::setDragonRenderAspectEnabled(bool dragonRenderAspectEnabled)
-{
- Q_D(Q3DSPresentation);
- if (d->dragonRenderAspectEnabled == dragonRenderAspectEnabled)
- return;
-
- d->dragonRenderAspectEnabled = dragonRenderAspectEnabled;
- emit dragonRenderAspectEnabledChanged();
-}
-
-/*!
\property Q3DSPresentation::profileUiVisible
When this property is \c{true}, the interactive statistics and profile
@@ -665,9 +633,6 @@ Q3DSPresentationController::SourceFlags Q3DSPresentationPrivate::sourceFlags() c
if (profiling)
flags |= Q3DSPresentationController::Profiling;
- if (dragonRenderAspectEnabled)
- flags |= Q3DSPresentationController::AwakenTheDragon;
-
return flags;
}
diff --git a/src/runtime/api/q3dspresentation.h b/src/runtime/api/q3dspresentation.h
index 3ee3aaf..a04a226 100644
--- a/src/runtime/api/q3dspresentation.h
+++ b/src/runtime/api/q3dspresentation.h
@@ -57,7 +57,6 @@ class Q3DSV_EXPORT Q3DSPresentation : public QObject
Q_PROPERTY(bool profilingEnabled READ isProfilingEnabled WRITE setProfilingEnabled NOTIFY profilingEnabledChanged)
Q_PROPERTY(bool profileUiVisible READ isProfileUiVisible WRITE setProfileUiVisible NOTIFY profileUiVisibleChanged)
Q_PROPERTY(float profileUiScale READ profileUiScale WRITE setProfileUiScale NOTIFY profileUiScaleChanged)
- Q_PROPERTY(bool dragonRenderAspectEnabled READ isDragonRenderAspectEnabled WRITE setDragonRenderAspectEnabled NOTIFY dragonRenderAspectEnabledChanged)
public:
explicit Q3DSPresentation(QObject *parent = nullptr);
@@ -75,9 +74,6 @@ public:
float profileUiScale() const;
void setProfileUiScale(float scale);
- bool isDragonRenderAspectEnabled() const;
- void setDragonRenderAspectEnabled(bool dragonRenderAspectEnabled);
-
Q_INVOKABLE void reload();
Q_INVOKABLE void setDataInputValue(const QString &name, const QVariant &value);
@@ -116,7 +112,6 @@ Q_SIGNALS:
void customSignalEmitted(const QString &elementPath, const QString &name);
void slideEntered(const QString &elementPath, int index, const QString &name);
void slideExited(const QString &elementPath, int index, const QString &name);
- void dragonRenderAspectEnabledChanged();
protected:
Q3DSPresentation(Q3DSPresentationPrivate &dd, QObject *parent);
diff --git a/src/runtime/api/q3dspresentation_p.h b/src/runtime/api/q3dspresentation_p.h
index 56859a5..eab60dd 100644
--- a/src/runtime/api/q3dspresentation_p.h
+++ b/src/runtime/api/q3dspresentation_p.h
@@ -59,8 +59,7 @@ public:
void initializePresentationController(Q3DSEngine *engine, Q3DSPresentation *presentation);
enum SourceFlag {
- Profiling = 0x01,
- AwakenTheDragon = 0x02
+ Profiling = 0x01
};
Q_DECLARE_FLAGS(SourceFlags, SourceFlag)
@@ -122,7 +121,6 @@ public:
bool profileUiVisible = false;
float profileUiScale = 1.0f;
QVector<Q3DSInlineQmlSubPresentation *> inlineQmlSubPresentations;
- bool dragonRenderAspectEnabled = false;
};
QT_END_NAMESPACE
diff --git a/src/runtime/api/q3dssurfaceviewer.cpp b/src/runtime/api/q3dssurfaceviewer.cpp
index 4a759cc..60bc162 100644
--- a/src/runtime/api/q3dssurfaceviewer.cpp
+++ b/src/runtime/api/q3dssurfaceviewer.cpp
@@ -501,7 +501,7 @@ bool Q3DSSurfaceViewerPrivate::createEngine()
Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect;
if (sourceFlags.testFlag(Q3DSPresentationController::Profiling))
flags |= Q3DSEngine::EnableProfiling;
- if (sourceFlags.testFlag(Q3DSPresentationController::AwakenTheDragon))
+ if (qEnvironmentVariableIntValue("Q3DS_DRAGON"))
flags |= Q3DSEngine::AwakenTheDragon;
engine->setFlags(flags);
diff --git a/src/runtime/api/q3dsviewersettings.cpp b/src/runtime/api/q3dsviewersettings.cpp
index 5d30414..22297e9 100644
--- a/src/runtime/api/q3dsviewersettings.cpp
+++ b/src/runtime/api/q3dsviewersettings.cpp
@@ -313,6 +313,10 @@ void Q3DSViewerSettings::load(const QString &group,
Q3DSViewportSettings *Q3DSViewerSettingsPrivate::createViewportSettingsProxy()
{
Q_Q(Q3DSViewerSettings);
+
+ // Cleanup connections if recreating
+ q->disconnect();
+
Q3DSViewportSettings *vp = new Q3DSViewportSettings(q);
vp->setShowRenderStats(q->isShowingRenderStats());
QObject::connect(q, &Q3DSViewerSettings::showRenderStatsChanged, q, [vp, q] {
diff --git a/src/runtime/api/q3dswidget.cpp b/src/runtime/api/q3dswidget.cpp
index 6eded69..352218b 100644
--- a/src/runtime/api/q3dswidget.cpp
+++ b/src/runtime/api/q3dswidget.cpp
@@ -354,7 +354,7 @@ void Q3DSWidgetPrivate::createEngine()
Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect;
if (sourceFlags.testFlag(Q3DSPresentationController::Profiling))
flags |= Q3DSEngine::EnableProfiling;
- if (sourceFlags.testFlag(Q3DSPresentationController::AwakenTheDragon))
+ if (qEnvironmentVariableIntValue("Q3DS_DRAGON"))
flags |= Q3DSEngine::AwakenTheDragon;
engine->setFlags(flags);
diff --git a/src/runtime/doc/style/qt5-sidebar.html b/src/runtime/doc/style/qt5-sidebar.html
index 53a2bbe..4c1c3e7 100644
--- a/src/runtime/doc/style/qt5-sidebar.html
+++ b/src/runtime/doc/style/qt5-sidebar.html
@@ -10,7 +10,7 @@
<li><a href="qt3d-runtime-qml.html">QML API Reference</a></li>
<li><a href="qt3d-runtime-cpp.html">C++ API Reference</a></li>
<li><a href="qt3d-runtime-attribute-names.html">Scene Object Attributes</a></li>
- <li><a href="qt3d-runtime-examples-examples.html">Examples</a></li>
+ <li><a href="qt3d-runtime-examples.html">Examples</a></li>
<li><a href="copyright-notices.html">Copyright Notices</a></li>
</ul>
</div>
diff --git a/src/runtime/dragon/dragongraphicsutils_p.h b/src/runtime/dragon/dragongraphicsutils_p.h
index 444a924..dd26d5f 100644
--- a/src/runtime/dragon/dragongraphicsutils_p.h
+++ b/src/runtime/dragon/dragongraphicsutils_p.h
@@ -111,7 +111,6 @@ public:
}
case QMetaType::UInt: {
- qDebug() << "UINT";
T data = v.value<uint>();
memcpy(array.data(), &data, byteSize);
break;
diff --git a/src/runtime/dragon/dragonmutable_p.h b/src/runtime/dragon/dragonmutable_p.h
index 6d18b8c..15f606f 100644
--- a/src/runtime/dragon/dragonmutable_p.h
+++ b/src/runtime/dragon/dragonmutable_p.h
@@ -45,7 +45,6 @@
#include <sstream>
#include <memory>
#include <type_traits>
-#include <QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/runtime/dragon/dragonoffscreensurfacehelper.cpp b/src/runtime/dragon/dragonoffscreensurfacehelper.cpp
index 9bdcc6c..cbcae62 100644
--- a/src/runtime/dragon/dragonoffscreensurfacehelper.cpp
+++ b/src/runtime/dragon/dragonoffscreensurfacehelper.cpp
@@ -32,8 +32,6 @@
#include <private/dragonrenderer_p.h>
-#include <QDebug>
-
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
@@ -48,7 +46,6 @@ OffscreenSurfaceHelper::OffscreenSurfaceHelper(Renderer *renderer, QObject *pare
void OffscreenSurfaceHelper::createOffscreenSurface()
{
- qDebug() << "CREATE OFFSCREEN";
m_offscreenSurface = new QOffscreenSurface;
m_offscreenSurface->setParent(this);
m_offscreenSurface->setFormat(m_renderer->openGLContext()->format());
diff --git a/src/runtime/dragon/dragonrenderer.cpp b/src/runtime/dragon/dragonrenderer.cpp
index 0745858..4b0301d 100644
--- a/src/runtime/dragon/dragonrenderer.cpp
+++ b/src/runtime/dragon/dragonrenderer.cpp
@@ -696,6 +696,28 @@ Renderer::Frame Renderer::doRender(Renderer::Frame frame)
return frame;
}
+void Renderer::beginShutdown()
+{
+ QMutexLocker lock(&m_latestDataMutex);
+
+ m_running.store(0);
+ m_latestData.clear();
+ nextFrameSemaphore.release();
+
+ if (m_renderThread) {
+ m_renderThread->wait();
+ } else {
+ Q_ASSERT(m_offscreenHelper->offscreenSurface());
+ m_glContext->makeCurrent(m_offscreenHelper->offscreenSurface());
+ }
+}
+
+void Renderer::endShutdown()
+{
+ if (!m_renderThread)
+ m_glContext->doneCurrent();
+}
+
RenderThread::RenderThread(Renderer *renderer)
: QThread()
, m_renderer(renderer)
diff --git a/src/runtime/dragon/dragonrenderer_p.h b/src/runtime/dragon/dragonrenderer_p.h
index 446fef7..af8e31a 100644
--- a/src/runtime/dragon/dragonrenderer_p.h
+++ b/src/runtime/dragon/dragonrenderer_p.h
@@ -171,6 +171,8 @@ public:
QOpenGLContext *openGLContext();
+ void beginShutdown();
+ void endShutdown();
private:
// Render thread
QScopedPointer<RenderThread> m_renderThread;
diff --git a/src/runtime/dragon/dragontask_p.h b/src/runtime/dragon/dragontask_p.h
index 4b89285..35c38e4 100644
--- a/src/runtime/dragon/dragontask_p.h
+++ b/src/runtime/dragon/dragontask_p.h
@@ -42,7 +42,6 @@
// We mean it.
//
-#include <QDebug>
#include <QSharedPointer>
#include <Qt3DCore/QAspectJob>
#include <functional>
@@ -208,7 +207,7 @@ struct Task : public Qt3DCore::QAspectJob
m_isFinished = true;
}
- Output result()
+ const Output &result()
{
Q_ASSERT(m_isFinished);
return m_result;
diff --git a/src/runtime/dragon/geometry/dragonattribute.cpp b/src/runtime/dragon/geometry/dragonattribute.cpp
index a0e9163..e801866 100644
--- a/src/runtime/dragon/geometry/dragonattribute.cpp
+++ b/src/runtime/dragon/geometry/dragonattribute.cpp
@@ -96,7 +96,6 @@ void Attribute::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &ch
void Attribute::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
{
-// qDebug() << "CHANGE!";
switch (e->type()) {
case PropertyUpdated: {
QPropertyUpdatedChangePtr propertyChange = qSharedPointerCast<QPropertyUpdatedChange>(e);
diff --git a/src/runtime/dragon/jobs/dragonrenderviewjobs.cpp b/src/runtime/dragon/jobs/dragonrenderviewjobs.cpp
index 93c602b..457ec37 100644
--- a/src/runtime/dragon/jobs/dragonrenderviewjobs.cpp
+++ b/src/runtime/dragon/jobs/dragonrenderviewjobs.cpp
@@ -807,6 +807,9 @@ RenderCommands buildDrawRenderCommands(RenderCommands renderCommands,
|| renderStates.anythingDirty()
|| gatheredParameters.anythingDirty();
+ if (!needsRebuild)
+ return renderCommands;
+
auto commandsForView = [=](const QNodeId &id, const Immutable<RenderView> &renderView) {
RenderViewCommands result;
result.renderView = renderView;
diff --git a/src/runtime/dragon/jobs/dragontransformjobs.cpp b/src/runtime/dragon/jobs/dragontransformjobs.cpp
index 54ea226..ba71dbb 100644
--- a/src/runtime/dragon/jobs/dragontransformjobs.cpp
+++ b/src/runtime/dragon/jobs/dragontransformjobs.cpp
@@ -93,7 +93,9 @@ ValueContainer<Matrix4x4> calculateWorldTransforms(ValueContainer<Matrix4x4> wor
bool rootDirty = entities.anythingDirty();
const auto &rootEntity = entities[rootEntityId];
- if (!rootEntity->m_transformComponent.isNull()) {
+ if (rootEntity->m_transformComponent.isNull()) {
+ worldTransforms[rootEntityId] = Matrix4x4{};
+ } else {
const auto &transform = transforms[rootEntity->m_transformComponent];
if (transforms.dirty().contains(rootEntity->m_transformComponent))
rootDirty = true;
diff --git a/src/runtime/dragon/materialsystem/dragontechnique.cpp b/src/runtime/dragon/materialsystem/dragontechnique.cpp
index a29516d..aa77212 100644
--- a/src/runtime/dragon/materialsystem/dragontechnique.cpp
+++ b/src/runtime/dragon/materialsystem/dragontechnique.cpp
@@ -196,7 +196,6 @@ GraphicsApiFilterData Technique::graphicsApiFilter() const
void Technique::appendFilterKey(Qt3DCore::QNodeId criterionId)
{
- qDebug() << "APPENDED FILTER KEY";
if (!m_filterKeyList.contains(criterionId))
m_filterKeyList.append(criterionId);
}
diff --git a/src/runtime/dragon/qdragonrenderaspect.cpp b/src/runtime/dragon/qdragonrenderaspect.cpp
index 34d4ba3..c087ed7 100644
--- a/src/runtime/dragon/qdragonrenderaspect.cpp
+++ b/src/runtime/dragon/qdragonrenderaspect.cpp
@@ -191,6 +191,8 @@ namespace Dragon {
QDragonRenderAspect::QDragonRenderAspect(Renderer::RenderType renderType)
: m_renderer(new Renderer(renderType))
{
+ qDebug() << "Dragon render aspect enabled";
+
registerBackendType<Qt3DCore::QEntity>(m_entities);
registerBackendType<Qt3DCore::QTransform>(m_transforms);
registerBackendType<QAbstractTexture>(m_textures);
@@ -528,6 +530,16 @@ void QDragonRenderAspect::initialize(QOpenGLContext *context)
m_renderer->initialize(context);
}
+void QDragonRenderAspect::beginRenderShutdown()
+{
+ m_renderer->beginShutdown();
+}
+
+void QDragonRenderAspect::endRenderShutdown()
+{
+ m_renderer->endShutdown();
+}
+
} // namespace Dragon
} // namespace Qt3DRender
QT_END_NAMESPACE
diff --git a/src/runtime/dragon/qdragonrenderaspect_p.h b/src/runtime/dragon/qdragonrenderaspect_p.h
index 6550857..b660823 100644
--- a/src/runtime/dragon/qdragonrenderaspect_p.h
+++ b/src/runtime/dragon/qdragonrenderaspect_p.h
@@ -118,6 +118,8 @@ public:
Renderer::Frame renderSynchronous(Renderer::Frame frame);
void initialize(QOpenGLContext *context);
+ void endRenderShutdown();
+ void beginRenderShutdown();
private:
QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time) override;
diff --git a/src/runtime/dragon/renderer/dragonuniform_p.h b/src/runtime/dragon/renderer/dragonuniform_p.h
index f2f80d2..8c7ed9c 100644
--- a/src/runtime/dragon/renderer/dragonuniform_p.h
+++ b/src/runtime/dragon/renderer/dragonuniform_p.h
@@ -53,7 +53,6 @@
#include <QVector3D>
#include <QColor>
-#include <QDebug>
#include <string.h>
QT_BEGIN_NAMESPACE
diff --git a/src/runtime/dragon/renderstates/dragonrenderstateset.cpp b/src/runtime/dragon/renderstates/dragonrenderstateset.cpp
index 92a210d..f2af518 100644
--- a/src/runtime/dragon/renderstates/dragonrenderstateset.cpp
+++ b/src/runtime/dragon/renderstates/dragonrenderstateset.cpp
@@ -32,7 +32,6 @@
#include <bitset>
-#include <QDebug>
#include <QOpenGLContext>
QT_BEGIN_NAMESPACE
diff --git a/src/runtime/q3dsanimationmanager.cpp b/src/runtime/q3dsanimationmanager.cpp
index 51a6c73..cdb6e5e 100644
--- a/src/runtime/q3dsanimationmanager.cpp
+++ b/src/runtime/q3dsanimationmanager.cpp
@@ -121,7 +121,8 @@ static int componentSuffixToIndex(const QString &s)
void Q3DSAnimationManager::updateAnimationHelper(const AnimationTrackListMap &targets,
Q3DSSlide *slide,
- bool editorMode)
+ bool editorMode,
+ bool updateDkf)
{
// QT3DS-2183: We'll use this to set dummy kf at the start and end of the clip.
// See code further down.
@@ -339,7 +340,7 @@ void Q3DSAnimationManager::updateAnimationHelper(const AnimationTrackListMap &ta
const bool isDynamic = animationTrack->isDynamic() && !editorMode;
// If track is marked as dynamic, update the first keyframe so it interpolates from
// the current position to the next.
- if (isDynamic)
+ if (isDynamic && updateDkf)
updateDynamicKeyFrame(keyFrames[0], target, prop);
// QT3DS-2183 - We add keyframes at the start and at the end of the clip
@@ -509,7 +510,7 @@ static void insertTrack(Q3DSAnimationManager::AnimationTrackList &trackList,
}
}
-void Q3DSAnimationManager::updateAnimations(Q3DSSlide *slide, bool editorMode)
+void Q3DSAnimationManager::updateAnimations(Q3DSSlide *slide, bool editorMode, bool updateDynamicKfs)
{
Q_ASSERT(slide);
@@ -544,7 +545,7 @@ void Q3DSAnimationManager::updateAnimations(Q3DSSlide *slide, bool editorMode)
buildTrackListMap(masterSlide, false);
buildTrackListMap(slide, true);
- updateAnimationHelper(trackListMap, slide, editorMode);
+ updateAnimationHelper(trackListMap, slide, editorMode, updateDynamicKfs);
}
void Q3DSAnimationManager::applyChanges()
diff --git a/src/runtime/q3dsanimationmanager_p.h b/src/runtime/q3dsanimationmanager_p.h
index f376be7..d7bb6ab 100644
--- a/src/runtime/q3dsanimationmanager_p.h
+++ b/src/runtime/q3dsanimationmanager_p.h
@@ -55,7 +55,7 @@ public:
using AnimationTrackList = QVector<const Q3DSAnimationTrack *>;
using AnimationTrackListMap = QHash<Q3DSGraphObject *, AnimationTrackList>;
- void updateAnimations(Q3DSSlide *slide, bool editorMode = false);
+ void updateAnimations(Q3DSSlide *slide, bool editorMode = false, bool updateDynamicKfs = true);
void clearAnimations(Q3DSSlide *slide);
void applyChanges();
void clearPendingChanges();
@@ -68,7 +68,7 @@ public:
private:
void updateAnimationHelper(const AnimationTrackListMap &targets,
Q3DSSlide *slide,
- bool editorMode);
+ bool editorMode, bool updateDkf);
void buildClipAnimator(Q3DSSlide *slide);
diff --git a/src/runtime/q3dsengine.cpp b/src/runtime/q3dsengine.cpp
index 6bb87b5..875e422 100644
--- a/src/runtime/q3dsengine.cpp
+++ b/src/runtime/q3dsengine.cpp
@@ -1149,6 +1149,9 @@ void Q3DSEngine::prepareForReload()
destroyBehaviorHandle(h);
m_behaviorHandles.clear();
+ // Disconnect previously loaded signals
+ QObject::disconnect(this, &Q3DSEngine::stereoModeChanged, 0, 0);
+
if (!m_uipPresentations.isEmpty()) {
for (UipPresentation &pres : m_uipPresentations) {
if (pres.sceneManager)
@@ -1228,6 +1231,8 @@ void Q3DSEngine::setViewportSettings(Q3DSViewportSettings *viewportSettings)
if (m_viewportSettings == viewportSettings)
return;
+ delete m_viewportSettings;
+
m_viewportSettings = viewportSettings;
connect(m_viewportSettings, &Q3DSViewportSettings::showRenderStatsChanged, [this] {
setProfileUiVisible(m_viewportSettings->isShowingRenderStats());
diff --git a/src/runtime/q3dsscenemanager.cpp b/src/runtime/q3dsscenemanager.cpp
index c6447d3..578dd78 100644
--- a/src/runtime/q3dsscenemanager.cpp
+++ b/src/runtime/q3dsscenemanager.cpp
@@ -730,8 +730,6 @@ Q3DSSceneManager::Scene Q3DSSceneManager::buildScene(Q3DSUipPresentation *presen
this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
}
- QObject::disconnect(m_engine, &Q3DSEngine::stereoModeChanged, 0, 0);
-
// Kick off the Qt3D scene.
m_rootEntity = new Qt3DCore::QEntity;
m_rootEntity->setObjectName(QString(QLatin1String("non-layer root for presentation %1")).arg(m_presentation->name()));
diff --git a/src/runtime/q3dsslideplayer.cpp b/src/runtime/q3dsslideplayer.cpp
index 2c3b305..0bf850f 100644
--- a/src/runtime/q3dsslideplayer.cpp
+++ b/src/runtime/q3dsslideplayer.cpp
@@ -687,7 +687,7 @@ void Q3DSSlidePlayer::handleCurrentSlideChanged(Q3DSSlide *slide,
setSlideTime(slide, 0.0f, true);
processPropertyChanges(slide, previousSlide);
attatchPositionCallback(slide);
- m_animationManager->updateAnimations(slide, (m_mode == PlayerMode::Editor));
+ m_animationManager->updateAnimations(slide, (m_mode == PlayerMode::Editor), !forceUpdate);
Q3DSGraphObject *eventTarget = m_sceneManager->m_scene;
if (m_type != PlayerType::Scene)