Navmesh Editing in 3dsMax 9

Information and tutorials related to modding BF2.
Post Reply
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Navmesh Editing in 3dsMax 9

Post by Outlawz7 »

This tutorial requires you to have a finished navmesh to work with. If you are new to adding AI support to maps, head over here:
http://bf2.e-plaza.de/index.htm

I'll be using 3ds Max 9 and Notepad.

Importing:
To start, open 3ds Max and once loaded, go to File>Import.
Navigate to your map's output folder.
The import directory can be configured so you don't have to browse through half your HDD to get to your files. :)

Image

Don't forget to select the file type to be .obj, otherwise you won't see your files.
When you'll open the file, 3ds max will ask your for import settings, set them according to these:

Image

Important!
Materials Library's string needs to be typed in, since it's custom. Copy it from here:
materials.mtl
Importing preopt (optional)

If you need some orientation, you can import the preopt to get a better idea of where your mesh is situated. To do this, simply import the preopt.obj the same way as you imported the navmeshes while you already have a navmesh open, however you do not need to add the 'materials.mtl' line, I find it more practical to import it without materials as it stays gray colored and is easier to distinguish. On import 3ds Max will also ask you for a new object name, just keep the default suggestion unless you want to give it a name :p

However you don't want to mess everything up, so select the preopt, right-click on it and click Freeze selection.
Image

The preopt will turn dark gray and you'll be unable to select it :) select the navmesh to bring it up on top.
Image

To delete the preopt before exporting, right-click anywhere in viewport and click Unfreeze above the Freeze selection, select the preopt and delete.


Editing:
Your navmesh will now open in a new scene with four views, select the Perspective (bottom right) one and go to the bottom right of the program, where there's a toolbar which contains tools that you can use to navigate around your object.
Select the Maximize Viewport Toggle as shown by the arrow, then select your navmesh object.

Image

Right-click on your selected navmesh and go Convert To>Editable Poly

Image

You may have noticed a toolbar on the right side before. Once you have converted the object, go there and under Selection, pick Element.

Image

Select the main part of your navmesh, the one you want to keep ;)

Image

Now go to Edit>Select Invert

Image

Now everything else you didn't select is selected. Press Delete and all those evil useless navmesh islands will go away. Note: this also deletes manifolds, since faces have to be connected by an edge to "qualify", not just by a vertex :D

Image


This concludes the basic deletion of mesh islands. You can now skip to exporting, or stick around for more

Removing faces
If you want to remove parts of the mesh you don't want to use, then go to Selection and select Face (next to Element from before).

Select the faces you want to remove and press Delete.

Image

Moving vertices
Select Vertex mode either from the icon or the list under the Edit Poly modifier.
Right-click on 'Perspective in the top left of the viewport and change the view to Wireframe.
Select the Move tool, then select the vertice you want to move.
Image

Extracting materials out of the mesh for later use
Note: When extruding new faces in 3ds Max the materials are carried over.
This might be useful if you somehow lose your materials. :confused:

Press M to bring up the Material editor and click 'Get material from selection' (eyedropper tool) then click on the mesh in the viewport.
Image

The materials are carried over into the Material editor.
Image

Adding new faces

Unlike Maya, materials are carried over from the extruded mesh, however if you find yourself extruding ie. deep water mesh and want it to be shallow/ground mesh, you can use the above technique for material extraction to add new materials to faces.

First, convert your navmesh to Editable Mesh (not Poly)
Sečect the Edge tool and pick an edge you want to extrude.

Image

Edges can only be extruded up or down or left or right for some reason, so don't panic; with the edge still selected, use the Select&Move tool to move the edge up/down/left/right to align it with the rest.
Having preopt loaded is recommended, so you can better adjust the faces.

Image

Converting quad faces to triangles

Again unlike Maya, there doesn't seem to be a magic 'turn quads to triangles' option, so I found a very simple solution for this one.
Convert your mesh to Editable Poly, select two opposite vertices,

Image

then under Edit Vertices click Connect,

Image

and you're done.

Image


Adding detail to your faces

In case you've got an enormous face and want it in smaller parts to align it better with the terrain, do the following.
Convert your mesh to Editable Mesh (unless you're already it that mode) and select the face.

Image

Then scroll down in the Edit geometry to Tesselate, you can play with the amount and two options, Edge and Face-Center.
Edge does this:

Image

And Face-Center does this.

Image

I prefer the latter, as you only need to connect the two opposing vertices in the middle quad and you're good to go.

Image


Exporting:
Go to File>Export and save over the file you opened before as .obj, 3ds max will ask you for export settings, set them according to these:

Image

Close down 3ds Max (don't save the scene). We're not done yet.

Important:
Go to your output folder and open the navmesh you edited (Vehicle or Infantry.obj) with Notepad.
It will open a huge wall of text, but may also open it in a nice tidy column like shown. On top you should see a word 'mtllib'. Again copy the 'materials.mtl' after it, leaving one space and save.

Image

This is to add back the materials, since they get lost by 3ds Max. Yeah I don't quite understand everything yet. :p

You can now go and run fixNavmesh.bat :)
Image
Dukuu_npanop
Posts: 91
Joined: 2010-01-02 22:03

Re: [Tutorial]Navmesh editing in 3ds Max 9

Post by Dukuu_npanop »

Hi! I have loaded my navmesh to 3ds max but it looks mirrored? Is that usual or what should I do? Thanks.
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: [Tutorial]Navmesh editing in 3ds Max 9

Post by Outlawz7 »

Dukuu_npanop wrote:Hi! I have loaded my navmesh to 3ds max but it looks mirrored? Is that usual or what should I do? Thanks.
Better late than never, but yes, it'll import it mirrored and that's ok, it exports the right way around.
Image
dnamro
Posts: 29
Joined: 2014-07-27 00:47

Re: Navmesh Editing in 3dsMax 9

Post by dnamro »

Updated version of the tutorial with images can be found on the Battlefield Modding Wikia:
Navmesh Editing with 3dsmax | Classic Battlefield Modding Wikia | Fandom powered by Wikia
Post Reply

Return to “Modding Tutorials”