Try this. Input the name of the mesh as argument. import maya.OpenMaya as om
import maya.cmds as cmds def getUvShelList(name): selList = om.MSelectionList() selList.add(name) selListIter = om.MItSelectionList(selList, om.MFn.kMesh) pathToShape = om.MDagPath() selListIter.getDagPath(pathToShape) meshNode =…
Ok, in your case it might be a good idea to modify a function a bit: import maya.OpenMaya as om
import maya.cmds as cmds def getUvShelList(name): selList = om.MSelectionList() selList.add(name) selListIter = om.MItSelectionList(selList, om.MFn.kMesh) pathToShape = om.MDagPath() selListIter.getDagPath(pathToShape) meshNode…