View Full Version : Maya API: Creating mesh with custom vertexIds
02-21-2005, 08:15 AM
I'm building a mesh using MFnMesh::create. Everything works ok except I would like to have control over how vertex id's are set. Does anyone know if there is any way to set vertex id's? How does maya assign vertex id's when appending polygon faces for instance?
Basically what I'm trying to do is change some mesh vertex id but it seems it's impossible without rebuilding the whole mesh.
Thanks for help,
02-24-2005, 08:39 AM
I've done something like this using MEL. Basically, I had to rebuild the mesh, as you have no control over vertex IDs (at least in MEL). Could be the same for the C++ API.
Check the Maya2LW scripts on my website for a OBJ importer which will keep point order intact. It contains all the commands necessary for creating a mesh under this constraint.
02-24-2005, 10:44 AM
I checked Maya2LW scripts but I think it suffers from the same limitation since it uses polyCreateFacet command which creates vertices starting with index 0. If mesh would have vertex index starting with 10 instead of 0 or have it in different order (for instance 0,1,2,5,6,7,20), you have a problem.
02-24-2005, 04:12 PM
A vertex array will always start with index 0. That's how arrays work.
You could try to create a 10-sided polygon at <0,0,0> (index 0-9) if you need some specific polys starting at 10.
02-25-2005, 08:33 AM
That's what I'm currently thinking of (because I can't find a better solution) but would certainly like to avoid it if possible. Those dead vertices might be a problem later especially when having loads of them. I was also thinking of a way of deleting them without rebuilding the whole mesh (which maya automatically does) but without success.
Thanks for help,
02-25-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.