def vertexFaceToUVCoordinate(cls, transform, vertexIndex, faceIndex): uvIndexes = cls._getIndexesFromSelectionList( cmds.polyListComponentConversion( '%s.vtxFace[%s][%s]' % (transform, vertexIndex, faceIndex), fvf=True, tuv=True)) if not uvIndexes: return None return cmds.getAttr('%s.uv[%s]' % (transform, uvIndexes[0]))[0]
def faceToVertexIndices(cls, transform, faceIndex): """ This method exists to convert a face to a list of correctly (counter-clockwise) ordered vertex indices. """ vertexFaceSelections = cmds.filterExpand( cmds.polyListComponentConversion( '%s.f[%s]' % (transform, faceIndex), ff=True, tvf=True), sm=70, expand=True) vertexIndices = [] for entry in vertexFaceSelections: result = cls._VERTEX_FACE_INDEX_RE.search(entry) vertexIndices.append(int(result.groupdict()['v'])) return vertexIndices
def faceToVertexIndices(cls, transform, faceIndex): """ This method exists to convert a face to a list of correctly (counter-clockwise) ordered vertex indices. """ vertexFaceSelections = cmds.filterExpand( cmds.polyListComponentConversion('%s.f[%s]' % (transform, faceIndex), ff=True, tvf=True), sm=70, expand=True) vertexIndices = [] for entry in vertexFaceSelections: result = cls._VERTEX_FACE_INDEX_RE.search(entry) vertexIndices.append(int(result.groupdict()['v'])) return vertexIndices
def vertexToFaces(cls, transform, vertexIndex): return cls._getIndexesFromSelectionList( cmds.polyListComponentConversion( '%s.vtx[%s]' % (transform, vertexIndex), fv=True, tvf=True) )
def edgeToFaces(cls, transform, edgeIndex): return cls._getIndexesFromSelectionList( cmds.polyListComponentConversion( '%s.e[%s]' % (transform, edgeIndex), fromEdge=True, toFace=True) )
def vertexToFaces(cls, transform, vertexIndex): return cls._getIndexesFromSelectionList( cmds.polyListComponentConversion('%s.vtx[%s]' % (transform, vertexIndex), fv=True, tvf=True))
def edgeToFaces(cls, transform, edgeIndex): return cls._getIndexesFromSelectionList( cmds.polyListComponentConversion('%s.e[%s]' % (transform, edgeIndex), fromEdge=True, toFace=True))