"Hello,
Based on these threads
forums developer apple com/thread/65240
stackoverflow.com/questions/27233066/how-to-create-a-scenekit-scnskinner-object-in-code
documentation SLASH scenekit SLASH scnskinner
I've also searched and googled until I ended up at Chiinese gaming sites trying to figure out how to dynamically animate a figure/mesh that has bones. I do not want to load pre-existing animations but dynamic based on user input, ie., mouse, tap, gamepad, etc. Even the Chinese didn't figure this out from the posts.
My model is from blender, .dae, using a cmu model of 53 bones, it is low poly with textures, I also created a *.bvh file which has all of the nodes, joints, connections, etc. I do not want to convert it to .scn
In Xcode 9.1/9.2, there are no issues with the dae file, as I can view all the attributes, examine the bones, nodes, mesh. Based on the very limited documenation, here's where I am with my code.
i
import SceneKit
import QuartzCore
public class BadMofo: SCNNode
{
public class func getCharacaterNodes(nameDae: String = "BadMofo")
{
let sceneBadMoFo:SCNScene = SCNScene(named: "\(nameDae).scnassets/\(nameDae).dae")!
debugPrint(sceneBadMofo.rootNode.skinner!.skeleton!.name!)
let parentNode:SCNNode = SCNNode()
for skinnedNodes in sceneBadMofo.rootNode.childNodes
{
parentNode.addChildNode(skinnedNodes)
debugPrint(skinnedNodes.name!)
}
let bones = sceneBadMofo.rootNode.skinner?.bones
let weights = sceneBadMofo.rootNode.skinner?.boneWeights
let indices = sceneBadMofo.rootNode.skinner?.boneIndices
debugPrint(bones.debugDescription)
debugPrint(weights.debugDescription)
debugPrint(indices.debugDescription)
}My SceneGraph has all the bones starting with "Hips". the mesh has 3924 vertices and 1308 polygons. No light, no other characters.
Yet when I run the code, I get the following error, I'm running this on a iPad, not a simulator.
"[DYMTLInitPlatform] platform initialization successful
Metal GPU Frame Capture Enabled
Metal API Validation Enabled
[SceneKit] Error: C3DSkinnerUpdateJointsAndBoundingBox skinner has no mesh
I've tried to track down this error but no joy.
Thanks for the help.