Difference between revisions of "Exporting from Blender to Bones"

From JPCT
Jump to: navigation, search
(Creation)
 
 
(3 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
* [http://www.blender.org/download/get-blender/ Blender] this guide was written with the latest Blender to date: 2.61. It should work on all 2.6x in general.
 
* [http://www.blender.org/download/get-blender/ Blender] this guide was written with the latest Blender to date: 2.61. It should work on all 2.6x in general.
 
* [http://code.google.com/p/blender2ogre/ blender2ogre] Blender export 2.6x plugin (It needs Ogre Command Line tools, but since you only need the .xml files you don't need them)
 
* [http://code.google.com/p/blender2ogre/ blender2ogre] Blender export 2.6x plugin (It needs Ogre Command Line tools, but since you only need the .xml files you don't need them)
* [http://www.aptalkarga.com/bones/bones_beta.zip Bones beta version]
+
* [http://www.aptalkarga.com/bones/ Bones]
 
+
  
 
== Preparing ==
 
== Preparing ==
1. Place your model AND armature in position 0,0,0. Then, ensure it's applied: Ctrl+A_key and select Location from the menu.
+
# Place your model AND armature in position 0,0,0. Then, ensure it's applied: Ctrl+A_key and select Location from the menu.
2. Set the rotation and scale of your model as you want it, and then apply (Ctrl+A_key, Select Rotation and Scale).  
+
# Set the rotation and scale of your model as you want it, and then apply (Ctrl+A_key, Select Rotation and Scale). # If your model doesn't have it, create a Root Bone: This is a bone that is parent to every other bone in your armature. You don't need to connect it to the rest though, and can leave the offset. It must have it's head in 0,0,0 and tail in x=0,y=0,z=1
3. If you don't have it, create a Root Bone: This is a bone that is parent to every other bone in your armature. You don't need to connect it to the rest though, and can leave the offset. It must have it's head in 0,0,0 and tail in x=0,y=0,z=1
+
# EVERY vertex NEEDS to be part of a vertex group/bone or it won't get exported causing the loss of every face that contains it.
4. EVERY vertex NEEDS to be part of a vertex group/bone or it won't get exported causing the loss of every face that contains it.
+
# No mesh can have more than 1 material, it's recommended to split them in this case: Go to edit mode for that object, select all vertices (A_key), split (P_key), and select "By material". All your weights are preserved, so no further work is needed.
5. No mesh can have more than 1 material, it's recommended to split them in this case: Go to edit mode for that object, select all vertices (A_key), split (P_key), and select "By material". All your weights are preserved, so no further work is needed.
+
# It is recommended to have all your textures in a relative path. If they are not, just move them to the folder in which your .blend file is, or another folder inside that folder, and choose them again as though you were searching for another image file.
6. It is recommended to have all your textures in a relative path. If they are not, just move them to the folder in which your .blend file is, or another folder inside that folder, and choose them again as though you were searching for another image file.
+
# It is also recommended to start your animation in frame 0. You can move all your animation at once with a Border Select on the Dopesheet, or NLA Editor with G_key
7. It is also recommended to start your animation in frame 0. You can move all your animation at once with a Border Select on the Dopesheet, or NLA Editor with G_key
+
# Your model doesn't need to be in Rest Position when exporting.
8. Your model doesn't need to be in Rest Position when exporting.
+
# Be sure you installed the blender2ogre plugin either by moving it to the scripts folder, or from the User Preferences by installing it (the recommended way)
9. Be sure you installed the blender2ogre plugin either by moving it to the scripts folder, or from the User Preferences by installing it (the recommended way)
+
  
 
== Exporting ==
 
== Exporting ==
1. Go to File>Export>Ogre3D(.scene and .mesh) (if this option doesn't appear, the plugin is either not installed or enabled, so go to User Preferences)
+
# Go to File>Export>Ogre3D(.scene and .mesh) (if this option doesn't appear, the plugin is either not installed or enabled, so go to User Preferences)
2. To the left, you have System, then Bookmarks, followed by Recent, and finally Export Ogre which contains the options for the exporter: It is recommended to uncheck "Export Scene", "Force Camera" and "Force Lamps" as you won't need the .scene file.
+
# To the left, you have System, then Bookmarks, followed by Recent, and finally Export Ogre which contains the options for the exporter: It is recommended to uncheck "Export Scene", "Force Camera" and "Force Lamps" as you won't need the .scene file.
3. Select any name to export to, it won't be the name of any file you need as that's the name of the .scene file. Just be sure NOT to name it like any file you need, i.e: my_model.mesh.xml or my_model.skeleton.xml (if you followed step 2, there will actually be NO file output with the name entered)
+
# Select any name to export to, it won't be the name of any file you need as that's the name of the .scene file. Just be sure NOT to name it like any file you need, i.e: my_model.mesh.xml or my_model.skeleton.xml (if you followed step 2, there will actually be NO file output with the name entered)
4. As output you'll get 1 .mesh.xml and 1 .skeleton.xml for each object you had selected when the export script executed (So, be sure to have selected the object(s) you wanted to export. You don't need to have their armature selected. The script also has an option to export all objects: Uncheck "Export Selected Only")
+
# As output you'll get 1 .mesh.xml and 1 .skeleton.xml for each object you had selected when the export script executed (So, be sure to have selected the object(s) you wanted to export. You don't need to have their armature selected. The script also has an option to export all objects: Uncheck "Export Selected Only")
4a. You'll also get a .material and an image file for each texture you use. You'll need the image file for your program, but it's nothing different from the one you already used in Blender for the texture. The material file is not needed.
+
# You'll also get a .material and an image file for each texture you use. You'll need the image file for your program, but it's nothing different from the one you already used in Blender for the texture. The material file is not needed.
5. Pass the .mesh.xml and .skeleton.xml files to the Bones script
+
# Pass the .mesh.xml and .skeleton.xml files to the Bones script
 
Usage:
 
Usage:
JMEOgreImporter [options] -in <ogre.mesh.xml> [ogre.mesh.xml...]  
+
 
 +
JMEOgreImporter [options] -in <ogre.mesh.xml> [ogre.mesh.xml...]
 +
 
 
Example:
 
Example:
 +
 
JMEOgreImporter -out myFile.bones -in MyOgre.mesh.xml
 
JMEOgreImporter -out myFile.bones -in MyOgre.mesh.xml
  
 
You can test your model with the LoadBonesFormatSample program in Bones's examples. Check for any missing face, and if any, go to Preparing step 4.
 
You can test your model with the LoadBonesFormatSample program in Bones's examples. Check for any missing face, and if any, go to Preparing step 4.
 +
 +
[[Category:Bones]]

Latest revision as of 23:42, 1 February 2013

Requirements

You will need

  • Blender this guide was written with the latest Blender to date: 2.61. It should work on all 2.6x in general.
  • blender2ogre Blender export 2.6x plugin (It needs Ogre Command Line tools, but since you only need the .xml files you don't need them)
  • Bones

Preparing

  1. Place your model AND armature in position 0,0,0. Then, ensure it's applied: Ctrl+A_key and select Location from the menu.
  2. Set the rotation and scale of your model as you want it, and then apply (Ctrl+A_key, Select Rotation and Scale). # If your model doesn't have it, create a Root Bone: This is a bone that is parent to every other bone in your armature. You don't need to connect it to the rest though, and can leave the offset. It must have it's head in 0,0,0 and tail in x=0,y=0,z=1
  3. EVERY vertex NEEDS to be part of a vertex group/bone or it won't get exported causing the loss of every face that contains it.
  4. No mesh can have more than 1 material, it's recommended to split them in this case: Go to edit mode for that object, select all vertices (A_key), split (P_key), and select "By material". All your weights are preserved, so no further work is needed.
  5. It is recommended to have all your textures in a relative path. If they are not, just move them to the folder in which your .blend file is, or another folder inside that folder, and choose them again as though you were searching for another image file.
  6. It is also recommended to start your animation in frame 0. You can move all your animation at once with a Border Select on the Dopesheet, or NLA Editor with G_key
  7. Your model doesn't need to be in Rest Position when exporting.
  8. Be sure you installed the blender2ogre plugin either by moving it to the scripts folder, or from the User Preferences by installing it (the recommended way)

Exporting

  1. Go to File>Export>Ogre3D(.scene and .mesh) (if this option doesn't appear, the plugin is either not installed or enabled, so go to User Preferences)
  2. To the left, you have System, then Bookmarks, followed by Recent, and finally Export Ogre which contains the options for the exporter: It is recommended to uncheck "Export Scene", "Force Camera" and "Force Lamps" as you won't need the .scene file.
  3. Select any name to export to, it won't be the name of any file you need as that's the name of the .scene file. Just be sure NOT to name it like any file you need, i.e: my_model.mesh.xml or my_model.skeleton.xml (if you followed step 2, there will actually be NO file output with the name entered)
  4. As output you'll get 1 .mesh.xml and 1 .skeleton.xml for each object you had selected when the export script executed (So, be sure to have selected the object(s) you wanted to export. You don't need to have their armature selected. The script also has an option to export all objects: Uncheck "Export Selected Only")
  5. You'll also get a .material and an image file for each texture you use. You'll need the image file for your program, but it's nothing different from the one you already used in Blender for the texture. The material file is not needed.
  6. Pass the .mesh.xml and .skeleton.xml files to the Bones script

Usage:

JMEOgreImporter [options] -in <ogre.mesh.xml> [ogre.mesh.xml...]

Example:

JMEOgreImporter -out myFile.bones -in MyOgre.mesh.xml

You can test your model with the LoadBonesFormatSample program in Bones's examples. Check for any missing face, and if any, go to Preparing step 4.