Difference between revisions of "HowToExportFromBlender"

From SfzWiki
Jump to: navigation, search
(restrictions)
 
(17 intermediate revisions by one user not shown)
Line 1: Line 1:
 
just a few notes on exporting,  we should make a proper tutorial someday
 
just a few notes on exporting,  we should make a proper tutorial someday
  
* first you need to install the blender ogre exported :  
+
== guide ==
** download [http://downloads.sourceforge.net/ogre/OgreBlenderExport_v1.4.0.zip?download Blender Exporter v1.4.0]
+
 
** unpack and move the everything inside it into (win:)YOUR_BLENDER_DIR/.blender/scripts or (linux:) YOURHOME/.blender/scripts.
+
* install OgreBlenderExport_v1.4.0_prefixpatch :  
** rightclick into a free place of the bottom-panel and select split area
+
** download http://ghoulsblade.schattenkind.net/ogre/OgreBlenderExport_v1.4.0_prefixpatch.zip
 +
** (this is a modified version i made to automatically prefix all material names and filenames with something to avoid conflicts with other models)
 +
** unpack and move the everything inside (also subfolders) it into  
 +
*** (win:) YOUR_BLENDER_DIR/.blender/scripts  
 +
*** (linux:) YOURHOME/.blender/scripts
 +
 
 +
* install python
 +
** for win : http://python.org/download/ : Python 2.5.1 Windows installer
 +
** for linux : "apt-get install python" or something like that
 +
 
 +
* install OgreXMLConverter :
 +
** 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
 +
 
 +
 
 +
* 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"
 
** on the left button of the new panel select "script-window"
** next to it a "scripts" button appears, you can find the exporter under "Export":"OGRE Meshes"
+
** next to it a "scripts" button appears, select "Scripts":"Export":"OGRE Meshes" there
** this just exports to meshes from Blender to Ogre XML
+
** enter a unique prefix for you model and materials in the line saying "Prefix all names with this :"
** 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).
+
*** (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
 +
** we created a specialized editor for that, see [[HowToAdjustMeshesForSFZ]]
  
 +
* see [[HowToTestModelsIngame]]
  
*lower left : link mand materials : name the model
 
*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
 
* export :
 
**select everything you want to export
 
**open python-script-list (right bottom) : export > ogre.mesh
 
**"copy texture" should be active
 
**ogremeshexporter should be active so we get a .mesh instead of a .xml
 
**hit export
 
  
*see [[HowToTestModelsIngame]]
+
== restrictions ==
  
 +
* one object ingame is one object in blender, so you have to combine multiple parts to a single object to export it
 +
** this can be done with    ctrl + j :  combine objects
 +
* 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
  
 +
== tips ==
  
* this forum thread in iris2 about exporting ogre models might also be interesting : http://www.iris2.de/forums/viewtopic.php?t=1061
+
* on the lowest panel, select "buttons window" on the menu on the left.
 +
* if you want to edit object and mesh names : on the "Panels" menu select "Editing" : "Link and Materials" panel
 +
* if you want to edit material names : on the "Panels" menu select "Shading":"Material"
 +
* if you want to edit texture names and image paths : on the "Panels" menu select "Shading":"Texture"
 +
* transform window : press n
 +
**lower right of the transform window should be near 1,1,1 for one ingame tile (press s to scale the model)
 +
* this forum thread in iris2 about exporting ogre models might be interesting : http://www.iris2.de/forums/viewtopic.php?t=1061

Latest revision as of 19:10, 4 September 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


restrictions

  • one object ingame is one object in blender, so you have to combine multiple parts to a single object to export it
    • this can be done with ctrl + j : combine objects
  • 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

tips

  • on the lowest panel, select "buttons window" on the menu on the left.
  • if you want to edit object and mesh names : on the "Panels" menu select "Editing" : "Link and Materials" panel
  • if you want to edit material names : on the "Panels" menu select "Shading":"Material"
  • if you want to edit texture names and image paths : on the "Panels" menu select "Shading":"Texture"
  • transform window : press n
    • lower right of the transform window should be near 1,1,1 for one ingame tile (press s to scale the model)
  • this forum thread in iris2 about exporting ogre models might be interesting : http://www.iris2.de/forums/viewtopic.php?t=1061