I have a software and I am writing a module to export the animation of an object to several formats. Collada is one of them.
Other formats use the sane way of representing an animation by defining time and value of an item.
Collada choses the difficult way. Instead of creating a bezier representation of a curve and put that on the exported file, it should export just the time/values pair and let to the 3D application the task of creating the bezier curve for that animation.
The keyframes I have are not near enough, so I need it bezier.
What I have now is N values of time values (where the keyframes are) and N values for a given variable.
Now I need to export this and generate a Collada file. Forget Blender. I need a Collada file that can be read in any 3D package and reproduce the same animation.
So again, what I have is: N keyframes (each keyframe is a value plot on a time scale). In my example, the animation goes in a bezier way thru these N keyframes.
I just need a way to convert N (time/value) pairs in X bezier points that COLLADA requires.
This is how Blender wrote a camera animation I did
<animation id="Camera-rotateZ" name="Camera-rotateZ">
<source id="Camera-rotateZ-input">
<float_array count="5" id="Camera-rotateZ-input-array">0.04000 2.64000 5.52000 8.56000 11.60000</float_array>
<technique_common>
<accessor count="5" source="#Camera-rotateZ-input-array" stride="1">
<param type="float" name="TIME"></param>
</accessor>
</technique_common>
</source>
<source id="Camera-rotateZ-output">
<float_array count="5" id="Camera-rotateZ-output-array">0.00000 100.80463 -75.96180 75.78278 -157.80836</float_array>
<technique_common>
<accessor count="5" source="#Camera-rotateZ-output-array" stride="1">
<param type="float" name="ANGLE"></param>
</accessor>
</technique_common>
</source>
<source id="Camera-rotateZ-interpolation">
<Name_array count="5" id="Camera-rotateZ-interpolation-array">BEZIER BEZIER BEZIER BEZIER BEZIER</Name_array>
<technique_common>
<accessor count="5" source="#Camera-rotateZ-interpolation-array" stride="1">
<param type="Name" name="ANGLE"></param>
</accessor>
</technique_common>
</source>
I don’t see any indication here, of the time values I mentioned on my original question. What I see is these strange numbers 0.04, 2.64, etc… How these numbers were calculated
Why I need my script to work like Blender? Simple: because I tested importing this script in other 3D packages and all packages imported my original animation perfectly. So, Blender is doing a fine representation of the animation.
EDIT: there’s an error on my original post. The time for the last keyframe is 290, not 250.