Havok binary files
Posted: Mon May 18, 2015 5:19 am
Hello! I would like to ask, can anyone help me with converting 2013 Havok binary skeleton/animation files to a usable format, or at least to Havok ASCII?
I have the format pretty much figured out, I just haven't the foggiest idea on how to convert it to something usable.
Here's some sample animations and a skeleton.
There is already a Blender importer, but it only works for the 2012 version. However, the 2011 and 2013 formats are very similar, so I can't imagine there's a large difference between 2012 and 2013.
The animations use hkaSplineCompressedAnimation. Here's some info we got so far:
More definitions here.
And if you look at the ASCII example in the link at the top, it corresponds to this part here:
It's from 2010 though, which as you can see is very different from the 2013 layout.
I have the format pretty much figured out, I just haven't the foggiest idea on how to convert it to something usable.
Here's some sample animations and a skeleton.
There is already a Blender importer, but it only works for the 2012 version. However, the 2011 and 2013 formats are very similar, so I can't imagine there's a large difference between 2012 and 2013.
The animations use hkaSplineCompressedAnimation. Here's some info we got so far:
Code: Select all
struct __cppobj __declspec(align(8)) hkaSplineCompressedAnimation : hkaAnimation
{
int m_numFrames;
int m_numBlocks;
int m_maxFramesPerBlock;
int m_maskAndQuantizationSize;
float m_blockDuration;
float m_blockInverseDuration;
float m_frameDuration;
hkArray<unsigned int,hkContainerHeapAllocator> m_blockOffsets;
hkArray<unsigned int,hkContainerHeapAllocator> m_floatBlockOffsets;
hkArray<unsigned int,hkContainerHeapAllocator> m_transformOffsets;
hkArray<unsigned int,hkContainerHeapAllocator> m_floatOffsets;
hkArray<unsigned char,hkContainerHeapAllocator> m_data;
int m_endian;
};
And if you look at the ASCII example in the link at the top, it corresponds to this part here:
Code: Select all
<hkobject name="#0042" class="hkaSplineCompressedAnimation" signature="0x792ee0bb">
<!-- memSizeAndFlags SERIALIZE_IGNORED -->
<!-- referenceCount SERIALIZE_IGNORED -->
<hkparam name="type">HK_SPLINE_COMPRESSED_ANIMATION</hkparam>
<hkparam name="duration">1.066667</hkparam>
<hkparam name="numberOfTransformTracks">30</hkparam>
<hkparam name="numberOfFloatTracks">0</hkparam>
<hkparam name="extractedMotion">#0043</hkparam>
<hkparam name="annotationTracks" numelements="0"></hkparam>
<hkparam name="numFrames">33</hkparam>
<hkparam name="numBlocks">1</hkparam>
<hkparam name="maxFramesPerBlock">256</hkparam>
<hkparam name="maskAndQuantizationSize">120</hkparam>
<hkparam name="blockDuration">8.500002</hkparam>
<hkparam name="blockInverseDuration">0.117647</hkparam>
<hkparam name="frameDuration">0.033333</hkparam>
<hkparam name="blockOffsets" numelements="1">
0
</hkparam>
<hkparam name="floatBlockOffsets" numelements="1">
4744
</hkparam>
<hkparam name="transformOffsets" numelements="0"></hkparam>
<hkparam name="floatOffsets" numelements="0"></hkparam>
<hkparam name="data" numelements="4752">
69 0 0 0 69 112 240 0 69 5 240 0 69 1 240 0
69 1 240 0 69 1 240 0 69 1 10 0 69 5 240 0
...