Python maya.cmds.namespace() Examples

The following are 30 code examples of maya.cmds.namespace(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module maya.cmds , or try the search function .
Example #1
Source File: mayasceneobject.py    From cross3d with MIT License 6 votes vote down vote up
def setNamespace(self, namespace):
		# I am not re-using the name method on purpose.
		name = self._mObjName(self._nativeTransform, False)
		displayName = name.split(':')[-1]

		if not namespace:
			cmds.rename(self.path(), self.displayName())
		else:
			if not cmds.namespace(exists=namespace):
				cmds.namespace(add=namespace)
			cmds.rename(self.path(), ':'.join([namespace, displayName]))
		return True 
Example #2
Source File: mayasceneobject.py    From cross3d with MIT License 6 votes vote down vote up
def _nativeModel(self):
		"""
			\remarks	looks up the native model for this object
			\sa			model, setModel, _setNativeModel
			\return		<variant> nativeObject || None
		"""
		parent = self.parent()
		while parent is not None:
			if isinstance(parent, api.SceneModel):
				return parent.nativePointer()

			parent = parent.parent()

		# namespace = self._namespace(self._nativePointer)['namespace']
		# if namespace:
		# 	return self._scene._findNativeObject(name=namespace)
		
		return None 
Example #3
Source File: dpControls.py    From dpAutoRigSystem with GNU General Public License v2.0 6 votes vote down vote up
def shapeSizeSetup(self, transformNode, *args):
        """ Find shapes, create a cluster deformer to all and set the pivot to transform pivot.
            Returns the created cluster.
        """
        clusterHandle = None
        childShapeList = cmds.listRelatives(transformNode, shapes=True, children=True)
    #    print "Child length {0}".format(len(childShapeList))
        if childShapeList:
            thisNamespace = childShapeList[0].split(":")[0]
            cmds.namespace(set=thisNamespace, force=True)
            clusterName = transformNode.split(":")[1]+"_ShapeSizeCH"
            clusterHandle = cmds.cluster(childShapeList, name=clusterName)[1]
            cmds.setAttr(clusterHandle+".visibility", 0)
            cmds.xform(clusterHandle, scalePivot=(0, 0, 0), worldSpace=True)
            cmds.namespace(set=":")
        else:
            print "There are not children shape to create shapeSize setup of:", transformNode
        return clusterHandle 
Example #4
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def name(self, namespace=False):
        """Return the name of this node

        Arguments:
            namespace (bool, optional): Return with namespace,
                defaults to False

        Example:
            >>> node = createNode("transform", name="myName")
            >>> node.name()
            u'myName'

        """

        if namespace:
            return self._fn.name()
        else:
            return self._fn.name().rsplit(":", 1)[-1] 
Example #5
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def path(self):
        return self.name(namespace=True) 
Example #6
Source File: mayascenewrapper.py    From cross3d with MIT License 5 votes vote down vote up
def namespace(self):
		# I am not re-using the name method on purpose.
		name = self._mObjName(self._nativePointer, False)

		# Splitting the name to detect for name spaces.
		split = name.split(':')[0:]
		if len(split) > 1:
			return ':'.join(split[:-1])
		return '' 
Example #7
Source File: mayascenewrapper.py    From cross3d with MIT License 5 votes vote down vote up
def setDisplayName(self, name):
		""" Set the display name for this wrapper instance to the inputed 
		name - if not reimplemented, then it will set the object's actual 
		name to the inputed name
		"""
		cmds.rename(self.path(), ':'.join([self.namespace(), name])) 
Example #8
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __str__(self):
        return self.name(namespace=True) 
Example #9
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __repr__(self):
        return self.name(namespace=True) 
Example #10
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def namespace(self):
        """Get namespace of node

        Example:
            >>> _ = cmds.file(new=True, force=True)
            >>> node = createNode("transform", name="myNode")
            >>> node.namespace()
            u''
            >>> _ = cmds.namespace(add=":A")
            >>> _ = cmds.namespace(add=":A:B")
            >>> node = createNode("transform", name=":A:B:myNode")
            >>> node.namespace()
            u'A:B'

        """

        name = self._fn.name()

        if ":" in name:
            # Else it will return name as-is, as namespace
            # E.g. Ryan_:leftHand -> Ryan_, but :leftHand -> leftHand
            return name.rsplit(":", 1)[0]

        return type(name)()

    # Alias 
Example #11
Source File: publish.py    From anima with MIT License 5 votes vote down vote up
def delete_empty_namespaces(progress_controller=None):
    """Delete empty namespaces

    checks and deletes empty namespaces
    """
    if progress_controller is None:
        progress_controller = ProgressControllerBase()

    # only allow namespaces with DAG objects in it and no child namespaces
    empty_namespaces = []

    all_namespaces = mc.namespaceInfo(
        recurse=True,
        listOnlyNamespaces=True,
        internal=False
    ) or []

    progress_controller.maximum = len(all_namespaces)
    for ns in all_namespaces:
        if ns not in ['UI', 'shared']:
            child_namespaces = mc.namespaceInfo(ns, listNamespace=True)
            if not child_namespaces and len(
                    mc.ls(mc.namespaceInfo(ns, listOnlyDependencyNodes=True),
                          dag=True, mat=True)) == 0:
                empty_namespaces.append(ns)
        progress_controller.increment()

    for ns in empty_namespaces:
        mc.namespace(rm=ns, mnr=True)
    progress_controller.complete() 
Example #12
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def remove(self, members):
        mobj = _encode1(self.name(namespace=True))
        selectionList = om1.MSelectionList()

        if not isinstance(members, (tuple, list)):
            selectionList.add(members.path())

        else:
            for member in members:
                selectionList.add(member.path())

        fn = om1.MFnSet(mobj)
        fn.removeMembers(selectionList) 
Example #13
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def clear(self):
        """Remove all members from set"""
        mobj = _encode1(self.name(namespace=True))
        fn = om1.MFnSet(mobj)
        fn.clear() 
Example #14
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def members(self, type=None):
        op = operator.eq
        other = "typeId"

        if isinstance(type, string_types):
            other = "typeName"

        if isinstance(type, (tuple, list)):
            op = operator.contains

        for node in cmds.sets(self.name(namespace=True), query=True) or []:
            node = encode(node)

            if not type or op(type, getattr(node._fn, other)):
                yield node 
Example #15
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def decode(node):
    """Convert cmdx Node to shortest unique path

    This is the same as `node.shortestPath()`
    To get an absolute path, use `node.path()`

    """

    try:
        return node.shortestPath()
    except AttributeError:
        return node.name(namespace=True) 
Example #16
Source File: cmdx.py    From cmdx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def editCurve(parent, points, degree=1, form=kOpen):
    assert isinstance(parent, DagNode), (
        "parent must be of type cmdx.DagNode"
    )

    degree = min(3, max(1, degree))

    cvs = om1.MPointArray()
    curveFn = om1.MFnNurbsCurve()

    for point in points:
        cvs.append(om1.MPoint(*point))

    mobj = curveFn.createWithEditPoints(cvs,
                                        degree,
                                        form,
                                        False,
                                        False,
                                        True,
                                        _encode1(parent.path()))

    mod = om1.MDagModifier()
    mod.renameNode(mobj, parent.name(namespace=True) + "Shape")
    mod.doIt()

    def undo():
        mod.deleteNode(mobj)
        mod.doIt()

    def redo():
        mod.undoIt()

    commit(undo, redo)

    shapeFn = om1.MFnDagNode(mobj)
    return encode(shapeFn.fullPathName()) 
Example #17
Source File: compat.py    From core with MIT License 5 votes vote down vote up
def remove(container):
    """Remove an existing `container` from Maya scene

    Deprecated; this functionality is replaced by `api.remove()`

    Arguments:
        container (avalon-core:container-1.0): Which container
            to remove from scene.

    """

    node = container["objectName"]

    # Assume asset has been referenced
    reference_node = next((node for node in cmds.sets(node, query=True)
                          if cmds.nodeType(node) == "reference"), None)

    assert reference_node, ("Imported container not supported; "
                            "container must be referenced.")

    log.info("Removing '%s' from Maya.." % container["name"])

    namespace = cmds.referenceQuery(reference_node, namespace=True)
    fname = cmds.referenceQuery(reference_node, filename=True)
    cmds.file(fname, removeReference=True)

    try:
        cmds.delete(node)
    except ValueError:
        # Already implicitly deleted by Maya upon removing reference
        pass

    try:
        # If container is not automatically cleaned up by May (issue #118)
        cmds.namespace(removeNamespace=namespace, deleteNamespaceContent=True)
    except RuntimeError:
        pass 
Example #18
Source File: mayascenewrapper.py    From cross3d with MIT License 5 votes vote down vote up
def _namespace(self, mObj):
		name = self._mObjName(mObj, False)
		return re.match(r'((?P<namespace>[^:]+):)?(?P<name>.+)', name).groupdict() 
Example #19
Source File: mayasceneobject.py    From cross3d with MIT License 5 votes vote down vote up
def namespace(self):
		# I am not re-using the name method on purpose.
		name = self._mObjName(self._nativeTransform, False)

		# Splitting the name to detect for name spaces.
		split = name.split(':')[0:]
		if len(split) > 1:
			return ':'.join(split[:-1])
		return '' 
Example #20
Source File: mayascene.py    From cross3d with MIT License 5 votes vote down vote up
def _nativeObjects(self, getsFromSelection=False, wildcard='', objectType=0):
		""" Implements the AbstractScene._nativeObjects method to return the native objects from the scene
			:return: list [<Py3dsMax.mxs.Object> nativeObject, ..]
		"""
		expression = cross3d.application._wildcardToRegex(wildcard)
		regex = re.compile(expression, flags=re.I)

		if getsFromSelection:
			objects = self._selectionIter()
		else:
			# TODO MIKE: I had to support kCharacters aka key set cause they are part of what we export.
			# The problem is not the export because we don't have to select them since they are "dependant".
			# The issue is for when I try to re-apply the namespace after export.
			mType = cross3d.SceneObject._abstractToNativeObjectType.get(objectType, (om.MFn.kDagNode, om.MFn.kCharacter))
			objects = self._objectsOfMTypeIter(mType)

		if objectType != 0 or wildcard:

			container = []
			for obj in objects:
				typeCheck = True if not objectType else cross3d.SceneObject._typeOfNativeObject(obj) == objectType
				wildcardCheck = True if not wildcard else regex.match(cross3d.SceneObject._mObjName(obj, False))
				if typeCheck and wildcardCheck:
					container.append(obj)
			objects = container
		return objects 
Example #21
Source File: mayascene.py    From cross3d with MIT License 5 votes vote down vote up
def _createNativeModel(self, name='Model', nativeObjects=[], referenced=False):
		name = 'Model' if not name else name
		# Create a "model" namespace and add the locator to it
		# TODO: Make this a context
		currentNamespace = cmds.namespaceInfo(currentNamespace=True)
		namespace = cmds.namespace(addNamespace=name)
		cmds.namespace(setNamespace=namespace)
		# Create the transform node then the shape node so the transform is properly named
		parent = cmds.createNode('transform', name='Model')
		#name = cmds.createNode('locator', name='{}Shape'.format(name), parent=parent)
		output = cross3d.SceneWrapper._asMOBject(parent)
		userProps = cross3d.UserProps(output)
		userProps['model'] = True
		if referenced:
			userProps['referenced'] = referenced
			# Create the Active_Resolution enum if it doesn't exist
#			cmds.addAttr(name, longName="Active_Resolution", attributeType="enum", enumName="Offloaded:")
#			userProps['Resolutions'] = OrderedDict(Offloaded='')
		cmds.namespace(setNamespace=currentNamespace)

		# Add each of nativeObjects to the model namespace
		if nativeObjects:
			for nativeObject in nativeObjects:
				nativeObject = cross3d.SceneWrapper._getTransformNode(nativeObject)
				objName = cross3d.SceneWrapper._mObjName(nativeObject)
#				cmds.parent(objName, cross3d.SceneWrapper._mObjName(nativeParent))
				nameInfo = cross3d.SceneWrapper._namespace(nativeObject)
				newName = '{namespace}:{name}'.format(namespace=namespace, name=nameInfo['name'])
				cmds.rename(objName, newName)
		nativeObjects.append(output)
		return output 
Example #22
Source File: mayascenemodel.py    From cross3d with MIT License 5 votes vote down vote up
def setDisplayName(self, name):
		name = name.replace('-', '_')
		# If the model using a namespace, rename the namespace not the object.
		namespace = self._namespace(self._nativeTransform)['namespace']
		if namespace:
			if namespace == name:
				# Renaming the model to its current name, nothing to do.
				return

			# TODO: pull the reference node from the namespace instead of storing it in a user prop
			# that way if a user swaps reference in the Reference Editor we won't loose track of it.
			filename = self.resolutionPath(self.resolution())

			if self.isReferenced() and filename:
				cmds.file(filename, edit=True, namespace=name, mergeNamespacesOnClash=True)
				# Doc's say cmds.file should move non-referenced nodes to the new namespace, but
				# in practice it doesn't. If the old namespace still exists, move all of its 
				# nodes into the new namespace and remove the old namespace
				if namespace in cmds.namespaceInfo(listOnlyNamespaces=True):
					cmds.namespace(moveNamespace=[namespace, name])
					cmds.namespace(removeNamespace=namespace)
			else:
				namespaces = cmds.namespaceInfo(listOnlyNamespaces=True)
				if name in namespaces:
					# If the namespace already exists we need to auto-increment the value or the
					# rename command will error out
					# reverse the name and pull off any trailing digits
					revName = re.match('(?P<revIter>\d*)(?P<name>.+)', name[::-1])
					if revName:
						n = revName.group('name')[::-1]
						v = int(revName.group('revIter')[::-1] or 1)
						while '{name}{revIter}'.format(name=n, revIter=v) in namespaces:
							v += 1
						name = '{name}{revIter}'.format(name=n, revIter=v)
					else:
						name = '{name}1'.format(name=name)
				cmds.namespace(rename=[namespace, name])
			return
		super(MayaSceneModel, self).setDisplayName(name) 
Example #23
Source File: mayascenemodel.py    From cross3d with MIT License 5 votes vote down vote up
def displayName(self):
		# Ignore the name of the object, we only care about the namespace for tools.
		return self._namespace(self._nativeTransform).get('namespace', '') 
Example #24
Source File: dpBaseClass.py    From dpAutoRigSystem with GNU General Public License v2.0 5 votes vote down vote up
def deleteModule(self, *args):
        """ Delete the Guide, ModuleLayout and Namespace.
        """
        # delete mirror preview:
        try:
            cmds.delete(self.moduleGrp[:self.moduleGrp.find(":")]+"_MirrorGrp")
        except:
            pass
        # delete the guide module:
        utils.clearNodeGrp(nodeGrpName=self.moduleGrp, attrFind='guideBase', unparent=True)
        # clear default 'dpAR_GuideMirror_Grp':
        utils.clearNodeGrp()
        # remove the namespaces:
        allNamespaceList = cmds.namespaceInfo(listOnlyNamespaces=True)
        if self.guideNamespace in allNamespaceList:
            cmds.namespace(moveNamespace=(self.guideNamespace, ':'), force=True)
            cmds.namespace(removeNamespace=self.guideNamespace, force=True)
        try:
            # delete the moduleFrameLayout from window UI:
            cmds.deleteUI(self.moduleFrameLayout)
            self.clearSelectedModuleLayout()
            # edit the footer A text:
            self.currentText = cmds.text("footerAText", query=True, label=True)
            cmds.text("footerAText", edit=True, label=str(int(self.currentText[:self.currentText.find(" ")]) - 1) +" "+ self.langDic[self.langName]['i005_footerA'])
        except:
            pass
        # clear module from instance list (clean dpUI list):
        delIndex = self.dpUIinst.moduleInstancesList.index(self)
        self.dpUIinst.moduleInstancesList.pop(delIndex) 
Example #25
Source File: dpBaseClass.py    From dpAutoRigSystem with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, dpUIinst, langDic, langName, presetDic, presetName, userGuideName, rigType, CLASS_NAME, TITLE, DESCRIPTION, ICON, *args):
        """ Initialize the module class creating a button in createGuidesLayout in order to be used to start the guide module.
        """
        # defining variables:
        self.dpUIinst = dpUIinst
        self.langDic = langDic
        self.langName = langName
        self.guideModuleName = CLASS_NAME
        self.title = TITLE
        self.description = DESCRIPTION
        self.icon = ICON
        self.userGuideName = userGuideName
        self.rigType = rigType
        self.presetDic = presetDic
        self.presetName = presetName
        self.ctrls = dpControls.ControlClass(self.dpUIinst, self.presetDic, self.presetName)
        # defining namespace:
        self.guideNamespace = self.guideModuleName + "__" + self.userGuideName
        # defining guideNamespace:
        cmds.namespace(setNamespace=":")
        self.namespaceExists = cmds.namespace(exists=self.guideNamespace)
        self.guideName = self.guideNamespace + ":Guide"
        self.moduleGrp = self.guideName+"_Base"
        self.radiusCtrl = self.moduleGrp+"_RadiusCtrl"
        self.annotation = self.moduleGrp+"_Ant"
        if not self.namespaceExists:
            cmds.namespace(add=self.guideNamespace)
            # create GUIDE for this module:
            self.createGuide()
        # create the Module layout in the mainUI - modulesLayoutA:        
        self.createModuleLayout()
        # update module instance info:
        self.updateModuleInstanceInfo() 
