Difference between revisions of "HowToExportFromBlender"

From SfzWiki
Jump to: navigation, search
(guide)
Line 3: Line 3:
 
== guide ==
 
== guide ==
  
* first you need to install the blender ogre exported :  
+
* install OgreBlenderExport_v1.4.0_prefixpatch :  
** download [http://downloads.sourceforge.net/ogre/OgreBlenderExport_v1.4.0.zip?download Blender Exporter v1.4.0]
+
** download http://ghoulsblade.schattenkind.net/ogre/OgreBlenderExport_v1.4.0_prefixpatch.zip
** unpack and move the everything inside it into (win:)YOUR_BLENDER_DIR/.blender/scripts or (linux:) YOURHOME/.blender/scripts.
+
** (this is a modified version i made to automatically prefix all material names and filenames with something to avoid conflicts with other models)
** start blender
+
** unpack and move the everything inside (also subfolders) it into  
** rightclick the seperator between the 3d-view and the bottom panel and select split area
+
*** (win:) YOUR_BLENDER_DIR/.blender/scripts  
** on the left button of the new panel select "script-window"
+
*** (linux:) YOURHOME/.blender/scripts
** next to it a "scripts" button appears, you can find the exporter under "Export":"OGRE Meshes"
+
** this just exports to meshes from Blender to Ogre XML
+
** you need OgreXMLConverter contained in the [http://downloads.sourceforge.net/ogre/OgreCommandLineTools_v1.4.0.msi?download OgreCommandLineTools_v1.4.0.msi] to turn the XML (item.mesh.xml) into a runtime binary mesh (item.mesh).
+
*** set the path to the OgreCommandLineTools folder in the blender mesh exported window under preferences : click manual
+
** you also need to get a full python installation ( http://python.org )
+
  
* open the .blend file you want to export (or close blender and start it by double clicking the .blend file)
+
* install python
* select the object you want to export using rightclick (you can only export single objects, but you can make multiple subobjects somehow)
+
** for win : http://python.org/download/ : Python 2.5.1 Windows installer
* on the lowest panel, select "buttons window" on the menu on the left.
+
** for linux : "apt-get install python" or something like that
* on the "Panels" menu next to it select "Object"
+
* set a unique object name in the panel on the lower left (avoid spaces and special letters, something like ke_gpl_biotube01 is good)
+
* on the "Panels" menu select "Editing"
+
* in the "Link and Materials" panel, change the name to somethimg meaningful, like ke_gpl_biotube01
+
  
* on the "Panels" menu select "Shading":"Material"
+
* install OgreXMLConverter :
* on the second subtab, "Links and Pipeline", edit the name of every material to start with something unique for this model, like "ke_biotube_mat0", to avoid conflicts with materials of other models
+
** for win : [http://downloads.sourceforge.net/ogre/OgreCommandLineTools_v1.4.0.msi?download OgreCommandLineTools_v1.4.0.msi]
 +
** for linux : OgreXMLConverter is included in the ogre package or the ogre source
  
* if you have renamed some texture files :
 
** on the "Panels" menu select "Shading":"Texture"
 
** correct the imagepath of every texture using images
 
  
* rename all texture filenames to be prefixed with something unique for the model, e.g. ke_gpl_biotube01_tex.png
+
* open the .blend file you want to export (e.g. double click the .blend file)
** adjust file path references in the blender model
+
* select the object you want to export using rightclick
 +
** (you can only export single objects, but you can make multiple subobjects somehow)
  
* export :
+
* open the "script-window"
** in the script view panel, select "Scripts":"Export":"OGRE Meshes"
+
** rightclick the seperator between the 3d-view and the bottom panel and select split area
** change "Material File: Scene.material" to a better filename, like ke_gpl_biotube01.material
+
** on the left button of the new panel select "script-window"
 +
** next to it a "scripts" button appears, select "Scripts":"Export":"OGRE Meshes" there
 +
** enter a unique prefix for you model and materials in the line saying "Prefix all names with this :"
 +
*** (avoid spaces and special letters, something like ke_gpl_biotube_ is good)
 
** the broad "copy texture" button should be active/pressed
 
** the broad "copy texture" button should be active/pressed
** select a directory where to export (.material and .mesh file, and materials are also copied, i suggest an empty directory)
+
** select a directory where to export  
 +
*** creates multiple files, .material and .mesh file, and texture images are also copied
 +
*** i suggest using a new empty directory
 
** the "OgreXMLConverter" button should be active/pressed so we get a .mesh instead of a .xml
 
** the "OgreXMLConverter" button should be active/pressed so we get a .mesh instead of a .xml
 
** hit export
 
** hit export
** if you only got a .mesh.xml file, but no .mesh file, then the exporter couldn't locate the path to the OgreXMLConverter, see OgreCommandLineTools_v1.4.0.msi above.
+
** if you only got a .mesh.xml file, but no .mesh file, then the exporter couldn't locate the path to the OgreXMLConverter
 
+
*** to fix this, click "Preferences"
 +
*** in "OgreXMLConverter Location" : click "Manual"
 +
*** on win : select the path to the OgreXMLConverter.exe , e.g. C:\OgreCommandLineTools\OgreXmlConverter.exe
 +
*** if you can't find it you need to install OgreCommandLineTools_v1.4.0.msi , see above
  
 
* the model will probably have to be rescaled, recentered and rotated ... see below
 
* the model will probably have to be rescaled, recentered and rotated ... see below
  
*see [[HowToTestModelsIngame]]
+
* see [[HowToTestModelsIngame]]
 +
 
 +
 
 +
== restrictions ==
 +
 
 +
* texture images should have a size that is a power of two, e.g. 32,64,128,256,512,1024,...
 +
* don't make textures too large to save video ram ingame, 256x256 should be enough for most things, but please keep a backup of the original high-res texture
 +
* most blender texture effects and shaders will not work ingame, a plain texture is the easiest to get to work
  
 
== old notes ==
 
== old notes ==

Revision as of 12:54, 23 August 2007

just a few notes on exporting, we should make a proper tutorial someday

guide

  • install OgreBlenderExport_v1.4.0_prefixpatch :
  • install python
    • for win : http://python.org/download/ : Python 2.5.1 Windows installer
    • for linux : "apt-get install python" or something like that


  • open the .blend file you want to export (e.g. double click the .blend file)
  • select the object you want to export using rightclick
    • (you can only export single objects, but you can make multiple subobjects somehow)
  • open the "script-window"
    • rightclick the seperator between the 3d-view and the bottom panel and select split area
    • on the left button of the new panel select "script-window"
    • next to it a "scripts" button appears, select "Scripts":"Export":"OGRE Meshes" there
    • enter a unique prefix for you model and materials in the line saying "Prefix all names with this :"
      • (avoid spaces and special letters, something like ke_gpl_biotube_ is good)
    • the broad "copy texture" button should be active/pressed
    • select a directory where to export
      • creates multiple files, .material and .mesh file, and texture images are also copied
      • i suggest using a new empty directory
    • the "OgreXMLConverter" button should be active/pressed so we get a .mesh instead of a .xml
    • hit export
    • if you only got a .mesh.xml file, but no .mesh file, then the exporter couldn't locate the path to the OgreXMLConverter
      • to fix this, click "Preferences"
      • in "OgreXMLConverter Location" : click "Manual"
      • on win : select the path to the OgreXMLConverter.exe , e.g. C:\OgreCommandLineTools\OgreXmlConverter.exe
      • if you can't find it you need to install OgreCommandLineTools_v1.4.0.msi , see above
  • the model will probably have to be rescaled, recentered and rotated ... see below


restrictions

  • texture images should have a size that is a power of two, e.g. 32,64,128,256,512,1024,...
  • don't make textures too large to save video ram ingame, 256x256 should be enough for most things, but please keep a backup of the original high-res texture
  • most blender texture effects and shaders will not work ingame, a plain texture is the easiest to get to work

old notes

resizing, rotating and recentering has to be done in blender until we find the time to implement an editor for something like this in sfz.

  • press n : transform window,
    • set pos to 0
    • lower right of the transform window should be near 1,1,1 for one ingame tile (press s to scale the model)
  • move the middlepoint to a position on the grid
  • go to edit mode and move the mesh so that it is aligned to a unit-sized grid