Exemplo n.º 1
0
    def deleteVertex(self, joint, newShape, threshold=0.45):
        verts = []
        for x in range(pm.polyEvaluate(newShape, v=1)):
            v = pm.skinPercent(self.skin, '%s.vtx[%d]' % (newShape, x), transform=joint, q=1)
            if v > threshold:
                verts.append('%s.vtx[%d]' % (newShape, x))
        pm.select(verts)

        faces = pm.polyListComponentConversion(verts, fromVertex=True, toFace=True)
        #pm.select(faces)
        toDelete = invertSelection(newShape, faces)
        pm.polyDelFacet(toDelete, ch=False)
Exemplo n.º 2
0
    def deleteVertex_OLD(self, joint, newShape, threshold=0.45):
        deleteVert_list = []

        vert_list, values = self.skin.getPointsAffectedByInfluence(joint)
        vert_list = vert_list.getSelectionStrings()

        index = 0
        for vtxs in vert_list:
            vtxs = pm.PyNode(vtxs)
            for vert in vtxs:
                if values[index] > threshold:
                    shapeVertex = newShape.vtx[index]
                    deleteVert_list.append(shapeVertex)
                index += 1

        faces = pm.polyListComponentConversion(deleteVert_list, fromVertex=True, toFace=True)
        pm.select(faces)
        util.invertSelection()
        pm.polyDelFacet(ch=False)