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
11QT_BEGIN_NAMESPACE
12
13using namespace Qt3DCore;
14
15namespace Qt3DRender {
16namespace Render {
17
18Armature::Armature()
19 : BackendNode(Qt3DCore::QBackendNode::ReadOnly)
20{
21}
22
23void Armature::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
24{
25 BackendNode::syncFromFrontEnd(frontEnd, firstTime);
26 const QArmature *node = qobject_cast<const QArmature *>(object: frontEnd);
27 if (!node)
28 return;
29
30 m_skeletonId = node->skeleton() ? node->skeleton()->id() : QNodeId{};
31}
32
33void Armature::cleanup()
34{
35 m_skeletonId = Qt3DCore::QNodeId();
36 setEnabled(false);
37}
38
39} // namespace Render
40} // namespace Qt3DRender
41
42QT_END_NAMESPACE
43

source code of qt3d/src/render/geometry/armature.cpp