# Path: dpAutoRigSystem/Modules/Library/dpUtils.py
# def findEnv(key, path):
# def findPath(filename):
# def findAllFiles(path, dir, ext):
# def findAllModules(path, dir):
# def findAllModuleNames(path, dir):
# def findLastNumber(nameList, basename):
# def findModuleLastNumber(className, typeName):
# def normalizeText(enteredText="", prefixMax=4):
# def useDefaultRenderLayer():
# def zeroOut(transformList=[], offset=False):
# def originedFrom(objName="", attrString=""):
# def getOriginedFromDic():
# def addHook(objName="", hookType="staticHook"):
# def hook():
# def clearNodeGrp(nodeGrpName='dpAR_GuideMirror_Grp', attrFind='guideBaseMirror', unparent=False):
# def getGuideChildrenList(nodeName):
# def mirroredGuideFather(nodeName):
# def getParentsList(nodeName):
# def getModulesToBeRigged(instanceList):
# def getCtrlRadius(nodeName):
# def zeroOutJoints(jntList=None, displayBone=False):
# def clearDpArAttr(itemList):
# def deleteChildren(item):
# def setJointLabel(jointName, sideNumber, typeNumber, labelString):
# def deleteJointLabel(jointName):
# def extractSuffix(nodeName):
# def filterName(name, itemList, separator):
# def checkRawURLForUpdate(DPAR_VERSION, DPAR_RAWURL, *args):
# def visitWebSite(website, *args):
# def checkLoadedPlugin(pluginName, exceptName=None, message="Not loaded plugin", *args):
# def twistBoneMatrix(nodeA, nodeB, twistBoneName, twistBoneMD=None, axis='Z', inverse=True, *args):
# def validateName(nodeName, suffix=None, *args):
# def articulationJoint(fatherNode, brotherNode, corrNumber=0, dist=1, jarRadius=1.5, doScale=True, *args):
# def getNodeByMessage(grpAttrName, *args):
# def attachToMotionPath(nodeName, curveName, mopName, uValue):
# def profiler(func):
#     def runProfile(*args, **kwargs):
# def extract_world_scale_from_matrix(obj):
# DPAR_PROFILE_MODE = False


