summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3dextras
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-01-31 15:07:05 +0000
committerSean Harmer <sean.harmer@kdab.com>2017-01-31 15:35:36 +0000
commitaf4ebcc51fadd90904e8fe6295860dff0d19e680 (patch)
tree734a3c13a567a302b6b3665a9d87cd539d8d2eda /src/quick3d/quick3dextras
parent90f1063a1e090a03bb45826d1229fc9179484f9b (diff)
parent59f8fec8a41606b3185fe3a4e276978e3e1ed5ef (diff)
Merge branch 'wip/animation' into dev
Conflicts: src/extras/defaults/defaults.pri src/extras/extras.qrc src/quick3d/imports/extras/importsextras.pro src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp src/quick3d/quick3dextras/items/items.pri src/quick3d/quick3dextras/quick3dextras.pro tests/manual/manual.pro Change-Id: I62232cb21495612f31f48a6749a52b68777c4ae3
Diffstat (limited to 'src/quick3d/quick3dextras')
-rw-r--r--src/quick3d/quick3dextras/items/items.pri14
-rw-r--r--src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp95
-rw-r--r--src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h89
-rw-r--r--src/quick3d/quick3dextras/items/quick3danimationgroup.cpp99
-rw-r--r--src/quick3d/quick3dextras/items/quick3danimationgroup_p.h91
-rw-r--r--src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp101
-rw-r--r--src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h92
-rw-r--r--src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp97
-rw-r--r--src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h92
-rw-r--r--src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp93
-rw-r--r--src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h85
-rw-r--r--src/quick3d/quick3dextras/quick3dextras.pro3
12 files changed, 948 insertions, 3 deletions
diff --git a/src/quick3d/quick3dextras/items/items.pri b/src/quick3d/quick3dextras/items/items.pri
index b6f5d1877..f7ca73a58 100644
--- a/src/quick3d/quick3dextras/items/items.pri
+++ b/src/quick3d/quick3dextras/items/items.pri
@@ -1,8 +1,18 @@
HEADERS += \
$$PWD/quick3dlevelofdetailloader_p.h \
- $$PWD/quick3dlevelofdetailloader_p_p.h
+ $$PWD/quick3dlevelofdetailloader_p_p.h \
+ $$PWD/quick3danimationcontroller_p.h \
+ $$PWD/quick3danimationgroup_p.h \
+ $$PWD/quick3dkeyframeanimation_p.h \
+ $$PWD/quick3dmorphinganimation_p.h \
+ $$PWD/quick3dmorphtarget_p.h
SOURCES += \
- $$PWD/quick3dlevelofdetailloader.cpp
+ $$PWD/quick3dlevelofdetailloader.cpp \
+ $$PWD/quick3danimationcontroller.cpp \
+ $$PWD/quick3danimationgroup.cpp \
+ $$PWD/quick3dkeyframeanimation.cpp \
+ $$PWD/quick3dmorphinganimation.cpp \
+ $$PWD/quick3dmorphtarget.cpp
INCLUDEPATH += $$PWD
diff --git a/src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp b/src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp
new file mode 100644
index 000000000..4aceb0d55
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3danimationcontroller.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3danimationcontroller_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+QQuick3DAnimationController::QQuick3DAnimationController(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<QAnimationGroup> QQuick3DAnimationController::animationGroups()
+{
+ return QQmlListProperty<QAnimationGroup>(this, 0,
+ &QQuick3DAnimationController::appendAnimationGroup,
+ &QQuick3DAnimationController::animationGroupCount,
+ &QQuick3DAnimationController::animationGroupAt,
+ &QQuick3DAnimationController::clearAnimationGroups);
+}
+
+
+void QQuick3DAnimationController::appendAnimationGroup(QQmlListProperty<QAnimationGroup> *list, QAnimationGroup *bar)
+{
+ QQuick3DAnimationController *controller = qobject_cast<QQuick3DAnimationController *>(list->object);
+ if (controller)
+ controller->parentAnimationController()->addAnimationGroup(bar);
+}
+
+int QQuick3DAnimationController::animationGroupCount(QQmlListProperty<QAnimationGroup> *list)
+{
+ QQuick3DAnimationController *controller = qobject_cast<QQuick3DAnimationController *>(list->object);
+ if (controller)
+ return controller->parentAnimationController()->animationGroupList().count();
+ return 0;
+}
+
+QAnimationGroup *QQuick3DAnimationController::animationGroupAt(QQmlListProperty<QAnimationGroup> *list, int index)
+{
+ QQuick3DAnimationController *controller = qobject_cast<QQuick3DAnimationController *>(list->object);
+ if (controller)
+ return qobject_cast<QAnimationGroup *>(controller->parentAnimationController()->getGroup(index));
+ return nullptr;
+}
+
+void QQuick3DAnimationController::clearAnimationGroups(QQmlListProperty<QAnimationGroup> *list)
+{
+ QQuick3DAnimationController *controller = qobject_cast<QQuick3DAnimationController *>(list->object);
+ if (controller) {
+ QVector<QAnimationGroup *> emptyList;
+ controller->parentAnimationController()->setAnimationGroups(emptyList);
+ }
+}
+
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h b/src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h
new file mode 100644
index 000000000..82ad29e2c
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3danimationcontroller_p.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DEXTRAS_QUICK_QUICK3DANIMATIONCONTROLLER_P_H
+#define QT3DEXTRAS_QUICK_QUICK3DANIMATIONCONTROLLER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <QQmlListProperty>
+#include <Qt3DExtras/QAnimationController>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DAnimationController : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DExtras::QAnimationGroup> animationGroups READ animationGroups)
+
+public:
+
+ explicit QQuick3DAnimationController(QObject *parent = nullptr);
+
+ inline Qt3DExtras::QAnimationController *parentAnimationController() const
+ {
+ return qobject_cast<Qt3DExtras::QAnimationController *>(parent());
+ }
+
+ QQmlListProperty<Qt3DExtras::QAnimationGroup> animationGroups();
+
+private:
+
+ static void appendAnimationGroup(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list, Qt3DExtras::QAnimationGroup *bar);
+ static QAnimationGroup *animationGroupAt(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list, int index);
+ static int animationGroupCount(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list);
+ static void clearAnimationGroups(QQmlListProperty<Qt3DExtras::QAnimationGroup> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_RENDER_QUICK_QUICK3DEFFECT_P_H
diff --git a/src/quick3d/quick3dextras/items/quick3danimationgroup.cpp b/src/quick3d/quick3dextras/items/quick3danimationgroup.cpp
new file mode 100644
index 000000000..3e3813227
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3danimationgroup.cpp
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3danimationgroup_p.h"
+
+#include <Qt3DExtras/qabstractanimation.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+QQuick3DAnimationGroup::QQuick3DAnimationGroup(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DExtras::QAbstractAnimation> QQuick3DAnimationGroup::animations()
+{
+ return QQmlListProperty<Qt3DExtras::QAbstractAnimation>(this, 0,
+ &QQuick3DAnimationGroup::appendAnimation,
+ &QQuick3DAnimationGroup::animationCount,
+ &QQuick3DAnimationGroup::animationAt,
+ &QQuick3DAnimationGroup::clearAnimation);
+}
+
+
+void QQuick3DAnimationGroup::appendAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list,
+ Qt3DExtras::QAbstractAnimation *animation)
+{
+ QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
+ if (animationGroup)
+ animationGroup->parentAnimationGroup()->addAnimation(animation);
+}
+
+int QQuick3DAnimationGroup::animationCount(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list)
+{
+ QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
+ if (animationGroup)
+ return animationGroup->parentAnimationGroup()->animationList().count();
+ return 0;
+}
+
+Qt3DExtras::QAbstractAnimation *QQuick3DAnimationGroup::animationAt(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list, int index)
+{
+ QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
+ if (animationGroup) {
+ return qobject_cast<Qt3DExtras::QAbstractAnimation *>(
+ animationGroup->parentAnimationGroup()->animationList().at(index));
+ }
+ return nullptr;
+}
+
+void QQuick3DAnimationGroup::clearAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list)
+{
+ QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object);
+ if (animationGroup) {
+ QVector<Qt3DExtras::QAbstractAnimation *> emptyList;
+ animationGroup->parentAnimationGroup()->setAnimations(emptyList);
+ }
+}
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3danimationgroup_p.h b/src/quick3d/quick3dextras/items/quick3danimationgroup_p.h
new file mode 100644
index 000000000..c7140c946
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3danimationgroup_p.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DEXTRAS_QUICK_QUICK3DANIMATIONGROUP_P_H
+#define QT3DEXTRAS_QUICK_QUICK3DANIMATIONGROUP_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmllist.h>
+#include <Qt3DExtras/qabstractanimation.h>
+#include <Qt3DExtras/qanimationgroup.h>
+
+#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DAnimationGroup : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DExtras::QAbstractAnimation> animations READ animations)
+
+public:
+
+ explicit QQuick3DAnimationGroup(QObject *parent = nullptr);
+
+ inline Qt3DExtras::QAnimationGroup *parentAnimationGroup() const
+ {
+ return qobject_cast<Qt3DExtras::QAnimationGroup *>(parent());
+ }
+
+ QQmlListProperty<Qt3DExtras::QAbstractAnimation> animations();
+
+private:
+
+ static void appendAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list, Qt3DExtras::QAbstractAnimation *animation);
+ static Qt3DExtras::QAbstractAnimation *animationAt(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list, int index);
+ static int animationCount(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list);
+ static void clearAnimation(QQmlListProperty<Qt3DExtras::QAbstractAnimation> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_RENDER_QUICK_QUICK3DEFFECT_P_H
diff --git a/src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp b/src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp
new file mode 100644
index 000000000..cfd9ca7d2
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dkeyframeanimation.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dkeyframeanimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+QQuick3DKeyframeAnimation::QQuick3DKeyframeAnimation(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DCore::QTransform> QQuick3DKeyframeAnimation::keyframes()
+{
+ return QQmlListProperty<Qt3DCore::QTransform>(this, 0,
+ &QQuick3DKeyframeAnimation::appendKeyframe,
+ &QQuick3DKeyframeAnimation::keyframeCount,
+ &QQuick3DKeyframeAnimation::keyframeAt,
+ &QQuick3DKeyframeAnimation::clearKeyframes);
+}
+
+void QQuick3DKeyframeAnimation::appendKeyframe(QQmlListProperty<Qt3DCore::QTransform> *list,
+ Qt3DCore::QTransform *transform)
+{
+ QQuick3DKeyframeAnimation *keyframeAnimation
+ = qobject_cast<QQuick3DKeyframeAnimation *>(list->object);
+ if (keyframeAnimation)
+ keyframeAnimation->parentKeyframeAnimation()->addKeyframe(transform);
+}
+
+int QQuick3DKeyframeAnimation::keyframeCount(QQmlListProperty<Qt3DCore::QTransform> *list)
+{
+ QQuick3DKeyframeAnimation *keyframeAnimation
+ = qobject_cast<QQuick3DKeyframeAnimation *>(list->object);
+ if (keyframeAnimation)
+ return keyframeAnimation->parentKeyframeAnimation()->keyframeList().count();
+ return 0;
+}
+
+Qt3DCore::QTransform *QQuick3DKeyframeAnimation::keyframeAt(QQmlListProperty<Qt3DCore::QTransform> *list,
+ int index)
+{
+ QQuick3DKeyframeAnimation *keyframeAnimation
+ = qobject_cast<QQuick3DKeyframeAnimation *>(list->object);
+ if (keyframeAnimation) {
+ return qobject_cast<Qt3DCore::QTransform *>(
+ keyframeAnimation->parentKeyframeAnimation()->keyframeList().at(index));
+ }
+ return nullptr;
+}
+
+void QQuick3DKeyframeAnimation::clearKeyframes(QQmlListProperty<Qt3DCore::QTransform> *list)
+{
+ QQuick3DKeyframeAnimation *keyframeAnimation
+ = qobject_cast<QQuick3DKeyframeAnimation *>(list->object);
+ if (keyframeAnimation) {
+ QVector<Qt3DCore::QTransform *> emptyList;
+ keyframeAnimation->parentKeyframeAnimation()->setKeyframes(emptyList);
+ }
+}
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h b/src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h
new file mode 100644
index 000000000..e8309de9e
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dkeyframeanimation_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DEXTRAS_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
+#define QT3DEXTRAS_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmllist.h>
+
+#include <Qt3DExtras/qkeyframeanimation.h>
+
+#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DKeyframeAnimation : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DCore::QTransform> keyframes READ keyframes)
+
+public:
+ QQuick3DKeyframeAnimation(QObject *parent = nullptr);
+
+ inline QKeyframeAnimation *parentKeyframeAnimation() const
+ {
+ return qobject_cast<QKeyframeAnimation *>(parent());
+ }
+
+ QQmlListProperty<Qt3DCore::QTransform> keyframes();
+
+private:
+
+ static void appendKeyframe(QQmlListProperty<Qt3DCore::QTransform> *list,
+ Qt3DCore::QTransform *transform);
+ static Qt3DCore::QTransform *keyframeAt(QQmlListProperty<Qt3DCore::QTransform> *list,
+ int index);
+ static int keyframeCount(QQmlListProperty<Qt3DCore::QTransform> *list);
+ static void clearKeyframes(QQmlListProperty<Qt3DCore::QTransform> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DEXTRAS_QUICK_QUICK3DKEYFRAMEANIMATION_P_H
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp b/src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp
new file mode 100644
index 000000000..61636f06d
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dmorphinganimation.cpp
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dmorphinganimation_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+QQuick3DMorphingAnimation::QQuick3DMorphingAnimation(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DExtras::QMorphTarget> QQuick3DMorphingAnimation::morphTargets()
+{
+ return QQmlListProperty<Qt3DExtras::QMorphTarget>(this, 0,
+ &QQuick3DMorphingAnimation::appendMorphTarget,
+ &QQuick3DMorphingAnimation::morphTargetCount,
+ &QQuick3DMorphingAnimation::morphTargetAt,
+ &QQuick3DMorphingAnimation::clearMorphTargets);
+}
+
+void QQuick3DMorphingAnimation::appendMorphTarget(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
+ Qt3DExtras::QMorphTarget *morphTarget)
+{
+ QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
+ if (animation)
+ animation->parentMorphingAnimation()->addMorphTarget(morphTarget);
+}
+
+int QQuick3DMorphingAnimation::morphTargetCount(QQmlListProperty<Qt3DExtras::QMorphTarget> *list)
+{
+ QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
+ if (animation)
+ return animation->parentMorphingAnimation()->morphTargetList().count();
+ return 0;
+}
+
+Qt3DExtras::QMorphTarget *QQuick3DMorphingAnimation::morphTargetAt(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
+ int index)
+{
+ QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
+ if (animation) {
+ return qobject_cast<Qt3DExtras::QMorphTarget *>(
+ animation->parentMorphingAnimation()->morphTargetList().at(index));
+ }
+ return nullptr;
+}
+
+void QQuick3DMorphingAnimation::clearMorphTargets(QQmlListProperty<Qt3DExtras::QMorphTarget> *list)
+{
+ QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object);
+ if (animation) {
+ QVector<Qt3DExtras::QMorphTarget *> emptyList;
+ animation->parentMorphingAnimation()->setMorphTargets(emptyList);
+ }
+}
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h b/src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h
new file mode 100644
index 000000000..5f052fd04
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dmorphinganimation_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DEXTRAS_QUICK_QUICK3DMORPHINGANIMATION_P_H
+#define QT3DEXTRAS_QUICK_QUICK3DMORPHINGANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqmllist.h>
+
+#include <Qt3DExtras/qmorphinganimation.h>
+
+#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DMorphingAnimation : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DExtras::QMorphTarget> morphTargets READ morphTargets)
+
+public:
+ QQuick3DMorphingAnimation(QObject *parent = nullptr);
+
+ inline QMorphingAnimation *parentMorphingAnimation() const
+ {
+ return qobject_cast<QMorphingAnimation *>(parent());
+ }
+
+ QQmlListProperty<Qt3DExtras::QMorphTarget> morphTargets();
+
+private:
+
+ static void appendMorphTarget(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
+ Qt3DExtras::QMorphTarget *morphTarget);
+ static Qt3DExtras::QMorphTarget *morphTargetAt(QQmlListProperty<Qt3DExtras::QMorphTarget> *list,
+ int index);
+ static int morphTargetCount(QQmlListProperty<Qt3DExtras::QMorphTarget> *list);
+ static void clearMorphTargets(QQmlListProperty<Qt3DExtras::QMorphTarget> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DEXTRAS_QUICK_QUICK3DMORPHINGANIMATION_P_H
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp b/src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp
new file mode 100644
index 000000000..8c1b9f0c1
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dmorphtarget.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quick3dmorphtarget_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+QQuick3DMorphTarget::QQuick3DMorphTarget(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QQmlListProperty<Qt3DRender::QAttribute> QQuick3DMorphTarget::attributes()
+{
+ return QQmlListProperty<Qt3DRender::QAttribute>(this, 0,
+ &QQuick3DMorphTarget::appendAttribute,
+ &QQuick3DMorphTarget::attributeCount,
+ &QQuick3DMorphTarget::attributeAt,
+ &QQuick3DMorphTarget::clearAttributes);
+}
+
+void QQuick3DMorphTarget::appendAttribute(QQmlListProperty<Qt3DRender::QAttribute> *list, Qt3DRender::QAttribute *bar)
+{
+ QQuick3DMorphTarget *target = qobject_cast<QQuick3DMorphTarget *>(list->object);
+ if (target)
+ target->parentMorphTarget()->addAttribute(bar);
+}
+
+int QQuick3DMorphTarget::attributeCount(QQmlListProperty<Qt3DRender::QAttribute> *list)
+{
+ QQuick3DMorphTarget *target = qobject_cast<QQuick3DMorphTarget *>(list->object);
+ if (target)
+ return target->parentMorphTarget()->attributeList().count();
+ return 0;
+}
+
+Qt3DRender::QAttribute *QQuick3DMorphTarget::attributeAt(QQmlListProperty<Qt3DRender::QAttribute> *list, int index)
+{
+ QQuick3DMorphTarget *target = qobject_cast<QQuick3DMorphTarget *>(list->object);
+ if (target)
+ return qobject_cast<Qt3DRender::QAttribute *>(target->parentMorphTarget()->attributeList().at(index));
+ return nullptr;
+}
+
+void QQuick3DMorphTarget::clearAttributes(QQmlListProperty<Qt3DRender::QAttribute> *list)
+{
+ QQuick3DMorphTarget *target = qobject_cast<QQuick3DMorphTarget *>(list->object);
+ if (target) {
+ QVector<Qt3DRender::QAttribute *> emptyList;
+ target->parentMorphTarget()->setAttributes(emptyList);
+ }
+}
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
diff --git a/src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h b/src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h
new file mode 100644
index 000000000..e5c664370
--- /dev/null
+++ b/src/quick3d/quick3dextras/items/quick3dmorphtarget_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DEXTRAS_QUICK_QUICK3DMORPHTARGET_P_H
+#define QT3DEXTRAS_QUICK_QUICK3DMORPHTARGET_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <Qt3DQuickExtras/qt3dquickextras_global.h>
+#include <QQmlListProperty>
+#include <Qt3DExtras/QMorphTarget>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DExtras {
+namespace Quick {
+
+class QT3DQUICKEXTRASSHARED_EXPORT QQuick3DMorphTarget : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<Qt3DRender::QAttribute> attributes READ attributes)
+
+public:
+ QQuick3DMorphTarget(QObject *parent = nullptr);
+
+ inline QMorphTarget *parentMorphTarget() const { return qobject_cast<QMorphTarget *>(parent()); }
+
+ QQmlListProperty<Qt3DRender::QAttribute> attributes();
+
+private:
+
+ static void appendAttribute(QQmlListProperty<Qt3DRender::QAttribute> *list, Qt3DRender::QAttribute *bar);
+ static Qt3DRender::QAttribute *attributeAt(QQmlListProperty<Qt3DRender::QAttribute> *list, int index);
+ static int attributeCount(QQmlListProperty<Qt3DRender::QAttribute> *list);
+ static void clearAttributes(QQmlListProperty<Qt3DRender::QAttribute> *list);
+};
+
+} // namespace Quick
+} // namespace Qt3DExtras
+
+QT_END_NAMESPACE
+
+#endif // QT3DEXTRAS_QUICK_QUICK3DMORPHTARGET_P_H
diff --git a/src/quick3d/quick3dextras/quick3dextras.pro b/src/quick3d/quick3dextras/quick3dextras.pro
index 5b00d5dc3..c2fce8b10 100644
--- a/src/quick3d/quick3dextras/quick3dextras.pro
+++ b/src/quick3d/quick3dextras/quick3dextras.pro
@@ -1,7 +1,8 @@
TARGET = Qt3DQuickExtras
MODULE = 3dquickextras
-QT += core core-private qml qml-private 3dcore 3dinput 3dquick 3dquick-private 3drender 3drender-private 3dlogic
+QT += core core-private qml qml-private 3dcore 3dinput 3dquick 3dquick-private 3drender 3drender-private 3dlogic 3dextras
+
CONFIG -= precompile_header
# Qt3D is free of Q_FOREACH - make sure it stays that way: