# Path: mayaLib/rigLib/base/module.py
# class Base():
# class Module():
#     def __init__(
#             self,
#             characterName='new',
#             scale=1.0,
#             mainCtrlAttachObj=''
#     ):
#     def getScaleLocator(self):
#     def getDisplayControl(self):
#     def createHalo(self, mainCtrlAttachObj, scale):
#     def createDisplay(self, mainCtrlAttachObj, scale):
#     def createIKFK(self, mainCtrlAttachObj, scale):
#     def __init__(
#             self,
#             prefix='new',
#             baseObj=None
#     ):
# 
# 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):


import pymel.core as pm
from mayaLib.rigLib.base import module
from mayaLib.rigLib.utils import control


        # make IK handle
        neckIk, effector, neckCurve = pm.ikHandle(n=prefix + '_IKH', sol='ikSplineSolver', sj=neckJoints[0],
                                                  ee=neckJoints[-1],
                                                  createCurve=True, numSpans=2)

        # rename curve
        pm.rename(neckCurve, prefix + '_CRV')

        # make neck curve clusters
        neckCurveCVs = pm.ls(neckCurve + '.cv[*]', fl=1)
        numNeckCVs = len(neckCurveCVs)
        neckCurveClusters = []

        for i in range(numNeckCVs):
            cls = pm.cluster(neckCurveCVs[i], n=prefix + 'Cluster%d' % (i + 1))[1]
            neckCurveClusters.append(cls)

        pm.hide(neckCurveClusters)

        # parent neck curve
        pm.parent(neckCurve, self.rigmodule.partsNoTransGrp)

        # make attach groups
        self.bodyAttachGrp = pm.group(n=prefix + 'BodyAttach_GRP', em=1, p=self.rigmodule.partsGrp)
        self.baseAttachGrp = pm.group(n=prefix + 'BaseAttach_GRP', em=1, p=self.rigmodule.partsGrp)

        pm.delete(pm.pointConstraint(neckJoints[0], self.baseAttachGrp))

        # make controls

# Path: mayaLib/rigLib/base/module.py
# class Base():
# class Module():
#     def __init__(
#             self,
#             characterName='new',
#             scale=1.0,
#             mainCtrlAttachObj=''
#     ):
#     def getScaleLocator(self):
#     def getDisplayControl(self):
#     def createHalo(self, mainCtrlAttachObj, scale):
#     def createDisplay(self, mainCtrlAttachObj, scale):
#     def createIKFK(self, mainCtrlAttachObj, scale):
#     def __init__(
#             self,
#             prefix='new',
#             baseObj=None
#     ):
# 
# 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/base/neck.py
import pymel.core as pm
from mayaLib.rigLib.base import module
from mayaLib.rigLib.utils import control


        # make IK handle
        neckIk, effector, neckCurve = pm.ikHandle(n=prefix + '_IKH', sol='ikSplineSolver', sj=neckJoints[0],
                                                  ee=neckJoints[-1],
                                                  createCurve=True, numSpans=2)

        # rename curve
        pm.rename(neckCurve, prefix + '_CRV')

        # make neck curve clusters
        neckCurveCVs = pm.ls(neckCurve + '.cv[*]', fl=1)
        numNeckCVs = len(neckCurveCVs)
        neckCurveClusters = []

        for i in range(numNeckCVs):
            cls = pm.cluster(neckCurveCVs[i], n=prefix + 'Cluster%d' % (i + 1))[1]
            neckCurveClusters.append(cls)

        pm.hide(neckCurveClusters)

        # parent neck curve
        pm.parent(neckCurve, self.rigmodule.partsNoTransGrp)

        # make attach groups
        self.bodyAttachGrp = pm.group(n=prefix + 'BodyAttach_GRP', em=1, p=self.rigmodule.partsGrp)
        self.baseAttachGrp = pm.group(n=prefix + 'BaseAttach_GRP', em=1, p=self.rigmodule.partsGrp)

        pm.delete(pm.pointConstraint(neckJoints[0], self.baseAttachGrp))

        # make controls

        headMainCtrl = control.Control(prefix=prefix + 'HeadMain', translateTo=neckJoints[-1], rotateTo=headJnt,
