[Crystal-develop] Converting cal3d files to CS
Ralph Campbell
2014-11-08 17:51:03 UTC
I see that the latest cal3d doesn't have the same file format.
I'm interested in converting PlaneShift's cal3d files to something that
Crystalspace supports directly. I have developer access to both SVN
I was talking to Jorrit on IRC and he said I should contact Christian
Reiniger but the email address I have (***@touva.be) doesn't seem to

Anyone have suggestions how I should go about it?
I see the data in data/frankie and I can use cal3d/src/cal3d_converter
to dump the binary cal3d files so I think it is mostly a matter
of converting the XML formats.

Christian Van Brussel
2014-11-10 12:01:09 UTC
Hi Ralph,

I'm the Christian you were looking for.

It can effectively be quite straightforward to convert the data from
cal3d to animeshes. Since this data is mostly the same in both format,
this can effectively be mostly a matter of XML syntax.

However, there are quite a lot of different data types to export:
vertices, normals, meshes, submeshes, materials, weight map, skeleton,
morph targets, animations.

So this may not be that complex but can still require quite a lot of

Instead of converting from cal3D, it is possible to use another format
then load it into CS using its Assimp plugin. Is Planeshift still using
models designed in 3DS Max? In that case you can export it eg in .3ds
or.obj then load it transparently thanks to Assimp. The trunk version of
Assimp can also handle FBX files, which is probably a better choice for
animated models.

Otherwise, if you still plan to write a cal3d/animesh converter, then
you can have a look at the animesh XML loader (the mesh loader is in
plugins/mesh/animesh/persist/standard/, the skeleton and animation
loader is in plugins/mesh/animesh/persist/skeleton2/), or at the Blender
export script (mostly in scripts/blender/io_scene_cs/io/object.py).

Feel also free to ask questions if you need more information.