-
Notifications
You must be signed in to change notification settings - Fork 0
/
SkinnedEntity.qml
51 lines (45 loc) · 1.4 KB
/
SkinnedEntity.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Qt3D.Core 2.10
import Qt3D.Render 2.10
import Qt3D.Input 2.0
import Qt3D.Extras 2.10
Entity {
id: root
property Effect effect: skinnedPbrEffect
property url source: ""
property alias createJointsEnabled: skeleton.createJointsEnabled
property alias transform: transform
property color baseColor: "red"
property alias rootJoint: skeleton.rootJoint
property alias skeleton: skeleton
components: [
Transform {
id: transform
rotationX: 180
rotationY: 180
},
Mesh {
source: root.source
},
Armature {
skeleton: SkeletonLoader {
id: skeleton
source: root.source
onStatusChanged: {
if(status === SkeletonLoader.Ready)
console.log("SkeletonLoader status ready")
else if(status === SkeletonLoader.NotReady)
console.log("SkeletonLoader status not ready")
else console.log("SkeletonLoader status error")
}
onJointCountChanged: console.log("skeleton has " + jointCount + " joints")
}
}
,
TextureMaterial {
effect: root.effect
parameters: [
Parameter { name: "baseColor"; value: root.baseColor }
]
}
]
}