# 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
                common.centerPivot(transform, pivotLocator)

                # copy skinCluster
                skin.copyBind(pm.ls(geo)[0], transform)

                # delete faces in the new shape based on selected joint
                self.deleteVertex(joint=joint, newShape=dupliShape, threshold=threshold)

                # delete non deformer history
                common.deleteHistory(dupliShape)

                # parent under proxy group
                pm.parent(transform, self.shapeGrp)
                self.proxyGeoList.append(transform)

                # parentConstraint with joint
                if doParentCnst:
                    pm.parentConstraint(joint, transform, mo=True)

            # delete pivot locator
            pm.delete(pivotLocator)

    def duplicateSourceMesh(self, obj, joint):
        """

        :param obj:
        :param ctrl:
        :return: Mesh Shape for the Control
        """
        dupliObj = pm.duplicate(obj)

# 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

                common.centerPivot(transform, pivotLocator)

                # copy skinCluster
                skin.copyBind(pm.ls(geo)[0], transform)

                # delete faces in the new shape based on selected joint
                self.deleteVertex(joint=joint, newShape=dupliShape, threshold=threshold)

                # delete non deformer history
                common.deleteHistory(dupliShape)

                # parent under proxy group
                pm.parent(transform, self.shapeGrp)
                self.proxyGeoList.append(transform)

                # parentConstraint with joint
                if doParentCnst:
                    pm.parentConstraint(joint, transform, mo=True)

            # delete pivot locator
            pm.delete(pivotLocator)

    def duplicateSourceMesh(self, obj, joint):
        """

        :param obj:
        :param ctrl:
        :return: Mesh Shape for the Control
        """
        dupliObj = pm.duplicate(obj)

        pm.rename(dupliObj, name.removeSuffix(joint) + '_PRX')