Direct Export from Blender

From Horde3D Wiki
Revision as of 13:10, 16 November 2008 by Volker (talk | contribs)
Jump to: navigation, search

Unfortunately, Blender's built-in Collada exporter is not fully compatible with Horde's ColladaConverter tool.

A new exporter is under development in the Community SVN Branch, and can be found at the links below. Currently the exporter does export animations, but only in special configurations.

The new exporter is based on a python script for blender. To use it just save the Horde3DExport.py file to your Blender's .blender\scripts directory. After that you may have to restart your Blender application.

After restarting Blender there is a new Option Horde3D in the Export menu.

BlenderExport.jpg

If you select this new option, a dialogue window will be opened for choosing the destination of the converted content.

BlenderExport2.jpg

  • The Export Filename defines the directory and filename used for the model and the geometry file.
  • The Shader defines the shader used within the material files used by the exported model.
  • The Relative material path will be used for the Horde3D material files. Note that an additional subdirectory for the exported model will be created. It will be named using the base name of the export filename.
  • The Relative animation path will be used for any exported animation files
  • A Texture subdirectory can be specified when you want to move all textures used by this model to its own directory within the relative texture path. Otherwise the textures will be copied directly to the texture path (may be useful if you use the same textures in several models
  • All textures used by your model will be copied to the Relative texture path.

There are currently some small problems concerning the path settings. If you create the scene graph- and geometry file in a subdirectory of your Horde3D Geometry and/or Scene Graph path, the exporter won't recognize that and links the geometry file within the scene graph as if there is no sub directory. That's why the example above will create a cube.scene.xml in the Cube subdirectory that contains a link to a cube.geo without the additional subdirectory cube. Something that should be fixed in a future version of the exporter.

Another thing that could be improved is the export of material colors. Normally Horde3D requires materials with textures and UV mapping. If you don't use textures but static material colors ( Note, no procedural textures! ) you can use them anyway if you're using a special shader for them. By default the exporter writes the material color for geometry that don't have textures as a uniform to the material files. If you want to use these uniforms the shader must use exactly this uniform name. In a future version the exporter should always use the same uniform name to allow reuse of the same shader. Currently it uses the name of the material in Blender that of course won't be always the same.

To add your exported model to a scene and fine tune your shaders and materials you could use the Horde3D Editor.

If you have experience with Blender and Python and want to help improving the exporter, feel free to post your comments in the forum's thread.