Have a usdz file with the typical one character and one animation.
let p = Bundle.main.url(forResource: "Sitting Laughing", withExtension: "usdz")!
let amyAsset = MDLAsset(url: p)
amyAsset.loadTextures()
let amy = SCNNode(mdlObject: amyAsset.object(at: 0))
.. your node .. .addChildNode(amy)
You can now see "amy" perfectly in your scene.
If you try this, notice there are NO keys:
for k in amy.animationKeys { print("keys? \(k)") }
however try this with the asset,
for ob in amyAsset.animations.objects { print("ob \(ob)") }
And you'll see the MDLPackedJointAnimation
for example
<<MDLPackedJointAnimation: 0x7ff7b0e18830>, Name: /High_Jump/mixamorig_Hips/Skeleton/Animation, Children: 0>
Alternately, say,
let pjs = amyAsset.animations.objects.compactMap { $0 as? MDLPackedJointAnimation }
for pj in pjs {
print("... \(pj.name)")
}
for the same info.
The "name" will look like /High_Jump/mixamorig_Hips/Skeleton/Animation
From there how the heck do you play that MDLPackedJointAnimation
???
I've tried everything and cannot :/