1 /****************************************************************************
2 **
3 ** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the Qt3D module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39 
40 #include "qt3dquick3danimationplugin.h"
41 #include <Qt3DAnimation/qabstractclipanimator.h>
42 #include <Qt3DAnimation/qabstractanimationclip.h>
43 #include <Qt3DAnimation/qanimationclip.h>
44 #include <Qt3DAnimation/qanimationcliploader.h>
45 #include <Qt3DAnimation/qblendedclipanimator.h>
46 #include <Qt3DAnimation/qclipanimator.h>
47 #include <Qt3DAnimation/qchannelmapping.h>
48 #include <Qt3DAnimation/qskeletonmapping.h>
49 #include <Qt3DAnimation/qlerpclipblend.h>
50 #include <Qt3DAnimation/qadditiveclipblend.h>
51 #include <Qt3DAnimation/qclipblendvalue.h>
52 #include <Qt3DAnimation/qclock.h>
53 #include <Qt3DAnimation/qkeyframeanimation.h>
54 #include <Qt3DAnimation/qanimationcontroller.h>
55 #include <Qt3DAnimation/qabstractanimation.h>
56 #include <Qt3DAnimation/qmorphinganimation.h>
57 #include <Qt3DAnimation/qanimationgroup.h>
58 #include <Qt3DAnimation/qmorphtarget.h>
59 #include <Qt3DAnimation/qvertexblendanimation.h>
60 
61 #include <Qt3DQuick/private/quick3dnodev9_p.h>
62 #include <Qt3DQuickAnimation/private/qt3dquickanimation_global_p.h>
63 #include <Qt3DQuickAnimation/private/quick3dchannelmapper_p.h>
64 #include <Qt3DQuickAnimation/private/quick3dkeyframeanimation_p.h>
65 #include <Qt3DQuickAnimation/private/quick3danimationgroup_p.h>
66 #include <Qt3DQuickAnimation/private/quick3danimationcontroller_p.h>
67 #include <Qt3DQuickAnimation/private/quick3dmorphtarget_p.h>
68 #include <Qt3DQuickAnimation/private/quick3dmorphinganimation_p.h>
69 #include <Qt3DQuickAnimation/private/quick3dvertexblendanimation_p.h>
70 
71 QT_BEGIN_NAMESPACE
72 
registerTypes(const char * uri)73 void Qt3DQuick3DAnimationPlugin::registerTypes(const char *uri)
74 {
75     Qt3DAnimation::Quick::Quick3DAnimation_initialize();
76 
77     // @uri Qt3D.Animation
78     qmlRegisterExtendedUncreatableType<Qt3DCore::QNode, Qt3DCore::Quick::Quick3DNodeV9, 9>(uri, 2, 9, "Node", QStringLiteral("Node is a base class"));
79     qmlRegisterUncreatableType<Qt3DAnimation::QAbstractClipAnimator>(uri, 2, 9, "AbstractClipAnimator", QStringLiteral("QAbstractClipAnimator is abstract"));
80     qmlRegisterType<Qt3DAnimation::QClipAnimator>(uri, 2, 9, "ClipAnimator");
81     qmlRegisterType<Qt3DAnimation::QBlendedClipAnimator>(uri, 2, 9, "BlendedClipAnimator");
82     qmlRegisterType<Qt3DAnimation::QChannelMapping>(uri, 2, 9, "ChannelMapping");
83     qmlRegisterUncreatableType<Qt3DAnimation::QAbstractAnimationClip>(uri, 2, 9, "AbstractAnimationClip", QStringLiteral("QAbstractAnimationClip is abstract"));
84     qmlRegisterType<Qt3DAnimation::QAnimationClipLoader>(uri, 2, 9, "AnimationClipLoader");
85     qmlRegisterType<Qt3DAnimation::QAnimationClip>(uri, 2, 9, "AnimationClip");
86     qmlRegisterExtendedType<Qt3DAnimation::QChannelMapper,
87                             Qt3DAnimation::Animation::Quick::Quick3DChannelMapper>(uri, 2, 9, "ChannelMapper");
88     qmlRegisterUncreatableType<Qt3DAnimation::QAbstractClipBlendNode>(uri, 2, 9, "AbstractClipBlendNode", QStringLiteral("QAbstractClipBlendNode is abstract"));
89     qmlRegisterType<Qt3DAnimation::QLerpClipBlend>(uri, 2, 9, "LerpClipBlend");
90     qmlRegisterType<Qt3DAnimation::QAdditiveClipBlend>(uri, 2, 9, "AdditiveClipBlend");
91     qmlRegisterType<Qt3DAnimation::QClipBlendValue>(uri, 2, 9, "ClipBlendValue");
92     qmlRegisterType<Qt3DAnimation::QClock>(uri, 2, 9, "Clock");
93 
94     qmlRegisterUncreatableType<Qt3DAnimation::QAbstractAnimation>(uri, 2, 9, "AbstractAnimation", QStringLiteral("AbstractAnimation is abstract"));
95     qmlRegisterExtendedType<Qt3DAnimation::QKeyframeAnimation, Qt3DAnimation::Quick::QQuick3DKeyframeAnimation>(uri, 2, 9, "KeyframeAnimation");
96     qmlRegisterExtendedType<Qt3DAnimation::QAnimationGroup, Qt3DAnimation::Quick::QQuick3DAnimationGroup>(uri, 2, 9, "AnimationGroup");
97     qmlRegisterExtendedType<Qt3DAnimation::QAnimationController, Qt3DAnimation::Quick::QQuick3DAnimationController>(uri, 2, 9, "AnimationController");
98     qmlRegisterExtendedType<Qt3DAnimation::QMorphingAnimation, Qt3DAnimation::Quick::QQuick3DMorphingAnimation>(uri, 2, 9, "MorphingAnimation");
99     qmlRegisterExtendedType<Qt3DAnimation::QMorphTarget, Qt3DAnimation::Quick::QQuick3DMorphTarget>(uri, 2, 9, "MorphTarget");
100     qmlRegisterExtendedType<Qt3DAnimation::QVertexBlendAnimation, Qt3DAnimation::Quick::QQuick3DVertexBlendAnimation>(uri, 2, 9, "VertexBlendAnimation");
101 
102     qmlRegisterUncreatableType<Qt3DAnimation::QAbstractChannelMapping>(uri, 2, 10, "AbstractChannelMapping", QStringLiteral("QAbstractChannelMapping is abstract"));
103     qmlRegisterType<Qt3DAnimation::QSkeletonMapping>(uri, 2, 10, "SkeletonMapping");
104 
105     // Auto-increment the import to stay in sync with ALL future Qt minor versions
106     qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
107 }
108 
109 QT_END_NAMESPACE
110