I want assist in perceive easy methods to know if a usdz mannequin comprises animation & if sure animate it from one state to a different state. Beneath is my code
class ViewController: UIViewController {
@IBOutlet weak var sceneKitView: SCNView!
override func viewDidLoad() {
tremendous.viewDidLoad()
load3dModelFromAsset()
}
func load3dModelFromAsset(){
let scene = SCNScene(named: "fox.usdz")
let lightNode = SCNNode()
lightNode.gentle = SCNLight()
lightNode.gentle?.sort = .omni
lightNode.place = SCNVector3(x: 0, y: 10, z: 35)
scene?.rootNode.addChildNode(lightNode)
let ambientLightNode = SCNNode()
ambientLightNode.gentle = SCNLight()
ambientLightNode.gentle?.sort = .ambient
ambientLightNode.gentle?.colour = UIColor.darkGray
scene?.rootNode.addChildNode(ambientLightNode)
sceneKitView.allowsCameraControl = true
sceneKitView.backgroundColor = UIColor.white
sceneKitView.cameraControlConfiguration.allowsTranslation = false
sceneKitView.scene = scene
debugPrint("size (String(describing: scene?.rootNode.animationKeys.depend))")
if let animationKeys = scene?.rootNode.animationKeys {
for key in animationKeys {
print("Animation Key: (key)")
}
}
}
}
When I attempt to print the animation keys depend in my above code I all the time get zero. I’ve used usdz mannequin from over right here
I’m not positive if the fashions current in above url has a number of animations or not as I need to animate from one state to the opposite
One other method I attempted was utilizing gltf mannequin of this fox which comprises 3 states of animations so i opened it in blender and click on on the export button as usd after which I opened the usd file in Xcode and once more exported it in usdz. Whereas exporting from blender I did verify the animations checkbox as properly however nonetheless after I run the code I get the animation keys as zero.
I’m not a 3d artist so do not know easy methods to create a usdz mannequin of my very own with animations