Ok, hopefully I can condense this down to something sensible. I’ve got a skinned mesh exported from Maya 7 into a Collada 1.4 file using ColladaMaya 0.90, and I’m now trying to use DOM 1.4 (patch 2) to read it into my app, but I’m having a problem. I’ve removed error checking from the code I’m posting for the sake of clarity:
domInstance_controllerRef instanceController = instanceControllerArray[i]; const domInstance_controller::domSkeleton_Array &skeletonArray = instanceController->getSkeleton_array(); domInstance_controller::domSkeletonRef skeleton = skeletonArray; xsAnyURI &skeletonRoot = skeleton->getValue(); daeElementRef skeletonRootElement = skeletonRoot.getElement();
“skeleton” appears valid, and if I query “skeletonRoot” for its Id, it replies “root” (which is indeed the root of the exported skeleton), but “skeletonRootElement” comes back NULL, which surprised me.
Now, if I want to get to the skin from the controller, I do:
xsAnyURI controllerURL = instanceController->getUrl(); daeElementRef controllerElement = controllerURL.getElement();
Then I type-check controllerElement, and cast it to domController, and then query it for its skin. That part seems to work.
Now, I could go ahead and search out the joint named “root” myself, but it seemed the point of having this available from the skeleton was so that wouldn’t be necessary - that I could immediately get a pointer to the appropriate root joint node from within a visual_scene.
FWIW, I can get the joint array from the skin, and iterate over that without problem.
So, is the skeleton->getValue() call only intended to provide the name of the root element, and the app is intended to search through the bound skin bones to find it?
If so, why is the getValue() call returning an xsAnyURI instead of an xsID (or some other alias of daeString)?
Anyways, assuming that I need to search for the joint, should just do a tree search through the nodes of the visual_scene that’s the grandparent of the instance_controller for a joint node that has a matching name?
Or, is there some really obvious thing I’m missing that would cut through all this?