Skip to main content.

Exporting to OSG

OpenSceneGraph has its own file format (.osg). There is an exporter for Blender and it can be found:

http://projects.blender.org/projects/osgexport/

If you have difficulties with download, use wget (file was corrupted when I downloaded it with Firefox).

wget http://projects.blender.org/frs/download.php/333/osgexport-2.42b.tar.gz

Extract and copy osgexport-2.42.py to your .blender/scripts/ directory.

First osg-export


Some checks before export:

Export

When you are ready to export, just choose File -> Export -> Openscengraph (.osg).

export

Then just open terminal and type: osgviewer name_you_gave.osg

Exporting multi-material objects

If you export object that has multiple material indexes, only the first index is used. Therefore you have to export them as a separate objects.

Here is a typical example:

multimat object

  1. Enter in Editmode (Tab).
  2. Press P (Separate) and select by Material.
  3. That separeates objects by material but it doesn't remove extra material indexes so you have to remove them manually.
  4. Then export as usual.

NOTE: There is a fast way to test how materials are shown in OSG. Make sure that Game -> Use Blender Materials is not selected. Then just press (P) over 3D-window. That starts Blender's game-engine and because that also doesn't support multi-materials, you can have a preview how things will look in OSG.


multiple materials in osgviewer

Texture baking

With current cvs-version of Blender textures can be baked to the uv-map.