from maya import cmds
from .Library import dpUtils
from . import dpBaseClass
from . import dpLayoutClass
        cmds.addAttr(self.moduleGrp, longName="flip", attributeType='bool')
        cmds.setAttr(self.moduleGrp+".flip", 0)
        
        cmds.setAttr(self.moduleGrp+".moduleNamespace", self.moduleGrp[:self.moduleGrp.rfind(":")], type='string')
        
        cmds.addAttr(self.moduleGrp, longName="articulation", attributeType='bool')
        cmds.setAttr(self.moduleGrp+".articulation", 0)
        
        self.cvJointLoc = self.ctrls.cvJointLoc(ctrlName=self.guideName+"_JointLoc1", r=0.3, d=1, guide=True)
        self.jGuide1 = cmds.joint(name=self.guideName+"_JGuide1", radius=0.001)
        cmds.setAttr(self.jGuide1+".template", 1)
        cmds.parent(self.jGuide1, self.moduleGrp, relative=True)
        
        self.cvEndJoint = self.ctrls.cvLocator(ctrlName=self.guideName+"_JointEnd", r=0.1, d=1, guide=True)
        cmds.parent(self.cvEndJoint, self.cvJointLoc)
        cmds.setAttr(self.cvEndJoint+".tz", 1.3)
        self.jGuideEnd = cmds.joint(name=self.guideName+"_JGuideEnd", radius=0.001)
        cmds.setAttr(self.jGuideEnd+".template", 1)
        cmds.transformLimits(self.cvEndJoint, tz=(0.01, 1), etz=(True, False))
        self.ctrls.setLockHide([self.cvEndJoint], ['tx', 'ty', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'])
        
        cmds.parent(self.cvJointLoc, self.moduleGrp)
        cmds.parent(self.jGuideEnd, self.jGuide1)
        cmds.parentConstraint(self.cvJointLoc, self.jGuide1, maintainOffset=False, name=self.jGuide1+"_PaC")
        cmds.parentConstraint(self.cvEndJoint, self.jGuideEnd, maintainOffset=False, name=self.jGuideEnd+"_PaC")


    def changeJointNumber(self, enteredNJoints, *args):
        """ Edit the number of joints in the guide.
        """

# Path: dpAutoRigSystem/Modules/Library/dpUtils.py
# def findEnv(key, path):
# def findPath(filename):
# def findAllFiles(path, dir, ext):
# def findAllModules(path, dir):
# def findAllModuleNames(path, dir):
# def findLastNumber(nameList, basename):
# def findModuleLastNumber(className, typeName):
# def normalizeText(enteredText="", prefixMax=4):
# def useDefaultRenderLayer():
# def zeroOut(transformList=[], offset=False):
# def originedFrom(objName="", attrString=""):
# def getOriginedFromDic():
# def addHook(objName="", hookType="staticHook"):
# def hook():
# def clearNodeGrp(nodeGrpName='dpAR_GuideMirror_Grp', attrFind='guideBaseMirror', unparent=False):
# def getGuideChildrenList(nodeName):
# def mirroredGuideFather(nodeName):
# def getParentsList(nodeName):
# def getModulesToBeRigged(instanceList):
# def getCtrlRadius(nodeName):
# def zeroOutJoints(jntList=None, displayBone=False):
# def clearDpArAttr(itemList):
# def deleteChildren(item):
# def setJointLabel(jointName, sideNumber, typeNumber, labelString):
# def deleteJointLabel(jointName):
# def extractSuffix(nodeName):
# def filterName(name, itemList, separator):
# def checkRawURLForUpdate(DPAR_VERSION, DPAR_RAWURL, *args):
# def visitWebSite(website, *args):
# def checkLoadedPlugin(pluginName, exceptName=None, message="Not loaded plugin", *args):
# def twistBoneMatrix(nodeA, nodeB, twistBoneName, twistBoneMD=None, axis='Z', inverse=True, *args):
# def validateName(nodeName, suffix=None, *args):
# def articulationJoint(fatherNode, brotherNode, corrNumber=0, dist=1, jarRadius=1.5, doScale=True, *args):
# def getNodeByMessage(grpAttrName, *args):
# def attachToMotionPath(nodeName, curveName, mopName, uValue):
# def profiler(func):
#     def runProfile(*args, **kwargs):
# def extract_world_scale_from_matrix(obj):
# DPAR_PROFILE_MODE = False


# Path: dpAutoRigSystem/Modules/dpFkLine.py
from maya import cmds
from .Library import dpUtils
from . import dpBaseClass
from . import dpLayoutClass

        cmds.addAttr(self.moduleGrp, longName="flip", attributeType='bool')
        cmds.setAttr(self.moduleGrp+".flip", 0)
        
        cmds.setAttr(self.moduleGrp+".moduleNamespace", self.moduleGrp[:self.moduleGrp.rfind(":")], type='string')
        
        cmds.addAttr(self.moduleGrp, longName="articulation", attributeType='bool')
        cmds.setAttr(self.moduleGrp+".articulation", 0)
        
        self.cvJointLoc = self.ctrls.cvJointLoc(ctrlName=self.guideName+"_JointLoc1", r=0.3, d=1, guide=True)
        self.jGuide1 = cmds.joint(name=self.guideName+"_JGuide1", radius=0.001)
        cmds.setAttr(self.jGuide1+".template", 1)
        cmds.parent(self.jGuide1, self.moduleGrp, relative=True)
        
        self.cvEndJoint = self.ctrls.cvLocator(ctrlName=self.guideName+"_JointEnd", r=0.1, d=1, guide=True)
        cmds.parent(self.cvEndJoint, self.cvJointLoc)
        cmds.setAttr(self.cvEndJoint+".tz", 1.3)
        self.jGuideEnd = cmds.joint(name=self.guideName+"_JGuideEnd", radius=0.001)
        cmds.setAttr(self.jGuideEnd+".template", 1)
        cmds.transformLimits(self.cvEndJoint, tz=(0.01, 1), etz=(True, False))
        self.ctrls.setLockHide([self.cvEndJoint], ['tx', 'ty', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'])
        
        cmds.parent(self.cvJointLoc, self.moduleGrp)
        cmds.parent(self.jGuideEnd, self.jGuide1)
        cmds.parentConstraint(self.cvJointLoc, self.jGuide1, maintainOffset=False, name=self.jGuide1+"_PaC")
        cmds.parentConstraint(self.cvEndJoint, self.jGuideEnd, maintainOffset=False, name=self.jGuideEnd+"_PaC")


    def changeJointNumber(self, enteredNJoints, *args):
        """ Edit the number of joints in the guide.
        """

        dpUtils.useDefaultRenderLayer()