Anim8or Community
General Category => General Anim8or Forum => Topic started by: Enumer8 on February 06, 2019, 09:43:25 pm
-
Hi all,
I've been working the past several months on a converter from .an8 to .dae. I call it Anim8or Transl8or. The main reason is that my 3D artist prefers to use Anim8or, but .an8 files are not easy to import into other programs (like 3DS Max and Blender). I have self-tested the converter and am pretty satisfied with my progress. I think it is fairly robust. It turned out to be a lot more work than I originally planned, however!
Let me know what you think. You can download the latest version here: https://github.com/Enumer8/Anim8orTransl8or/releases. I get into a lot of detail about the limitations and how to use the program here: https://github.com/Enumer8/Anim8orTransl8or. Support for the Collada format in even major software is a lot worse than I original expected. I think I've found workarounds for most of the issues, but there is still plenty to be done. It would be cool if Collada support could be built into Anim8or eventually. I think my source code should be readable enough to use as an example of how it can be done.
Enjoy!
-
It takes a lot of time and motivation to study Anim8or and Collada file formats and to develop a converter. Great job!
I will test your program with Unity :)
-
Unity seems to have good support for loading animations from multiple dae files. It was pretty simple to create an animation controller and use them. Neat. Unity also renders transparency like 3DS Max and like how I expect from the COLLADA specification. I think Blender is simply wrong in how it renders it.
Another thing I would like to fix is that sometimes a bone will interpolate in exactly the wrong direction. This time, Blender interpolates it in the direction I expect and Autodesk and Unity interpolate opposite. I understand the basic problem, and this is how I handle it in my own engine that I am developing:
constexpr const Quaternion LinearInterpolation(
const Quaternion& a,
const Quaternion& b,
const Real32 t)
{
// Take the shortest path
if ( Dot(a, b) >= 0 )
{
return Normalize(a + (b - a) * t);
}
else
{
return Normalize(a + (-b - a) * t);
}
}
I'm wondering if there is something I can do in the actual output dae file to make 3ds Max and Unity to work.
-
Had a go with a simple animated anim8or rig and viola it appeared in blender. 8)
-
I published a new version of the converter. This new version supports multiple materials. Sadly, after much investigation, I was not able to prevent Unity from sometimes interpolating in the opposite direction. I thought maybe inserting some extra key frames in the middle to prevent a large change in angle would fix it, but it still goes the wrong way.
-
In the past i made simple 3D engine base on DX9 and i used an8 file format as my main format for it, im not sure if it will help but i had similar problem and to solve that i had to calculate Quaternion in different order...
For I := 0 To High(SequenceArray[LastSequence].FrameArray) Do
Begin
//MAKE QUATERNION FROM AXIS (Y-Z-X ORDER)
QRotationY(Qy,SequenceArray[LastSequence].FrameArray[I].Bones[J].y*(Pi/180));
QRotationZ(Qz,SequenceArray[LastSequence].FrameArray[I].Bones[J].z*(Pi/180));
QRotationX(Qx,SequenceArray[LastSequence].FrameArray[I].Bones[J].x*(Pi/180));
D3DXQuaternionMultiply(Qy,Qy,Qz);
D3DXQuaternionMultiply(Qy,Qy,Qx);
D3DXQuaternionNormalize(SequenceArray[LastSequence].FrameArray[I].Bones[J],Qy);
End;
Base on my old source code right order is Y * Z * X