# 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/control.py
# class Control():
#     def __init__(
#             self,
#             prefix='new',
#             scale=1.0,
#             translateTo='',
#             rotateTo='',
#             parent='',
#             shape='circle',
#             lockChannels=['s', 'v'],
#             doOffset=True,
#             doModify=False,
#             doDynamicPivot=False,
#             objBBox=''
#     ):
#     def ctrlRadiusFromJoint(self, jnt, useSphere=True):
#     def calculateScale(self, scale, translateTo='', objBBox='', useBBox=False, useMean=False):
#     def getCtrlScale(self):
#     def makeDynamicPivot(self, prefix, scale, translateTo, rotateTo):
#     def getControl(self):
#     def getOffsetGrp(self):
#     def getModifyGrp(self):
#     def getTop(self):
# 
# Path: mayaLib/rigLib/utils/util.py
# def getDriverDrivenFromConstraint(constraint):
# def returnDriverObject(attribute, skipConversionNodes=False):
# def returnDrivenAttribute(attribute, skipConversionNodes=False):
# def returnDrivenObject(attribute, skipConversionNodes=True):
# def getAllObjectUnderGroup(group, type='mesh'):
# def moveShape(source, destination):
# def get_distance(obj1, obj2):
#     def ctr_dist(objA, objB):
# def get_distance_from_coords(bboxMin, bboxMax):
# def lock_and_hide_all(node):
# def unlock_and_unhide_all(node):
# def no_render(tgt):
# def invertSelection():
# def getPlanarRadiusBBOXFromTransform(transform, radiusFactor=2):
# def matrixConstrain(driver, driven, parent=None, translate=True, rotate=True, scale=False):


import pymel.core as pm
from mayaLib.rigLib.utils import common, control
from mayaLib.rigLib.utils import util

    def __init__(
            self,
            characterName='new',
            scale=1.0,
            mainCtrlAttachObj=''
    ):

        """
        :param characterName: str, character name
        :param scale: float, general scale of the rig
        :return: None
        """

        # top group
        self.topGrp = pm.group(n=characterName + '_rig_GRP', em=1)
        self.rigCtrlLoc = pm.spaceLocator(n='rigCtrl_LOC')
        pm.rotate(self.rigCtrlLoc, [0, -90, 0], r=True, ws=True)
        # common.freezeTranform(self.rigCtrlLoc)
        pm.delete(pm.pointConstraint(mainCtrlAttachObj, self.rigCtrlLoc))

        characterNameAt = 'characterName'
        sceneObjectTypeAt = 'sceneObjectType'

        for at in [characterNameAt, sceneObjectTypeAt]:
            pm.addAttr(self.topGrp, ln=at, dt='string')

        pm.setAttr(self.topGrp + '.' + characterNameAt, characterName, type='string', l=1)
        pm.setAttr(self.topGrp + '.' + sceneObjectTypeAt, self.sceneObjectType, type='string', l=1)

        # make global control

# 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/control.py
# class Control():
#     def __init__(
#             self,
#             prefix='new',
#             scale=1.0,
#             translateTo='',
#             rotateTo='',
#             parent='',
#             shape='circle',
#             lockChannels=['s', 'v'],
#             doOffset=True,
#             doModify=False,
#             doDynamicPivot=False,
#             objBBox=''
#     ):
#     def ctrlRadiusFromJoint(self, jnt, useSphere=True):
#     def calculateScale(self, scale, translateTo='', objBBox='', useBBox=False, useMean=False):
#     def getCtrlScale(self):
#     def makeDynamicPivot(self, prefix, scale, translateTo, rotateTo):
#     def getControl(self):
#     def getOffsetGrp(self):
#     def getModifyGrp(self):
#     def getTop(self):
# 
# Path: mayaLib/rigLib/utils/util.py
# def getDriverDrivenFromConstraint(constraint):
# def returnDriverObject(attribute, skipConversionNodes=False):
# def returnDrivenAttribute(attribute, skipConversionNodes=False):
# def returnDrivenObject(attribute, skipConversionNodes=True):
# def getAllObjectUnderGroup(group, type='mesh'):
# def moveShape(source, destination):
# def get_distance(obj1, obj2):
#     def ctr_dist(objA, objB):
# def get_distance_from_coords(bboxMin, bboxMax):
# def lock_and_hide_all(node):
# def unlock_and_unhide_all(node):
# def no_render(tgt):
# def invertSelection():
# def getPlanarRadiusBBOXFromTransform(transform, radiusFactor=2):
# def matrixConstrain(driver, driven, parent=None, translate=True, rotate=True, scale=False):


# Path: mayaLib/rigLib/base/module.py
import pymel.core as pm
from mayaLib.rigLib.utils import common, control
from mayaLib.rigLib.utils import util

    def __init__(
            self,
            characterName='new',
            scale=1.0,
            mainCtrlAttachObj=''
    ):

        """
        :param characterName: str, character name
        :param scale: float, general scale of the rig
        :return: None
        """

        # top group
        self.topGrp = pm.group(n=characterName + '_rig_GRP', em=1)
        self.rigCtrlLoc = pm.spaceLocator(n='rigCtrl_LOC')
        pm.rotate(self.rigCtrlLoc, [0, -90, 0], r=True, ws=True)
        # common.freezeTranform(self.rigCtrlLoc)
        pm.delete(pm.pointConstraint(mainCtrlAttachObj, self.rigCtrlLoc))

        characterNameAt = 'characterName'
        sceneObjectTypeAt = 'sceneObjectType'

        for at in [characterNameAt, sceneObjectTypeAt]:
            pm.addAttr(self.topGrp, ln=at, dt='string')

        pm.setAttr(self.topGrp + '.' + characterNameAt, characterName, type='string', l=1)
        pm.setAttr(self.topGrp + '.' + sceneObjectTypeAt, self.sceneObjectType, type='string', l=1)

        # make global control

        self.globalCtrl = control.Control(
