# Path: mayaLib/rigLib/utils/common.py
# def centerPivot(obj, targetPivot=None):
# def freezeTranform(obj):
# def deleteHistory(obj):
# def deleteNonDeformerHistory(obj):
# def deleteConnection(objAttrList):
# def setDrivenKey(driver, driverValueList, driven, drivenValueList, cvType='linear'):
# 
# Path: mayaLib/rigLib/utils/name.py
# def removeSuffix(name):
# def getSide(name):
# def getAlpha(i):
# 
# Path: mayaLib/rigLib/utils/skin.py
# def selectSkinClusterObject():
# def disableInheritsTransformOnSkinClusters():
# def copySkinWeightBetweenMesh(selection=pm.ls(sl=True)):
# def copyBind(source, destination, sa='closestPoint', ia='closestJoint'):
# def copyBindSelected(selectionList):
# def findRelatedSkinCluster(geo):
# def saveSkinWeights(characterName, geoList,
#                     projectPath=str(pm.workspace(q=True, dir=True, rd=True) + 'scenes/') + 'rig/',
#                     skinWeightsDir='weights/skinCluster', swExt='.swt',
#                     doDirectory=True):
# def loadSkinWeights(characterName, geoList,
#                     projectPath=str(pm.workspace(q=True, dir=True, rd=True) + 'scenes/') + 'rig/',
#                     skinWeightsDir='weights/skinCluster', swExt='.swt'):
# def ngSkinToolInit(geo):
# def ngSkinToolRaplceLayer(geo, sourceLayer, destinationLayer):
# def ngSkinToolDeleteNode(geo):


import pymel.core as pm
from mayaLib.rigLib.utils import common
from mayaLib.rigLib.utils import name
from mayaLib.rigLib.utils import skin
__author__ = 'Lorenzo Argentieri'




def invertSelection(shape, faces):
    pm.select(shape + '.f[*]')
    pm.select(faces, deselect=True)
    # mel.eval('InvertSelection;')
    return pm.ls(sl=True)


class ProxyGeo():
    def __init__(self, geo, doParentCnst=True, threshold=0.45):
        self.proxyGeoList = []
        pivotLocator = pm.spaceLocator(n='pivotGeo_LOC')
        # Create proxy geo Group
        self.shapeGrp = pm.group(n='fastGeo_GRP', em=True)

        # Get Shape and skin from Object

# Path: mayaLib/rigLib/utils/common.py
# def centerPivot(obj, targetPivot=None):
# def freezeTranform(obj):
# def deleteHistory(obj):
# def deleteNonDeformerHistory(obj):
# def deleteConnection(objAttrList):
# def setDrivenKey(driver, driverValueList, driven, drivenValueList, cvType='linear'):
# 
# Path: mayaLib/rigLib/utils/name.py
# def removeSuffix(name):
# def getSide(name):
# def getAlpha(i):
# 
# Path: mayaLib/rigLib/utils/skin.py
# def selectSkinClusterObject():
# def disableInheritsTransformOnSkinClusters():
# def copySkinWeightBetweenMesh(selection=pm.ls(sl=True)):
# def copyBind(source, destination, sa='closestPoint', ia='closestJoint'):
# def copyBindSelected(selectionList):
# def findRelatedSkinCluster(geo):
# def saveSkinWeights(characterName, geoList,
#                     projectPath=str(pm.workspace(q=True, dir=True, rd=True) + 'scenes/') + 'rig/',
#                     skinWeightsDir='weights/skinCluster', swExt='.swt',
#                     doDirectory=True):
# def loadSkinWeights(characterName, geoList,
#                     projectPath=str(pm.workspace(q=True, dir=True, rd=True) + 'scenes/') + 'rig/',
#                     skinWeightsDir='weights/skinCluster', swExt='.swt'):
# def ngSkinToolInit(geo):
# def ngSkinToolRaplceLayer(geo, sourceLayer, destinationLayer):
# def ngSkinToolDeleteNode(geo):


# Path: mayaLib/rigLib/utils/proxyGeo.py
import pymel.core as pm
from mayaLib.rigLib.utils import common
from mayaLib.rigLib.utils import name
from mayaLib.rigLib.utils import skin

__author__ = 'Lorenzo Argentieri'




def invertSelection(shape, faces):
    pm.select(shape + '.f[*]')
    pm.select(faces, deselect=True)
    # mel.eval('InvertSelection;')
    return pm.ls(sl=True)


class ProxyGeo():
    def __init__(self, geo, doParentCnst=True, threshold=0.45):
        self.proxyGeoList = []
        pivotLocator = pm.spaceLocator(n='pivotGeo_LOC')
        # Create proxy geo Group
        self.shapeGrp = pm.group(n='fastGeo_GRP', em=True)

        # Get Shape and skin from Object

        skinCluster = skin.findRelatedSkinCluster(geo)