= Exporting Models as Ogre XML meshes from Blender
:author: mitm
:revnumber: 2.1
:revdate: 2020/07/24


[TIP]
====
xref:how-to/modeling/blender/blender_buffer_clearing.adoc[Blender Buffer Clearing] should be performed prior to exporting any model from Blender.
====


To export your models as Ogre XML meshes with materials:

. jMonkeyEngine requires a material file to be named the same name as the model so prior to opening the export dialog make it so. The model will export files named `ModelName.mesh.xml` with a `ModelName.material`, plus (optionally) `ModelName.skeleton.xml`, and some JPG files.
.  Open the menu `menu:File[Export > Ogre3D]` to open the exporter dialog.
.  In the `File Path` field: Select a target sub-directory of your `Project Assets/Textures/` directory. E.g. `Project Assets/Textures/ModelName/`. See xref:tutorials:concepts/best_practices.adoc[Best Practices].
.  In the panel at the bottom left of the export window toggle the following export settings:
-  Swap Axis: xz-y
- [*] Separate materials
- [ ] Only Deformable Bones footnote:[Optional: If selected, and you have an Armature with the model, only the deform bones are exported.]
- [ ] Export Scene footnote:[Toggle this to export your model in DotScene format]
- [ ] Export Selected Only footnote:[Optional: If selected, you manually choose each object you want exported prior to opening the export dialog.]
- [*] Export Meshes
- [ ] Export Meshes Overwrite footnote:[Optional: If selected, it will overwrite the existing files in the target directory]
- [ ] Armature Animation footnote:[Optional: Only used if the model contains an armature.]
-  Trim Weights footnote:[Occasionally when exporting you may get a warning complaining about vertices weighted to too many bones. You are then asked to try increasing the trim weights option. Slightly increase this spinner and try exporting again. Repeat the process until the warning goes away.]
- [*] Export Materials
.  Click Export Ogre.

You can now use the xref:sdk:sdk.adoc[jMonkeyEngine SDK] to xref:sdk:model_loader_and_viewer.adoc[load and view models]. You can xref:sdk:scene_composer.adoc[create scenes] from them and write code that loads them into your application.
