Hi there guys! a Probuilder noob here,
I explain, I have a model in Maya and Im able to know the vertex index (what vertex is what).
My question is, is the same index in Probuilder (once you have converted the object to probuilder mesh) as I see it in Maya?
That way I would be able to move the vertex (or the face) i want, because I dont know how to know by script what vertex (or group of vertex) correspond to what part of the model.
I mean, im used to build my models on Maya, and export to Unity as FBX.
The examples I´ve seen of Probuilder API (the ones from Karl at GitHub), didnt clarify me how to catch a specific vertex (or group of them), so that I know “what part am I taking”.
ok…so I continue investigating XD
I found a script that allows me to see the vertex number in Unity (thanks to Luke Gane), so I was able to see the relatioship between the model in Maya Viewport and Unity Viewport, and it matchs:
only 2,3 and… 4??? are moved.
in a more complex mesh is a kaos, so I reduce the example to the cube to try to find how to manage the values via script.
can someone pointed me what I´m doing wrong? maybe Probuilder works the index in another way? maybe I must grab faces number instead of vertex?
thanks guys!!!
EDIT: Update, Found that if I move the vertex via the Position Editor, it works nicely (the numbers are correct)…so maybe is the way I call the function TranslateVerticesInWorldSpace from script??
ProBuilder can represent vertices in 2 different ways. As a coincident indexes, or as plain old indices to the positions array. When showing vertices to a user, it’s almost always as a coincident index. In short, a coincident index is just an integer that represents a collection of unique vertices that share a common point in space.
So in your picture, the vertex labeled “1” is actually composed of 3 unique vertices. However, in most cases a user would want those vertices to behave as though they are a single point.
Now, to work with coincident vertices ProBuilder has a number of methods to convert between the two representations. For example, to get all the vertices corresponding to the “1” coincident vertex, you would check the array in mesh.sharedVertices[1]. In the other direction, if you have an index to a position and want to get all coincident vertices, you could use ProBuilderMesh.GetCoincidentVertices.
the thing that makes me crazy was, after apply the Probuilder modificator ( I mean, convert a regular mesh into a Probuilder one), the vertex index was changed, so I cant stay with the index numbers that I see in Maya, which is where I model, I need to recheck the model inside unity with the Probuilder conversion made to get the final indexes.