Example #26
Source File: dpAutoRig.py    From dpAutoRigSystem with GNU General Public License v2.0 5 votes vote down vote up
def initGuide(self, guideModule, guideDir, rigType=Base.RigType.biped, *args):
        """ Create a guideModuleReference (instance) of a further guideModule that will be rigged (installed).
            Returns the guide instance initialised.
        """
        # creating unique namespace:
        cmds.namespace(setNamespace=":")
        # list all namespaces:
        namespaceList = cmds.namespaceInfo(listOnlyNamespaces=True)
        # check if there is "__" (double undersore) in the namespaces:
        for i in range(len(namespaceList)):
            if namespaceList[i].find("__") != -1:
                # if yes, get the name after the "__":
                namespaceList[i] = namespaceList[i].partition("__")[2]
        # send this result to findLastNumber in order to get the next moduleName +1:
        newSuffix = utils.findLastNumber(namespaceList, BASE_NAME) + 1
        # generate the current moduleName added the next new suffix:
        userSpecName = BASE_NAME + str(newSuffix)
        # especific import command for guides storing theses guides modules in a variable:
        basePath = utils.findEnv("PYTHONPATH", "dpAutoRigSystem")
        self.guide = __import__(basePath+"."+guideDir+"."+guideModule, {}, {}, [guideModule])
        reload(self.guide)
        # get the CLASS_NAME from guideModule:
        guideClass = getattr(self.guide, self.guide.CLASS_NAME)
        # initialize this guideModule as an guide Instance:
        guideInstance = guideClass(self, self.langDic, self.langName, self.presetDic, self.presetName, userSpecName, rigType)
        self.moduleInstancesList.append(guideInstance)
        # edit the footer A text:
        self.allGuidesList.append([guideModule, userSpecName])
        self.modulesToBeRiggedList = utils.getModulesToBeRigged(self.moduleInstancesList)
        cmds.text(self.allUIs["footerAText"], edit=True, label=str(len(self.modulesToBeRiggedList)) +" "+ self.langDic[self.langName]['i005_footerA'])
        return guideInstance 
Example #27
Source File: compat.py    From core with MIT License 5 votes vote down vote up
def load(self,
             context,
             name=None,
             namespace=None,
             data=None):
        return load(Loader=self.__class__,
                    representation=context['representation'],
                    name=name,
                    namespace=namespace,
                    data=data) 
Example #28
Source File: mayascenemodel.py    From cross3d with MIT License 4 votes vote down vote up
def export(self, fileName):
		name = self.name()
		objects = self.objects()
		selection = self._scene.selection()

		# Selecting the object.
		self._scene.setSelection(objects)

		# Make sure we set the current namespace to root otherwise the next line does not work.
		initialNamespace = cmds.namespaceInfo(currentNamespace=True)
		cmds.namespace(setNamespace=":" )

		# Trashing the namespace.
		cmds.namespace(removeNamespace=name, mergeNamespaceWithRoot=True)
		
		# Remove attributes that should not be stored in a exported model.
		userProps = self.userProps()
		resolutions = None
		resolution = {}
		if 'resolutions' in userProps:
			resolutions = userProps.pop('resolutions')
		if resolutionAttr in userProps:
			# Resolution is a bit complicated because it can be a enum.
			if cmds.attributeQuery(resolutionAttr, node= self._nativeName(), attributeType=True) == 'enum':
				# Store the enum list
				resolution['names'] = cmds.attributeQuery( resolutionAttr, node=self._nativeName(), listEnum=True)
			resolution['value'] = self.userProps().pop(resolutionAttr)
		# Export the model
		cmds.file(fileName, force=True, exportSelected=True, typ="mayaAscii", usingNamespaces=False)
		
		# Restore the attributes we used earlier
		userProps = self.userProps()
		if resolutions != None:
			userProps['resolutions'] = resolutions
		if resolution:
			if 'names' in resolution:
				cmds.addAttr(self._nativeName(), longName=resolutionAttr, attributeType="enum", enumName=resolution['names'][0])
				cmds.setAttr(self._attrName(), keyable=False, channelBox=True)
				cmds.setAttr(self._attrName(), resolution['value'])
			else:
				userProps[resolutionAttr] = resolution['value']
		
		# Re-add all items to the namespace
		for obj in objects:
			# TODO: Optomize setNamespace, it checks for if the namespace exists before renameing.
			# In this case this is unneccissary.
			obj.setNamespace(name)

		# Restoring the namespace.
		cmds.namespace(setNamespace=initialNamespace)

		# Restoring selection
		self._scene.setSelection(selection)
		return True 
