I have had skinned models (i.e. instance_controller) loading properly for quite some time from COLLADA but there never ceases to be surprises with the <skeleton>. I believe I have the loading working 99% correctly but I do have a new question.
What happens when the skeleton references a node outside the VisualScene?
In many of the replies to the "what the he!! do I do with a <skeleton>", the seemingly favorite answer is "use it as a root to 'search' for joint sids". This is all well and good but since a <skeleton> is a URI and can point anywhere what happens if it points to something that is not instantiated?
In my examination this scene wouldn't be able to load since the "pelvis" doesn't actually exist in the scene (it is only in the <library_nodes>).Code :<library_nodes> <node id="pelvis"> ... </node> </library_nodes> <visual_scene> <node> <instance_controller ...> <skeleton>#pelvis</skeleton> </instance_controller> </node> </visual_scene>
Again, this shouldn't work since I only brought the "skinned" node into the scene but neglected to bring in the "pelvis".Code :<library_nodes> <node id="pelvis"> ... </node> <node id="skinned"> <instance_controller ...> <skeleton>#pelvis</skeleton> </instance_controller> </node> </library_nodes> <visual_scene> <node> <instance_node url="#skinned"/> </node> </visual_scene>
A final example to think about would be the case where "skinned" is in another document's <visual_scene> and "pelvis" in another document's <library_nodes>.
So, am I supposed to "instance" the nodes referenced from <skeleton>s? (i.e copy them into the current scene). This surely doesn't seem to work when the node is already in my current <visual_scene>. And would be inconsistent with my current exporter, COLLDAMaya (although the exporter may be incorrect).
If I am not supposed to "instance" the <node>s referenced from <skeleton>s then what is the use of it being a full URI? It seems better served to make it an ID or a COLLADA target address that is required to work from the enclosing <visual_scene> or <library_nodes>. Actually I don't think that is restrictive enough since it can produce some of the same failings.
Maybe I am just completely confused and missing the big picture altogether. Although, whatever way is correct I have scoured the COLLADA spec, this website, and the Internet and found this topic to be woefully under-documented.
Can somebody please enlighten me?