[3ds max script] Reduce navigation mesh


Hi everyone!

As some 3D artists I’m newbie in max scripting but I really want to get more familiar with it. And need help. I’m not a native english speaking, so pardon for possible screw-ups.

The situation is that I have a navigation mesh imported from another software (which is actually triangulated plane with unique form) and for my interactive walkthrough I need to reduce outer borders of this mesh. I’m able to get the mesh border vertices with the code below
if $.name == “NavMesh” then
if ModifierList != undefined then deleteModifier $ $.modifiers[1]
convertTo $ Editable_Poly
subObjectLevel = 1
$.SetSelection #Vertex #{1…(getNumVerts($))}
polyop.weldVertsByThreshold $ #{1…(getNumVerts($))}
$.EditablePoly.ConvertSelection #Vertex #Border
$.EditablePoly.ConvertSelection #Border #Vertex

but the problem is that I don’t have to delete vertices causing deleting the only faces on thin areas (see image below)

And I’m stuck with this task. I hope my problem explanation is rather straightforward.

Could someone help me to find solution of this task?

Many thanks in advance!

  1. In border sub object mode, select borders.
  2. Create shape (linear = true).
  3. Optimize spline will reduce vertices along a line.
  4. Convert shape to editable poly.
  5. Apply subdivision modifier to the object with a large distance value if the mesh has issues and needs to be retriangulated.

This will get rid of all the internal vertices. Not sure if that’s what you’re trying to do.