Creating waypoints for meshed map (f1_tesstrack) with Blender


Infamous Developer
Jan 31, 2018
Prague, CZ

Tritonas was wandering if AI waypoints could be somehow generated for a meshed track (not using procedural_roads). I figured it would be easiest to import the terrain to Blender and copy the vertices of the roads to create a "navigation mesh" of sorts where individual verts would be like the waypoints. Then, the mesh could be exported to OGRE's .mesh.xml format and the waypoints could be generated from the verts. I made the following screens as I went and figured I'd make a tutorial out of them. If anything is unclear, ask for help below.

Step 1: Download blender2ogre Blender addon. Download from . More info
Step 2: Install the addon, see below screenshot.
Step3: enable the addon in Blender, see below screenshot.

Step4: import the *f1_track.mesh (tip: sort files by size, it's the biggest, around 3MB). For some reason, the mesh arrives rotated 90 degrees to the side. To fix it:
  1. go to Right Orthographics view using Numpad-3 key. You may need to activate Ortho view by Numpad-5 key.
  2. activate edit mode (tab)
  3. select rotation center to be the 3D cursor (UI box on top of 3d viewport panel)
  4. press R key for rotate mode and hold Ctrl to constraint the rotation to big steps.
Step5: in the materials tab, select by material *testtrack_tarmac01, see below screenshot.
Step6: Shift+D to duplicate the vertices, then "Z" to restrain grab mode to Z axis and pull the verts up. Finally press P to separate the verts to new object. See screenshot below.
blender f1 track.png

Step 7: use the "edge select" feature (Shift+leftclick) to select and delete one side of each road. We'll use the other side as the navmesh.
Step 8: Set up the "vertex snapping" (magnet icon on top of 3d viewport) as seen on screenshot below. Then, switch to top-down view mode using Numpad-7 key. Then manually move verts to the middle of the roads. TIP: use C hotkey for circle-select, B hotkey for box-select and proportional edit (UI selector on top of 3D Viewport).
blender vert snap.png

I haven't figured how to export the verts as waypoints, though. Blender2Ogre failed me, it only exports verts which are part of a triangle. I'll have to hack ulteq's truck export scripts to export angelscript waypoints instead. For now, I'll just attach the created Blender file.


  • AI_navmesh.blend
    4.2 MB · Views: 97
Its probably easy to export a list of the vertices using python and the blender console.

I was using that method to get x,y,z positions of objects. Based on using this:

I can't program and I managed to get the required info to copy and paste in to notepad.
Thanks for the advice @rents1977, I googled some more and now I have a functional export to a JSON-based waypoint format which Tritonas just announced in Discord/#development.
Source and instructions to use:

import bpy
import bmesh

# header
print ("--------------BEGIN JSON WAYPOINTS---------------")
print ("[")

# Get the active mesh
obj = bpy.context.edit_object
me =

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me) = None

# Modify the BMesh, can do anything here...
for v in bm.verts:
        print("[",, ",",, ",",, "]", sep )
        sep = ","
# footer
print ("]")
print ("--------------END JSON WAYPOINTS---------------")