# 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/deform.py
# def blendShapeDeformer(base, blendshapeList, nodeName, defaultValue=[1, ], frontOfChain=False):
# def wrapDeformer(wrappedObjs, wrapperObj):
# def deltaMushDeformer(geo, smoothingIterations=10, smoothingStep=0.5):
# def shrinkWrapDeformer(wrappedObj, wrapperObj):
# def cMuscleSystemDeformer(obj, relativeSticky=True):
# def cMuscleConnectMuscle(muscleMainObj, muscleObjList):
# def softModDeformer(vertex):
# def meshCollision(deformer, deformed):
# 
# 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 deform
from mayaLib.rigLib.utils import name
from mayaLib.rigLib.utils import skin




class SlidingCloth():
    def __init__(self, mainSkinGeo, mainClothGeo, proxySkinGeo='', proxyClothGeo='', rigModelGrp=None):
        """
        Setup Sliding Cloth deformation
        :param mainSkinGeo: str
        :param mainClothGeo: str
        :param proxySkinGeo: str
        :param proxyClothGeo: str
        """
        if mainSkinGeo and mainClothGeo:
            self.mainSkinGeo = pm.ls(mainSkinGeo)[0]
            self.mainClothGeo = pm.ls(mainClothGeo)[0]
        else:
            print('No valid Geo!')

        if proxySkinGeo:
            self.proxySkinGeo = pm.ls(proxySkinGeo)[0]
        else:
            self.proxySkinGeo = self.makeProxyGeo(self.mainSkinGeo)

        if proxyClothGeo:
            self.proxyClothGeo = pm.ls(proxyClothGeo)[0]
        else:
            self.proxyClothGeo = self.makeProxyGeo(self.mainClothGeo)

        # setup skin proxy geo

# 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/deform.py
# def blendShapeDeformer(base, blendshapeList, nodeName, defaultValue=[1, ], frontOfChain=False):
# def wrapDeformer(wrappedObjs, wrapperObj):
# def deltaMushDeformer(geo, smoothingIterations=10, smoothingStep=0.5):
# def shrinkWrapDeformer(wrappedObj, wrapperObj):
# def cMuscleSystemDeformer(obj, relativeSticky=True):
# def cMuscleConnectMuscle(muscleMainObj, muscleObjList):
# def softModDeformer(vertex):
# def meshCollision(deformer, deformed):
# 
# 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/slidingCloth.py
import pymel.core as pm
from mayaLib.rigLib.utils import common
from mayaLib.rigLib.utils import deform
from mayaLib.rigLib.utils import name
from mayaLib.rigLib.utils import skin





class SlidingCloth():
    def __init__(self, mainSkinGeo, mainClothGeo, proxySkinGeo='', proxyClothGeo='', rigModelGrp=None):
        """
        Setup Sliding Cloth deformation
        :param mainSkinGeo: str
        :param mainClothGeo: str
        :param proxySkinGeo: str
        :param proxyClothGeo: str
        """
        if mainSkinGeo and mainClothGeo:
            self.mainSkinGeo = pm.ls(mainSkinGeo)[0]
            self.mainClothGeo = pm.ls(mainClothGeo)[0]
        else:
            print('No valid Geo!')

        if proxySkinGeo:
            self.proxySkinGeo = pm.ls(proxySkinGeo)[0]
        else:
            self.proxySkinGeo = self.makeProxyGeo(self.mainSkinGeo)

        if proxyClothGeo:
            self.proxyClothGeo = pm.ls(proxyClothGeo)[0]
        else:
            self.proxyClothGeo = self.makeProxyGeo(self.mainClothGeo)

        # setup skin proxy geo

        skin.copyBind(self.mainSkinGeo, self.proxySkinGeo)