1 | // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "armature_p.h" |
5 | |
6 | #include <Qt3DCore/qarmature.h> |
7 | #include <Qt3DCore/qabstractskeleton.h> |
8 | |
9 | #include <Qt3DCore/private/qarmature_p.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | |
14 | namespace Qt3DRender { |
15 | namespace Render { |
16 | |
17 | using namespace Qt3DCore; |
18 | |
19 | Armature::Armature() |
20 | : BackendNode(Qt3DCore::QBackendNode::ReadOnly) |
21 | { |
22 | } |
23 | |
24 | void Armature::syncFromFrontEnd(const QNode *frontEnd, bool firstTime) |
25 | { |
26 | BackendNode::syncFromFrontEnd(frontEnd, firstTime); |
27 | const QArmature *node = qobject_cast<const QArmature *>(object: frontEnd); |
28 | if (!node) |
29 | return; |
30 | |
31 | m_skeletonId = node->skeleton() ? node->skeleton()->id() : QNodeId{}; |
32 | } |
33 | |
34 | void Armature::cleanup() |
35 | { |
36 | m_skeletonId = Qt3DCore::QNodeId(); |
37 | setEnabled(false); |
38 | } |
39 | |
40 | } // namespace Render |
41 | } // namespace Qt3DRender |
42 | |
43 | QT_END_NAMESPACE |
44 |