Message 1 of 3
MFnMesh error creating UVSet

Not applicable
11-17-2016
04:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I have used MFnMesh class to create a mesh, -- but I am having difficulties setting UVs.
First -- when creating a mesh -- I have realized that the current UV set name is empty.
MObject meshMObj = fnMeshCreator.create(uniquePositionsList->Count, mesh->Triangles->Count, mPointArray, polygonCounts, polygonConnects, meshTransformObj); MFnMesh fnMesh(meshMObj); MString setName fnMesh.getCurrentUVSetName(setName); //This always is empty cerr << setName << endl;
I have tried doing the following:
MObject meshMObj = fnMeshCreator.create(uniquePositionsList->Count, mesh->Triangles->Count, mPointArray, polygonCounts, polygonConnects, meshTransformObj); MFnMesh fnMesh(meshMObj); MString setName = "UVSet"; fnMesh.createUVSet(setName); fnMesh.setCurrentUVSetName(setName); fnMesh.getCurrentUVSetName(setName); //The following still returns an empty string cerr << "Current setName: " << setName << endl;
Looking at the Maya Documents "If there is no current uv set, then a empty string will be returned on the string argument passed on."
So I am thoroughly confused