# 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
                    for item in allGuideList:
                        cmds.rename(item, side+self.userGuideName+"_"+item)
                    self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True)
                    cmds.parent(side+self.userGuideName+'_Guide_Base', self.mirrorGrp, absolute=True)
                    # re-rename grp:
                    cmds.rename(self.mirrorGrp, side+self.userGuideName+'_'+self.mirrorGrp)
                    # do a group mirror with negative scaling:
                    if s == 1:
                        if cmds.getAttr(self.moduleGrp+".flip") == 0:
                            for axis in self.mirrorAxis:
                                gotValue = cmds.getAttr(side+self.userGuideName+"_Guide_Base.translate"+axis)
                                flipedValue = gotValue*(-2)
                                cmds.setAttr(side+self.userGuideName+'_'+self.mirrorGrp+'.translate'+axis, flipedValue)
                        else:
                            for axis in self.mirrorAxis:
                                cmds.setAttr(side+self.userGuideName+'_'+self.mirrorGrp+'.scale'+axis, -1)
                # joint labelling:
                jointLabelAdd = 1
            else: # if not mirror:
                duplicated = cmds.duplicate(self.moduleGrp, name=self.userGuideName+'_Guide_Base')[0]
                allGuideList = cmds.listRelatives(duplicated, allDescendents=True)
                for item in allGuideList:
                    cmds.rename(item, self.userGuideName+"_"+item)
                self.mirrorGrp = cmds.group(self.userGuideName+'_Guide_Base', name="Guide_Base_Grp", relative=True)
                #for Maya2012: self.userGuideName+'_'+self.moduleGrp+"_Grp"
                # re-rename grp:
                cmds.rename(self.mirrorGrp, self.userGuideName+'_'+self.mirrorGrp)
                # joint labelling:
                jointLabelAdd = 0
            # store the number of this guide by module type

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

                    for item in allGuideList:
                        cmds.rename(item, side+self.userGuideName+"_"+item)
                    self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True)
                    cmds.parent(side+self.userGuideName+'_Guide_Base', self.mirrorGrp, absolute=True)
                    # re-rename grp:
                    cmds.rename(self.mirrorGrp, side+self.userGuideName+'_'+self.mirrorGrp)
                    # do a group mirror with negative scaling:
                    if s == 1:
                        if cmds.getAttr(self.moduleGrp+".flip") == 0:
                            for axis in self.mirrorAxis:
                                gotValue = cmds.getAttr(side+self.userGuideName+"_Guide_Base.translate"+axis)
                                flipedValue = gotValue*(-2)
                                cmds.setAttr(side+self.userGuideName+'_'+self.mirrorGrp+'.translate'+axis, flipedValue)
                        else:
                            for axis in self.mirrorAxis:
                                cmds.setAttr(side+self.userGuideName+'_'+self.mirrorGrp+'.scale'+axis, -1)
                # joint labelling:
                jointLabelAdd = 1
            else: # if not mirror:
                duplicated = cmds.duplicate(self.moduleGrp, name=self.userGuideName+'_Guide_Base')[0]
                allGuideList = cmds.listRelatives(duplicated, allDescendents=True)
                for item in allGuideList:
                    cmds.rename(item, self.userGuideName+"_"+item)
                self.mirrorGrp = cmds.group(self.userGuideName+'_Guide_Base', name="Guide_Base_Grp", relative=True)
                #for Maya2012: self.userGuideName+'_'+self.moduleGrp+"_Grp"
                # re-rename grp:
                cmds.rename(self.mirrorGrp, self.userGuideName+'_'+self.mirrorGrp)
                # joint labelling:
                jointLabelAdd = 0
            # store the number of this guide by module type

            dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1