Motive
I'm trying to create a small demo application using WebGL. I chose to use SceneJS, because it seemed an easy framework and would more than suffice for this purpose.
I have downloaded a couple of .blend models (Amy Rose, amongst others) and exported them as a Collada (.dae) file using Blender. Then I used scenejs-pycollada to convert them to a json model.
I just spent a couple of hours getting the scenejs-pycollada convertor to work. Apparently getting those Python dependencies to work in Windows isn't that easy if you've never used Python before. ;)
Problem
But now I'm stuck (again). My problem is that the models don't have any textures or materials.
I used the Seymour Plane Example of SceneJS. The model I converted is hardly visible. It is black and doesn't seem to respond to the lighting in the scene. If I load the plane and the model together, I can see the model is loaded, because its arms and legs are sticking out of the plane.
Now I followed a couple of tutorials that would let me export the texture as a PNG image. I then modified the texture file name in the JSON model to match the file name, but it doesn't help.
So I hope someone can help me to find a way to export Blender models (or other common 3D models) to the JSON format used by SceneJS, including the textures.
Any other method of loading models in SceneJS will do too, as long as it works.
If one 's got a link to free downloads of body/figure JSON models, that would help for now, but I rather learn how this works. :)
I'm using
- Windows 7 Home Premium 64bit
- Python 2.7 (Windows 32bit)
I chose the 32 bit version, because of seemingly better support for libraries, and more available installers. At first I mixed up 32 and 64 bit and it caused me trouble, but now everything seems to work (except for the textures, that is). - Blender 2.59
- SceneJS 0.8.0
My workflow
In Blender I export the models to Collada (*.dae) files, and then convert them to Raw JSON using scenejs-pycollada. This gives me a JSON file with two objects in it. The first seems to be the scene, the second the model. I keep the second and put it in a Javascript variable that is used in the code of the SceneJS example. The model ends with the properties , "type": "library", "parent": "Scene"
which I need to remove from the code to make it load at all.