a-wicked-mind
11-20-2009, 09:13 AM
It's been a while since I did any work with the Maya API and I have some troubles getting it to work the way I want it.
I'm creating a custom plugin which reads a mesh file (not using FileTranslator though as this process is going to transparent and used as a MEL command). I can get in Mesh data just fine except UV. Since a mesh file has several materials I need multiple uv-sets, or as I've seen Maya do it, multiple object groups.
I've found that MFnMeshData which inherits MFnGeometryData has a addObjecGroup function which takes a MFnComponent. This is as close as I can get to figuring out how to create these groups, but I can't figure out how to use them (MFnMeshData.create() gives only one object). Is this the right way to go about making this, and how would I proceed? Or should I create createUVSets (which is also strange since all new sets needs to be of equal or greate size???)? If I create multiple UVSets how do I connect my shading groups to these sets?
Any help would be greatly appriciated.
I'm creating a custom plugin which reads a mesh file (not using FileTranslator though as this process is going to transparent and used as a MEL command). I can get in Mesh data just fine except UV. Since a mesh file has several materials I need multiple uv-sets, or as I've seen Maya do it, multiple object groups.
I've found that MFnMeshData which inherits MFnGeometryData has a addObjecGroup function which takes a MFnComponent. This is as close as I can get to figuring out how to create these groups, but I can't figure out how to use them (MFnMeshData.create() gives only one object). Is this the right way to go about making this, and how would I proceed? Or should I create createUVSets (which is also strange since all new sets needs to be of equal or greate size???)? If I create multiple UVSets how do I connect my shading groups to these sets?
Any help would be greatly appriciated.
