| 1 |
import Qt3D.Core 2.10 |
| 2 |
import Qt3D.Render 2.10 |
| 3 |
import Qt3D.Input 2.0 |
| 4 |
import Qt3D.Extras 2.10 |
| 5 |
|
| 6 |
Entity { |
| 7 |
id: root |
| 8 |
|
| 9 |
property Effect effect: skinnedPbrEffect |
| 10 |
property url source: "" |
| 11 |
property alias createJointsEnabled: skeleton.createJointsEnabled |
| 12 |
property alias transform: transform |
| 13 |
property color baseColor: "red" |
| 14 |
property alias rootJoint: skeleton.rootJoint |
| 15 |
property alias skeleton: skeleton |
| 16 |
|
| 17 |
components: [ |
| 18 |
Transform { |
| 19 |
id: transform |
| 20 |
rotationX: -90 |
| 21 |
}, |
| 22 |
Mesh { |
| 23 |
source: root.source |
| 24 |
}, |
| 25 |
Armature { |
| 26 |
skeleton: SkeletonLoader { |
| 27 |
id: skeleton |
| 28 |
source: root.source |
| 29 |
onStatusChanged: console.log("skeleton loader status: " + skeleton.status) |
| 30 |
onJointCountChanged: console.log("skeleton has " + skeleton.jointCount + " joints") |
| 31 |
} |
| 32 |
}, |
| 33 |
Material { |
| 34 |
effect: root.effect |
| 35 |
|
| 36 |
parameters: [ |
| 37 |
Parameter { name: "baseColor"; value: root.baseColor } |
| 38 |
] |
| 39 |
} |
| 40 |
] |
| 41 |
} |