matching joints to their bones from <animation>

The <animation> node specifies a number of things about the joint it is affecting, but I can’t see where it has any info about which joint it is, or which bone that joint attaches to. Is there a quick way to get this information?

We have the following code in the .dae. I can’t imagine I would need to try to parse the word “joint2” out of one of these IDs.

  <library_animations>
    <animation id="joint2.matrix">
      <source id="joint2.matrix_joint2_transform-input">
        <float_array id="joint2.matrix_joint2_transform-input-array" count="61">0 0.033333 0.066666 0.099999 and so on...</float_array>
        <technique_common>
          <accessor source="#joint2.matrix_joint2_transform-input-array" count="61" stride="1">
            <param name="TIME" type="float"/>
          </accessor>
        </technique_common>
        <technique profile="MAYA">
          <pre_infinity>CONSTANT</pre_infinity>
          <post_infinity>CONSTANT</post_infinity>
        </technique>
      </source>
      <source id="joint2.matrix_joint2_transform-output">
        <float_array id="joint2.matrix_joint2_transform-output-array" count="976">1 0 0 2.1978 and so on...</float_array>
        <technique_common>
          <accessor source="#joint2.matrix_joint2_transform-output-array" count="61" stride="16">
            <param name="TRANSFORM" type="float4x4"/>
          </accessor>
        </technique_common>
      </source>
      <source id="joint2.matrix_joint2_transform-interpolations">
        <Name_array id="joint2.matrix_joint2_transform-interpolations-array" count="61">LINEAR LINEAR LINEAR and so on...</Name_array>
        <technique_common>
          <accessor source="#joint2.matrix_joint2_transform-interpolations-array" count="61" stride="1">
            <param name="INTERPOLATION" type="Name"/>
          </accessor>
        </technique_common>
      </source>
      <sampler id="joint2.matrix_joint2_transform-sampler">
        <input semantic="INPUT" source="#joint2.matrix_joint2_transform-input"/>
        <input semantic="OUTPUT" source="#joint2.matrix_joint2_transform-output"/>
        <input semantic="INTERPOLATION" source="#joint2.matrix_joint2_transform-interpolations"/>
      </sampler>
      <channel source="#joint2.matrix_joint2_transform-sampler" target="joint2/transform"/>
    </animation>
  </library_animations>

I’ve never implemented Collada’s skinning so I don’t know the answer off the top of my head, but there’s a skinning tutorial on the wiki that might help.

The last part of the animation is the “channel” tag. It has a “target” attribute, which is a “simple path” into the scene graph. You will note that the simple path specifies the node “joint2” and the sub-element “transform”.

If you go look at the node for “joint2” you will find a transform element, probably a “matrix” element, that is a child of joint2 and has the sid “transform”.

The joints and the nodes in the scene graph are the same thing – bone names are names (really, ids) of nodes in the scene that gets instanced; at least that seems to hold true as far as I’ve been able to tell.