I have a .max file of a walking character that is moving (so not animated in place). I export it using OpenCOLLADA and enable sampling of the animation. When I load and play it using Horde3D the character is animated in place (not translated as it should).
The COLLADA file does contain correct translation values for the nodes, but the .anim file does not.
I investigated a bit and found some interesting things in Converter::getNodeTransform()
The transStack looks the following:
Code:
node.transStack = [4]({sid="translation" type=1 values=0x00bd02dc ...},
{sid="rotationZ" type=2 values=0x00bd0380 ...},
{sid="rotationY" type=2 values=0x00bd0424 ...},
{sid="rotationX" type=2 values=0x00bd04c8 ...})
which appears to be correct since the node decl in the COLLADA file is:
Code:
<node id="node-Zand" name="Zand" sid="joint0" type="JOINT">
<translate sid="translation">-0.1367118 -1.029331 10.03159</translate>
<rotate sid="rotationZ">0 0 1 -78.21608</rotate>
<rotate sid="rotationY">0 1 0 -6.28271e-4</rotate>
<rotate sid="rotationX">1 0 0 1.584883</rotate>
<node id="node-Zand_Footsteps" name="Zand_Footsteps" sid="joint53" type="JOINT">
...
The elements of the transStack are iterated over to retrieve samplers:
Code:
for( unsigned int i = 0; i < node.transStack.size(); ++i )
{
int compIndex;
DaeSampler *sampler = _daeDoc.libAnimations.findAnimForTarget( node.id, node.transStack[i].sid, &compIndex );
...
This will give me a "node-Zand_translation.X-sampler", but never a "node-Zand_translation.Y-sampler" or "node-Zand_translation.Z-sampler".
So the output values for y and z are never used but they are present in the .dae file and in _daeDoc.libAnimations.
From the COLLADA file:
Code:
<source id="node-Zand_translation.Y-input">
<float_array id="node-Zand_translation.Y-input-array" count="31">0 0.03333334 0.06666667 0.1 0.1333333 0.1666667 0.2 0.2333333 0.2666667 0.3 0.3333333 0.3666667 0.4 0.4333333 0.4666667 0.5 0.5333334 0.5666667 0.6 0.6333333 0.6666667 0.7 0.7333333 0.7666667 0.8 0.8333333 0.8666667 0.9 0.9333333 0.9666666 1</float_array>
<technique_common>
<accessor source="#node-Zand_translation.Y-input-array" count="31" stride="1">
<param name="TIME" type="float"/>
</accessor>
</technique_common>
</source>
<source id="node-Zand_translation.Y-output">
<float_array id="node-Zand_translation.Y-output-array" count="31">-1.029331 -1.029331 -1.66839 -2.310763 -2.955492 -3.592182 -4.23628 -4.870735 -5.460976 -6.015109 -6.548089 -7.061303 -7.571934 -8.083939 -8.600042 -9.151761 -9.727701 -10.32779 -10.95066 -11.58309 -12.21289 -12.84714 -13.48406 -14.08366 -14.65022 -15.19554 -15.73173 -16.25819 -16.77802 -17.30676 -17.86168</float_array>
<technique_common>
<accessor source="#node-Zand_translation.Y-output-array" count="31" stride="1">
<param name="Y" type="float"/>
</accessor>
</technique_common>
</source>
<source id="node-Zand_translation.Y-interpolation">
<Name_array id="node-Zand_translation.Y-interpolation-array" count="31">LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR LINEAR</Name_array>
<technique_common>
<accessor source="#node-Zand_translation.Y-interpolation-array" count="31" stride="1">
<param name="INTERPOLATION" type="name"/>
</accessor>
</technique_common>
</source>
...
<sampler id="node-Zand_translation.Y-sampler">
<input semantic="INPUT" source="#node-Zand_translation.Y-input"/>
<input semantic="OUTPUT" source="#node-Zand_translation.Y-output"/>
<input semantic="INTERPOLATION" source="#node-Zand_translation.Y-interpolation"/>
</sampler>
...
<channel source="#node-Zand_translation.X-sampler" target="node-Zand/translation.X"/>
<channel source="#node-Zand_translation.Y-sampler" target="node-Zand/translation.Y"/>
<channel source="#node-Zand_translation.Z-sampler" target="node-Zand/translation.Z"/>