Which UV Coord belongs to which vertice in that face?
If I look in the *.ma file, at the current face info...I get the same UV Coords, but in a different order. So the texturing becomes a sad sight in my program, I presumed this from the result.....
I use polyInfo -fv shape.f[x]; to get the vertices. So I think that ccw order is correct. I can render shapes correct in wireframe, differnet shadings etc. The problem is the textures..and probably because of the uvcoords...
But Im not sure of the order here, all I know is that my textures looks crappy...like looking through a shower. There seems to be a mismatch between the uvcoords and the vertices....different orders or something, compared with the *.ma file.
You can get the verts in order, and you can convert face to vert and face to uv, and you can query the uv's of a vert. All you have to do is find the uv associated with the vert that is also part of the same face.
It seems like you get the same order as I did, which isn't the same compared to the original *.ma file...
ex:
for a face in the model: $result is [3 49 48 52]
for the same face in the *.ma file $order is [52 3 49 48]
f 4 4 5 6 7 mu 0 4 52 3 49 48
I was wondering how to get indexkeys instead of 2 float values...so this still helps a lot....maybe its possible to fprint a UVCoord list that corresponds to the order I get with the script in $result....
ex uvcoord nr 3 in the new list has the same u,v values as uvcoord nr 52 in the old list....or something..dunno how to proceed on that right now....
Hello this is a short script that checks what uv-cord correlates to what vertex, I've put in a check if theres more UV-cords per vertex. Hopefully this will be to some help
string $fSelec[]=filterExpand -sm 34; //names of selected verts string $uvTemp[]; string $uvVertex[]; for ($zi=0; $zi < (size ($fSelec)); ++$zi) { select $fSelec[$zi]; PolySelectConvert 4; //converts to UV-cords string $uvSelec[]=filterExpand -sm 35; PolySelectConvert 3;//converts to vertex string $vxSelect[]=filterExpand -sm 31;
int $num=size ($vxSelect);
for ($i=0; $i < ($num); ++$i) {
select $vxSelect[$i];
PolySelectConvert 4;
string $uvTemp[]=`filterExpand -sm 35`;
$uNum=size ($uvTemp);
for ($xi=0; $xi < ($uNum); ++$xi) {
if ($uvSelec[$i]==$uvTemp[$xi])$uvVertex[$i]=$uvTemp[$xi];
}
}
//this part just prints out face, vertex and its uv cord print ("nFace:"+$fSelec[$zi]+"n"); for ($i=0; $i < ($num); ++$i) { print ("Vertex: "+$vxSelect[$i]+" UV:"+$uvVertex[$i]+"n"); } }