Example #29
Source File: maya_warpper.py    From pipeline with MIT License 4 votes vote down vote up
def clean_up_file():
    pass
    # import references
    """
    refs = cmds.ls(type='reference')
    for i in refs:
        rFile = cmds.referenceQuery(i, f=True)
        cmds.file(rFile, importReference=True, mnr=True)    
        
    defaults = ['UI', 'shared']

    # Used as a sort key, this will sort namespaces by how many children they have.
    def num_children(ns):
        return ns.count(':')

    namespaces = [ns for ns in cmds.namespaceInfo(lon=True, r=True) if ns not in defaults]
    # We want to reverse the list, so that namespaces with more children are at the front of the list.
    namespaces.sort(key=num_children, reverse=True)

    for ns in namespaces:

        if namespaces.index(ns)+1 < len(namespaces):
            parent_ns = namespaces[namespaces.index(ns)+1]   
            cmds.namespace(mv=[ns,parent_ns], f=True) 
            cmds.namespace(rm=ns) 
        else:
            cmds.namespace(mv=[ns,":"], f=True)  
            cmds.namespace(rm=ns) 
	
    # remove ngSkinTools custom nodes
    from ngSkinTools.layerUtils import LayerUtils 
    LayerUtils.deleteCustomNodes()
    
    # remove RRM proxies
    if cmds.objExists("RRM_MAIN"):
        cmds.select("RRM_MAIN",hi=True)
        proxies = cmds.ls(sl=True)
        cmds.lockNode(proxies,lock=False)
        cmds.delete(proxies)
        
        if cmds.objExists("RRM_ProxiesLayer"):
            cmds.delete("RRM_ProxiesLayer")""" 
