Hi, i've bee nworkin with the maya API for a few months now and I need some help with setting the UVs on a mesh, ive searched for threds in this forum but the ones I found didnt help.
Ok here goes:
I make a mesh and take a copy of the U and V coordinates
MFloatArray aryUs,aryVs;
mesh.getUVs(aryUs,aryVs, ¤tUVSet );
i then play aroudn with the Uvs, translating rotating scaling etc.
now when it comes to re-setting the Uvs (no change in size of arrays), the UVs get
set - even in the UvTextureEditor but do not stay in place - as soon as i try to move a UV or switch to another uvSet and back - the UVs are back in their pre-modified positions, here's what I do:
MIntArray uvCounts;
MIntArray uvIds;
mesh.getAssignedUVs(uvCounts,uvIds,¤tUVSet);
mesh.clearUVs(¤tUVSet);
mesh.setUVs(aryUs,aryVs,¤tUVSet);
mesh.assignUVs(uvCounts,uvIds,&c urrentUVSet);
I have also tried setting the UVs one by one and the same happens, the only way I can get the UVs to stay put is to go through a loop and run MEL script commands:
for( allUvs )
{
"polyEditUV -r false -u aryUs[i] -v aryVs[i]"
}
This would be ok but its very slow.
Any ideas?
Thanks, H.