Skip to content

Instantly share code, notes, and snippets.

@pmolodo
Created March 15, 2017 17:13
Show Gist options
  • Save pmolodo/e920bd1fa8b6d5c2345dc32369bda4f5 to your computer and use it in GitHub Desktop.
Save pmolodo/e920bd1fa8b6d5c2345dc32369bda4f5 to your computer and use it in GitHub Desktop.
Example of using MeshFace.getUVAtPoint()
import pymel.core as pm
pm.newFile(f=1)
cube = pm.polyCube()[0]
face = cube.f[4]
pos = pm.dt.Point(.76, .2, -.15)
# the loc isn't necesary, but gives a nice visual indicator of the point we're querying
loc = pm.spaceLocator()
loc.translate.set(pos)
print face.getUVAtPoint(pos, "world", "map1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment