Exemple #1
0
 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]
Exemple #2
0
 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]
Exemple #3
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
Exemple #4
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
Exemple #5
0
 def vertexToFaces(cls, transform, vertexIndex):
     return cls._getIndexesFromSelectionList(
        cmds.polyListComponentConversion(
            '%s.vtx[%s]' % (transform, vertexIndex), fv=True, tvf=True) )
Exemple #6
0
 def edgeToFaces(cls, transform, edgeIndex):
     return cls._getIndexesFromSelectionList(
         cmds.polyListComponentConversion(
            '%s.e[%s]' % (transform, edgeIndex), fromEdge=True, toFace=True) )
Exemple #7
0
 def vertexToFaces(cls, transform, vertexIndex):
     return cls._getIndexesFromSelectionList(
         cmds.polyListComponentConversion('%s.vtx[%s]' %
                                          (transform, vertexIndex),
                                          fv=True,
                                          tvf=True))
Exemple #8
0
 def edgeToFaces(cls, transform, edgeIndex):
     return cls._getIndexesFromSelectionList(
         cmds.polyListComponentConversion('%s.e[%s]' %
                                          (transform, edgeIndex),
                                          fromEdge=True,
                                          toFace=True))