# 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
            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)

        # setup cloth proxy geo
        skin.copyBind(self.mainSkinGeo, self.proxyClothGeo)

        cMuscleDeformer = deform.cMuscleSystemDeformer(self.proxyClothGeo)
        cMuscleDeformer.enableRelax.set(1)
        cMuscleDeformer.relaxCompress.set(10)
        cMuscleDeformer.enableSmooth.set(1)

        shrinkWrapDeformer = deform.shrinkWrapDeformer(self.proxyClothGeo, self.proxySkinGeo)
        shrinkWrapDeformer.shapePreservationEnable.set(1)
        shrinkWrapDeformer.projection.set(4)
        shrinkWrapDeformer.targetInflation.set(0.01)

        polySmoothDeformer = pm.polySmooth(self.proxyClothGeo)[0]

        # wrap main Cloth Geo
        wrapDeformer = deform.wrapDeformer(self.mainClothGeo, self.proxyClothGeo)
        baseObj = pm.listConnections(wrapDeformer.basePoints, source=True)[0]

        # regroup

# 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

            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)

        # setup cloth proxy geo
        skin.copyBind(self.mainSkinGeo, self.proxyClothGeo)

        cMuscleDeformer = deform.cMuscleSystemDeformer(self.proxyClothGeo)
        cMuscleDeformer.enableRelax.set(1)
        cMuscleDeformer.relaxCompress.set(10)
        cMuscleDeformer.enableSmooth.set(1)

        shrinkWrapDeformer = deform.shrinkWrapDeformer(self.proxyClothGeo, self.proxySkinGeo)
        shrinkWrapDeformer.shapePreservationEnable.set(1)
        shrinkWrapDeformer.projection.set(4)
        shrinkWrapDeformer.targetInflation.set(0.01)

        polySmoothDeformer = pm.polySmooth(self.proxyClothGeo)[0]

        # wrap main Cloth Geo
        wrapDeformer = deform.wrapDeformer(self.mainClothGeo, self.proxyClothGeo)
        baseObj = pm.listConnections(wrapDeformer.basePoints, source=True)[0]

        # regroup

        grpName = name.removeSuffix(self.mainClothGeo.name()) + 'Cloth_GRP'