Skeleton... once and for all

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?

Example 1:


<library_nodes>
  <node id="pelvis">
    ...
  </node>
</library_nodes>
<visual_scene>
  <node>
    <instance_controller ...>
      <skeleton>#pelvis</skeleton>
    </instance_controller>
  </node>
</visual_scene>

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>).

Example 2:


<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>

Again, this shouldn’t work since I only brought the “skinned” node into the scene but neglected to bring in the “pelvis”.

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?

There’s nothing special about visual scenes that would effect this operation.

That answer is the right one. The data model is the same regardless of your application’s treatment of instantiation. Remember a <node> is merely a local coordinate system, a place, and COLLADA represents skinning in object space.

In both cases, the <node> defines a coordinate system for its children and exists in the coordinate system of its parent. In your example it’s the identity matrix.

There are several reasons to “bring” things into a visual scene. One is because some applications don’t support libraries (palettes) of things. Another is that some apps can only load things into a single scene graph.

In a COLLADA <visual_scene> the only expectation is that you are describing the things that you want to visualize. If you don’t want to visualize a skeleton then don’t instantiate it in a visual scene. Regardless of that, a <node> is always a local coordinate system that you can reference.

I hope that helps.