Hi,
I'm writing a mesh loader node which should support uvs. My problem is that I can not add a new uv set inside my node.
I use the following "workflow" for uvs.
step 1
// geometry created from file, u & v arrays added
fMesh.create(numVertices,numPolygons,vertexArray,polygonCounts,polygonConnects,uArray,vArray,newMeshData,&status);
// mesh is set to the output
meshHandle.set(newMeshData);
step 2
// get back output mesh
MObject mesh = meshHandle.asMesh();
MFnMesh fMesh(mesh);
step 3
// create empty uv sets in a loop based on the number of the uv sets in file
fMesh.createUVSet(uvSet);
step 4
// assign uvs
fMesh.assignUVs(..,..,&uvSet);
So this is the base of my uv reader, step 3 is failed.
The problem should be something like this (documented in the API):
"This operation will only work when the MFnMesh refers to a shape."
How should I add multiple uv sets with uvs inside my loader node?
Thanks,
David