- Open Blender, then open Preferences (Edit->Preferences), and click Add-ons
- Search for "Ogre" and check the box to enable the OGRE Exporter
- Build Ogre, if you haven't already (run ~BuildDependencies_Debug.sh~)
- Set ~OGRETOOLS_XML_CONVERTER~ to where you built OgreMeshTool. You'll need to browse to ~gamelib/Dependencies/ogre-next/build/Debug/bin/OgreMeshTool_d~
You are now ready to export. Open your model or create one, then do ~File -> Export -> Ogre3D~. See the following section for settings. /Note:/ I will be making command-line driven auto-exporting to reduce these manual steps.
** OGRE Export Settings
- Don't *export materials*. These are v1 materials as far as I know, which don't work with Ogre 2
- Export the mesh. Because export materials doesn't do us any good yet, we only export the mesh to get the updated UV coordinates and material (name only)
- Create a ~.material~ text file like below:
#+BEGIN_SRC C
hlms MyMaterial pbs
{
roughness 0.4
fresnel 1.33
diffuse_map MyTexture.dds
// normal_map Rocks_Normal.tga
// roughness_map Rocks_Spec.tga
// specular_map Rocks_Diffuse.tga
}
#+END_SRC
- Finally, add the material to the ~Ogre::Item~:
#+BEGIN_SRC C++
item->setDatablock("MyMaterial");
#+END_SRC
This is only necessary if the mesh didn't already have the Material name set.