Example #30
Source File: dpAutoRig.py    From dpAutoRigSystem with GNU General Public License v2.0 4 votes vote down vote up
def populateCreatedGuideModules(self, *args):
        """ Read all guide modules loaded in the scene and re-create the elements in the moduleLayout.
        """
        # create a new list in order to store all created guide modules in the scene and its userSpecNames:
        self.allGuidesList = []
        self.moduleInstancesList = []
        # list all namespaces:
        cmds.namespace(setNamespace=":")
        namespaceList = cmds.namespaceInfo(listOnlyNamespaces=True)
        # find path where 'dpAutoRig.py' is been executed:
        path = utils.findPath("dpAutoRig.py")
        guideDir = MODULES
        # find all module names:
        moduleNameInfo = utils.findAllModuleNames(path, guideDir)
        validModules = moduleNameInfo[0]
        validModuleNames = moduleNameInfo[1]
        
        # check if there is "__" (double undersore) in the namespaces:
        for n in namespaceList:
            divString = n.partition("__")
            if divString[1] != "":
                module = divString[0]
                userSpecName = divString[2]
                if module in validModuleNames:
                    index = validModuleNames.index(module)
                    # check if there is this module guide base in the scene:
                    curGuideName = validModuleNames[index]+"__"+userSpecName+":"+GUIDE_BASE_NAME
                    if cmds.objExists(curGuideName):
                        self.allGuidesList.append([validModules[index], userSpecName, curGuideName])
                        
        # if exists any guide module in the scene, recreate its instance as objectClass:
        if self.allGuidesList:
            # clear current layout before reload modules:
            cmds.deleteUI(self.allUIs["modulesLayoutA"])
            self.allUIs["modulesLayoutA"] = cmds.columnLayout("modulesLayoutA", adjustableColumn=True, width=200, parent=self.allUIs["colMiddleRightA"])
            # load again the modules:
            guideFolder = utils.findEnv("PYTHONPATH", "dpAutoRigSystem")+"."+MODULES
            # this list will be used to rig all modules pressing the RIG button:
            for module in self.allGuidesList:
                mod = __import__(guideFolder+"."+module[0], {}, {}, [module[0]])
                reload(mod)
                # identify the guide modules and add to the moduleInstancesList:
                moduleClass = getattr(mod, mod.CLASS_NAME)
                dpUIinst = self
                if cmds.attributeQuery("rigType", node=module[2], ex=True):
                    curRigType = cmds.getAttr(module[2] + ".rigType")
                    moduleInst = moduleClass(dpUIinst, self.langDic, self.langName, self.presetDic, self.presetName, module[1], curRigType)
                else:
                    if cmds.attributeQuery("Style", node=module[2], ex=True):
                        iStyle = cmds.getAttr(module[2] + ".Style")
                        if (iStyle == 0 or iStyle == 1):
                            moduleInst = moduleClass(dpUIinst, self.langDic, self.langName, self.presetDic, self.presetName, module[1], Base.RigType.biped)
                        else:
                            moduleInst = moduleClass(dpUIinst, self.langDic, self.langName, self.presetDic, self.presetName, module[1], Base.RigType.quadruped)
                    else:
                        moduleInst = moduleClass(dpUIinst, self.langDic, self.langName, self.presetDic, self.presetName, module[1], Base.RigType.default)
                self.moduleInstancesList.append(moduleInst)
        # edit the footer A text:
        self.modulesToBeRiggedList = utils.getModulesToBeRigged(self.moduleInstancesList)
        cmds.text(self.allUIs["footerAText"], edit=True, label=str(len(self.modulesToBeRiggedList)) +" "+ self.langDic[self.langName]['i005_footerA'])