Question about blender and crystal space

Hi guys,

I’d like to use blender to create some models for a tiny crystal space (CS) project I’m working on. It seems that CS has plugins for loading cal3D files. I wonder if someone could tell me how I can export my blender 3D models to cal3D?

These blender models don’t contain armature yet.

I have tried 2 things so far:

(1) blender2crystal plugin


I have followed the instructions to install these scripts. The blender2crystal plugin refuses to export the meshes because there is no armature involved.

The gives a python error for some undeclared variables.

I can write my own code to convert the non-armatured blender meshes to crystal space iGeneralFactoryState objects, but I’d rather not reinvent the wheel. :smiley:

Any help would be greatly appreciated.

Thanks a lot.


Hi, I use those tools a lot so I should be able to help you.
However, I recomend using Crystal Space’s skeleton based genmesh animation which is exported from b2cs.
Or is there a specific reason you need Cal3d?

Oh, thanks for the reply! I’m actually totally new to crystal space, so I actually have no idea which one I should use.

I’m just trying to find the easiest way to do character animation in CS. There is actually no documentation on how to use genmesh to do animation, so I’m not sure where to start. :o

Here is my situation: I have a bunch of mocap(bvh) files for running, walking, sitting down, etc, and I have some 3D models of human. I’d like to be able to use them in my little crystal space project so that I can animate someone walking, waving or shaking their fists in CS.

Thanks a lot!


Edit: I’m sorry that my first post actually had a different purpose. At the beginning (when I made my original post), I was having trouble loading any sort of mesh objects into crystal space. I wrote some python code which would save blender mesh data into a meta format, then load it in crystal space, and the code was very very unsuccessful, and that’s why I panicked and tried to just find a common format between blender and crystal space. Now that I’ve found out how to convert blender mesh with texture info to CS iMeshFactory, I’m starting to work on converting animated mesh models to CS.

Hi bookeater,

I just had another look at b2cs, and I’ve got the following error when I tried to run it from the script->Export menu:

Compiled with Python version 2.4.4c1.
Checking for installed Python… got it!
E: Make sure you set your CRYSTAL environment variable before loading blender.
Traceback (most recent call last):
File “<string>”, line 47, in ?
File “/home/jingy/.blender/scripts/bpymodules/b2cs/”, line 40, in ?
import spacehandlers
File “/home/jingy/.blender/scripts/bpymodules/b2cs/spacehandlers/”, line 2, in ?
import draw as _draw
File “/home/jingy/.blender/scripts/bpymodules/b2cs/spacehandlers/”, line 2, in ?
import b2cs.overlay
File “/home/jingy/.blender/scripts/bpymodules/b2cs/overlay/”, line 2, in ?
import export
File “/home/jingy/.blender/scripts/bpymodules/b2cs/overlay/”, line 4, in ?
import b2cs.gui.gui
File “/home/jingy/.blender/scripts/bpymodules/b2cs/gui/”, line 4, in ?
import gui,event,reg
File “/home/jingy/.blender/scripts/bpymodules/b2cs/gui/”, line 24, in ?
_output_file = Create(ui_keys[“output_file”])
KeyError: ‘output_file’
Saved session recovery to /tmp/quit.blend

I’m not sure I can debug other people’s python code … would you have any suggestions?

Thanks a lot.


I know the documentation isn’t great in those areas. I have gotten animations into CS , with b2cs it’s basically just use an mesh object and have an armature as the parent, with at least 1 action, probably needing all bones to have 1 or more keyframes.

The error you have could be related to the CRYSTAL enviromental variable. Other than that I’m not sure.

Is the high-lighted part in blender or CS? I’ve managed to get the cal3D exporter working with a mesh, an armature and a bunch of animations, but not b2cs.

I’m not so sure about that, I do have crystal space installed in /usr/local which should be globally available … but I will give the environment variable a go anyway.

Thanks a lot.


Hi bookeater,

I was wrong about not needing the CRYSTAL environment variable, I actually needed because I didn’t install all the executables in /usr/local/bin .

Anyway, b2cs seems to be running now, but I still cannot get it to generate genmesh that I can use. I read the tutorial and it says that I should " Set the mesh for the object to genmesh", but I don’t see the option to do so.

I can generate a “” file, which contains a “library” file and a “world” file. I’m not quit sure what they are. Furthermore, when I click the “View” button on the panel after generating the “” file, CS complains “crystalspace.maploader.parse.library: Could not open library file ‘(null)’ on VFS!”.

If you have time, could you please try converting my blender animation to animated genmesh on your machine? You can download the file that I was trying to convert from:

Thanks a lot.


When I first tried to run your file I got crashes in walktest (the default crystal space map viewer). You probably mostly needed to use all the bones in the animation, I think that is required. So here is the version that I have that worked for me.

Genmesh is set by default, but you should learn how to set it and so on.

If you are sure cal3d is working properly for you then use it instead anyway. I said don’t use it because it was hard for me to get it working properly in crystal space, I even have to write meshfact files by hand. I am having some problems with the genmesh type so I’m not sure if it’s a better choice…

Thanks man! The isotest that comes with CS actually uses skeleteon based genmesh, but I just haven’t had time to make sense of what the files actually do.

thanks a lot for all your help.