# Re Numbering Vertex ID

Hello.

I come across this problem so many times. While Im modelling an object every extrude, cut and such makes new vertexes on random places of the mesh. And neighbouring vertexes has really different ID s this way. I wouldlike to create a script for myself what renumbers vertexes by a pattern or by clicking so i can make my scripts for placing and animation easyer.

So I would like to know any command or method what lets me renumber vertexes in either Poly or Mesh preferably a method for both.

Thank you for all the help.

## Comment viewing options

### ?

I may not be understanding exactly what you need correctly, but would something like this work?

```for i in 1 to \$.faces.count do
(
setface \$ i [a,b,c]
print (getFace \$ i)
)```

You'd just need to work out how you want to get a,b and c.

Is there a difference between vertex index and vertex ID? What's the easiest way to see the ID or index of vertices?

### index == id

the subject is different, if you have face with verts 7, 6, 5 you cannot re-number them to 1, 2, 3.

my recent MAXScripts RSS (archive here)

Its pretty sad, since vertex id visually is just a number an array... so it shouldnt be that hard just to interchange it with another element of that array.

The detach faces stuff seems really painful and not realy what I m looking for. could work in extreme cases though...

Anyway Topic is open. if anyone has new ideas Im open. Its something what I would constantly need so I s be happy to find an easy solution.

### the Mesh is a complex math object,

in simplified definition (wikipedia):
A polygon mesh is a collection of vertices, edges and faces that defines the shape

But all this parts build the mesh as assembly following maths algorithms.

Detach faces is not painful at all, just not applicable in most cases, but this is it, no way to re-number vertex id.

my recent MAXScripts RSS (archive here)

### yep, neither in other language

nor yet in 3d programs at all. you can dettach your faces as sub-object elements, this way each triangle will have verts #(1, 2, 3).

my recent MAXScripts RSS (archive here)

### ;')

But that is painful process

barigazy

### not so ;)

```obj = Geosphere; convertToMesh obj
meshop.detachFaces obj #{1..obj.numfaces} \
delete:false asMesh:false
update obj```

my recent MAXScripts RSS (archive here)

### I think that is not posible

I think that is not posible with mxs.

barigazy