# 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 maya import OpenMaya as om
from .Library import dpUtils
from . import dpBaseClass
from . import dpLayoutClass
                cmds.addAttr(self.jnt, longName='dpAR_joint', attributeType='float', keyable=False)
                dpUtils.setJointLabel(self.jnt, s+jointLabelAdd, 18, self.userGuideName)
                # create a control:
                if not self.getHasIndirectSkin():
                    if self.curveDegree == 0:
                        self.curveDegree = 1
                # work with curve shape and rotation cases:
                indirectSkinRot = (0, 0, 0)
                if self.langDic[self.langName]['c058_main'] in self.userGuideName:
                    ctrlTypeID = "id_054_SingleMain"
                    if len(sideList) > 1:
                        if self.langDic[self.langName]['c041_eyebrow'] in self.userGuideName:
                            indirectSkinRot = (0, 0, -90)
                        else:
                            indirectSkinRot = (0, 0, 90)
                else:
                    ctrlTypeID = "id_029_SingleIndSkin"
                    if self.langDic[self.langName]['c045_lower'] in self.userGuideName:
                        indirectSkinRot=(0, 0, 180)
                    elif self.langDic[self.langName]['c043_corner'] in self.userGuideName:
                        if "00" in self.userGuideName:
                            indirectSkinRot=(0, 0, 90)
                        else:
                            indirectSkinRot=(0, 0, -90)
                self.singleCtrl = self.ctrls.cvControl(ctrlTypeID, side+self.userGuideName+"_Ctrl", r=self.ctrlRadius, d=self.curveDegree, rot=indirectSkinRot)
                dpUtils.originedFrom(objName=self.singleCtrl, attrString=self.base+";"+self.guide+";"+self.cvEndJoint+";"+self.radiusGuide)
                # position and orientation of joint and control:
                cmds.delete(cmds.parentConstraint(self.guide, self.jnt, maintainOffset=False))
                cmds.delete(cmds.parentConstraint(self.guide, self.singleCtrl, maintainOffset=False))
                # zeroOut controls:

# 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/dpSingle.py
from maya import cmds
from maya import OpenMaya as om
from .Library import dpUtils
from . import dpBaseClass
from . import dpLayoutClass

                cmds.addAttr(self.jnt, longName='dpAR_joint', attributeType='float', keyable=False)
                dpUtils.setJointLabel(self.jnt, s+jointLabelAdd, 18, self.userGuideName)
                # create a control:
                if not self.getHasIndirectSkin():
                    if self.curveDegree == 0:
                        self.curveDegree = 1
                # work with curve shape and rotation cases:
                indirectSkinRot = (0, 0, 0)
                if self.langDic[self.langName]['c058_main'] in self.userGuideName:
                    ctrlTypeID = "id_054_SingleMain"
                    if len(sideList) > 1:
                        if self.langDic[self.langName]['c041_eyebrow'] in self.userGuideName:
                            indirectSkinRot = (0, 0, -90)
                        else:
                            indirectSkinRot = (0, 0, 90)
                else:
                    ctrlTypeID = "id_029_SingleIndSkin"
                    if self.langDic[self.langName]['c045_lower'] in self.userGuideName:
                        indirectSkinRot=(0, 0, 180)
                    elif self.langDic[self.langName]['c043_corner'] in self.userGuideName:
                        if "00" in self.userGuideName:
                            indirectSkinRot=(0, 0, 90)
                        else:
                            indirectSkinRot=(0, 0, -90)
                self.singleCtrl = self.ctrls.cvControl(ctrlTypeID, side+self.userGuideName+"_Ctrl", r=self.ctrlRadius, d=self.curveDegree, rot=indirectSkinRot)
                dpUtils.originedFrom(objName=self.singleCtrl, attrString=self.base+";"+self.guide+";"+self.cvEndJoint+";"+self.radiusGuide)
                # position and orientation of joint and control:
                cmds.delete(cmds.parentConstraint(self.guide, self.jnt, maintainOffset=False))
                cmds.delete(cmds.parentConstraint(self.guide, self.singleCtrl, maintainOffset=False))
                # zeroOut controls:

                zeroOutCtrlGrp = dpUtils.zeroOut([self.singleCtrl], offset=True)[0]