diff options
author | Mike Krus <mike.krus@kdab.com> | 2018-11-06 11:54:40 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2018-12-20 15:44:00 +0000 |
commit | ee7d7c3d7d061902d1ad5409e33f141da61f0b07 (patch) | |
tree | 80870d378a9c7eb78e1ac6b32b9faa63bd3a9025 | |
parent | 86b1866c9bcb40cf6a03bc7d810e58a5e815c193 (diff) |
Fix loading of animation aspect on iOS
Loading the animation aspect the same way logic and input aspect are
handled. Otherwise aspect is not registered with the factory.
Note: not ideal, should really fix the static registering of all aspects
and not have any specific code like this
Change-Id: Ic92256e344671ee3d550d32a06d91b1ddf396abf
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/quick3d/imports/scene3d/importsscene3d.pro | 1 | ||||
-rw-r--r-- | src/quick3d/imports/scene3d/scene3ditem.cpp | 14 | ||||
-rw-r--r-- | src/src.pro | 1 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/quick3d/imports/scene3d/importsscene3d.pro b/src/quick3d/imports/scene3d/importsscene3d.pro index cf8d7cacf..a8ad8f417 100644 --- a/src/quick3d/imports/scene3d/importsscene3d.pro +++ b/src/quick3d/imports/scene3d/importsscene3d.pro @@ -7,6 +7,7 @@ QT += qml quick 3dcore 3drender 3drender-private qtConfig(qt3d-input): QT += 3dinput qtConfig(qt3d-logic): QT += 3dlogic +qtConfig(qt3d-animation): QT += 3danimation # Qt3D is free of Q_FOREACH - make sure it stays that way: DEFINES += QT_NO_FOREACH diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index ddb25777c..ffb1d9112 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -52,6 +52,10 @@ #include <Qt3DLogic/qlogicaspect.h> #endif +#if QT_CONFIG(qt3d_animation) +#include <Qt3DAnimation/qanimationaspect.h> +#endif + #include <Qt3DRender/QRenderAspect> #include <Qt3DRender/qcamera.h> #include <Qt3DRender/qrendersurfaceselector.h> @@ -169,7 +173,15 @@ void Scene3DItem::setAspects(const QStringList &aspects) m_aspectEngine->registerAspect(new Qt3DLogic::QLogicAspect); continue; #else - qFatal("Scene3D requested the Qt 3D input aspect but Qt 3D wasn't configured to build the Qt 3D Input aspect"); + qFatal("Scene3D requested the Qt 3D logic aspect but Qt 3D wasn't configured to build the Qt 3D Logic aspect"); +#endif + } + if (aspect == QLatin1String("animation")) { +#if QT_CONFIG(qt3d_animation) + m_aspectEngine->registerAspect(new Qt3DAnimation::QAnimationAspect); + continue; +#else + qFatal("Scene3D requested the Qt 3D animation aspect but Qt 3D wasn't configured to build the Qt 3D Animation aspect"); #endif } m_aspectEngine->registerAspect(aspect); diff --git a/src/src.pro b/src/src.pro index c3c8d6291..853ae8fb5 100644 --- a/src/src.pro +++ b/src/src.pro @@ -147,6 +147,7 @@ qtHaveModule(quick) { src_quick3d_imports_scene2d } qtConfig(qt3d-logic): src_quick3d_imports_scene3d.depends += src_logic + qtConfig(qt3d-animation): src_quick3d_imports_scene3d.depends += src_animation } qtConfig(qt3d-animation) { SUBDIRS += \ |