Difference between revisions of "Direct Export from Blender"

From Horde3D Wiki
Jump to: navigation, search
 
(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
A [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/trunk/Tools/Exporters/Blender/ new exporter] for blender 2.63+ has been developed in the [[Community Branch | Community SVN Branch]], and can be found at the links below.
 +
more information can be found in user_docu.pdf in the community svn
 +
 +
 +
 +
[[==== TODO Check compatibility of Blender 2.5 collada tools with ColladaConv and if there are still bugs within Blender's Collada exporter, adjust the Blender Horde direct export for Beta5 compatibility ====]]
 +
Small update: Exporting static geometry using Blenders Collada exporter and converting
 +
it with the Horde ColladaConverter seems to work.
 +
I was not able to successfully export a small animation using keyframes (no bones). - Blender 2.63a, Roland
 +
 +
New Update: I've ran into some weird problems regarding normals and duplicated geometry
 +
  and therefore switched back to 3dsMax using Blender's fbx exporter.
 +
== Exporter ==
 +
 
Unfortunately, Blender's built-in Collada exporter is not fully compatible with Horde's ColladaConverter tool.  
 
Unfortunately, Blender's built-in Collada exporter is not fully compatible with Horde's ColladaConverter tool.  
  
A [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/trunk/Tools/Exporters/Blender/ new exporter] is under development in the [[Community Branch | 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.
 
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.
Line 12: Line 26:
  
 
[[Image:BlenderExport2.jpg]]
 
[[Image:BlenderExport2.jpg]]
 +
 +
== Settings ==
  
 
<ul>
 
<ul>
Line 21: Line 37:
 
<li>All textures used by your model will be copied to the '''Relative texture path'''.</li>
 
<li>All textures used by your model will be copied to the '''Relative texture path'''.</li>
 
</ul>
 
</ul>
 +
 +
Note that 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''.
 +
 +
== Animations ==
 +
 +
The exporter supports three types of ''animations'':
 +
 +
<ul>
 +
<li>''Mesh animations'': They are exported by playing the ''timeline'' from currently setted frame ''start'' to frame ''end'' and - in every frame - writing the transformations of all objects in the *.anim file. You can use keyframes for that.</li>
 +
 +
<li>''Bone animations'': Work similar to ''mesh animations''. The ''bones'' are exported as ''joints'' to Horde. Because of some problems with the matrices, you should apply scale/rotation to obdata (CTRL+A,1) and set the bone's roll to zero. </li>
 +
 +
<li>''Shape keys'': are exported as ''morph targets''. You can find their names in the *.scene.xml as comment. </li>
 +
</ul>
 +
 +
== Textures and Materials ==
 +
 +
The exporter tries to create the materials in the same way as they exist in blender.
 +
As there a few differences to horde, you should currently only use one texture per material (except of bump maps). And there should only be one material per object.
 +
Note: not all shaders support joints and not all shaders support transparency! So you have to choose them carefully.
 +
 +
If you don't want to use textures but static material colors ( Note, no procedural textures! ), you have to use 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 exactly use this uniform name, currently ''Materialcol''. If you want to use the material color you might try using the [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/assets/Horde3D/shaders/materialCol.shader.xml materialCol.shader.xml] (an updated version for Beta5 can be found here: [http://www.horde3d.org/forums/download/file.php?id=353]) in place of standard.shader.xml or [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/assets/Horde3D/shaders/materialCol.shader.xml skinningMatcol.shader.xml] in place of skinning.shader.xml. You can find them in the
 +
[[Community Branch | Community SVN Branch]]
 +
To add your exported model to a scene and fine tune your shaders and materials you could use the [[Horde3D Scene Editor | 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 [http://horde3d.org/forums/viewtopic.php?f=8&t=362 forum's thread].
 
'''If you have experience with Blender and Python and want to help improving the exporter, feel free to post your comments in the [http://horde3d.org/forums/viewtopic.php?f=8&t=362 forum's thread].
 
'''
 
'''
 +
 +
== Horde3D 1.0.0 Beta3 ==
 +
 +
Due to our practical course "Spieleprogrammierung" (Game programming) at the Augsburg University we fixed some issues with the Exporter and the new Horde3D Beta 3. Our exporter uses the new shader/texture settings in the *.material.xml and can be found <s>[http://megastore.uni-augsburg.de/get/064A1gmWZg/ here]</s> <i>Unfortunately the link is dead, maybe someone can adjust the exporter in the community branch to work with Beta4 out of the box</i>
 +
 +
It's only tested with the following settings, others may not work properly:
 +
 +
http://img3.abload.de/img/exportsettingsoc5y.png
 +
 +
''Shader'' is automatically set to ''shaders/model.shader'' and ''F01_Skinning''. For parallax shading, etc. you need to change the *.material.xml.

Latest revision as of 21:44, 17 April 2013

A new exporter for blender 2.63+ has been developed in the Community SVN Branch, and can be found at the links below. more information can be found in user_docu.pdf in the community svn


==== TODO Check compatibility of Blender 2.5 collada tools with ColladaConv and if there are still bugs within Blender's Collada exporter, adjust the Blender Horde direct export for Beta5 compatibility ====

Small update: Exporting static geometry using Blenders Collada exporter and converting
it with the Horde ColladaConverter seems to work.
I was not able to successfully export a small animation using keyframes (no bones). - Blender 2.63a, Roland
New Update: I've ran into some weird problems regarding normals and duplicated geometry
 and therefore switched back to 3dsMax using Blender's fbx exporter. 

Exporter

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


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

Settings

  • 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.

Note that 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.

Animations

The exporter supports three types of animations:

  • Mesh animations: They are exported by playing the timeline from currently setted frame start to frame end and - in every frame - writing the transformations of all objects in the *.anim file. You can use keyframes for that.
  • Bone animations: Work similar to mesh animations. The bones are exported as joints to Horde. Because of some problems with the matrices, you should apply scale/rotation to obdata (CTRL+A,1) and set the bone's roll to zero.
  • Shape keys: are exported as morph targets. You can find their names in the *.scene.xml as comment.

Textures and Materials

The exporter tries to create the materials in the same way as they exist in blender. As there a few differences to horde, you should currently only use one texture per material (except of bump maps). And there should only be one material per object. Note: not all shaders support joints and not all shaders support transparency! So you have to choose them carefully.

If you don't want to use textures but static material colors ( Note, no procedural textures! ), you have to use 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 exactly use this uniform name, currently Materialcol. If you want to use the material color you might try using the materialCol.shader.xml (an updated version for Beta5 can be found here: [1]) in place of standard.shader.xml or skinningMatcol.shader.xml in place of skinning.shader.xml. You can find them in the Community SVN Branch 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.

Horde3D 1.0.0 Beta3

Due to our practical course "Spieleprogrammierung" (Game programming) at the Augsburg University we fixed some issues with the Exporter and the new Horde3D Beta 3. Our exporter uses the new shader/texture settings in the *.material.xml and can be found here Unfortunately the link is dead, maybe someone can adjust the exporter in the community branch to work with Beta4 out of the box

It's only tested with the following settings, others may not work properly:

exportsettingsoc5y.png

Shader is automatically set to shaders/model.shader and F01_Skinning. For parallax shading, etc. you need to change the *.material.xml.