Quantcast
Channel: mel wiki
Viewing all articles
Browse latest Browse all 610

How can I find out the U and V value of a UV?

$
0
0
polyEditUV

  • Example: find a UV called object.map[21]
polyEditUV -q -uValue object.map[21];
  • Example: Select a vertex, and find it's U value:
string $sel[] = `ls -fl -sl`;
string $UV[] = `polyListComponentConversion -tuv $sel[0]`;
float $uval[] = `polyEditUV -q -uValue $UV[0]`;
PyMel has this shorthand:
uv = meshShape.vtx[52].getUV()
However, I've had it return [0,0] values more than once: Seems broken. Best use the above method:
import pymel.cpre as pm
def getUv(vertex):
    uv = pm.polyListComponentConversion(vertex, toUV=True)
    # the uValue or vValue argument both return U & V values, weird:
    return pm.polyEditUV(uv[0], query=True, uValue=True)
Where vertext is in the form of a PyNode poly mesh, like: myMesh.vtx[52]

Viewing all articles
Browse latest Browse all 610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>