MECO™ API Reference
Public Member Functions | Static Public Member Functions | List of all members
mMayaCore.referenceLib.Reference Class Reference

[ CLASS ] - Class to operate on referenced nodes in Maya. More...

Inheritance diagram for mMayaCore.referenceLib.Reference:
mMayaCore.nameSpaceLib.NameSpace mCore.nameSpaceLib.NameSpace

Public Member Functions

def __init__ (self, node=None)
 Constructor. More...
 
def node (self)
 Node. More...
 
def exists (self)
 Check whether the node exists. More...
 
def setNode (self, node)
 Set node. More...
 
def reload (self)
 Reload the referenced node. More...
 
def duplicate (self)
 Duplicate given referenced node. More...
 
def remove (self)
 Remove the given referenced node. More...
 
- Public Member Functions inherited from mCore.nameSpaceLib.NameSpace
def head (self)
 Get name space portion of the name space. More...
 
def tail (self)
 Get the tail portion of the name space. More...
 
def isValid (cls, nameSpace)
 Determine whether given string is a valid name space. More...
 
def removeNameSpace (cls, name)
 Remove name space from the given name. More...
 
def addNameSpace (cls, nameSpace, name, removeExisting=True)
 Add given name space to given name. More...
 
def nameSpace (self)
 NameSpace. More...
 
def setNameSpace (self, nameSpace)
 Set name space. More...
 

Static Public Member Functions

def isNodeReferenced (node)
 Check whether the given node is a referenced node. More...
 
def create (mayaFile, nameSpace=None)
 Create reference from given file. More...
 
def duplicateSelected ()
 Duplicate selected referenced nodes. More...
 
def removeSelected ()
 Remove selected referenced nodes. More...
 
def reloadSelected ()
 Reload selected referenced nodes. More...
 

Additional Inherited Members

- Static Public Attributes inherited from mCore.nameSpaceLib.NameSpace
string NAME_SPACE_DELIMITER = ':'
 [ str ] - Name space delimiter.
 
string FULL_PATH_DELIMITER = '|'
 [ str ] - Full path delimiter.
 

Detailed Description

[ CLASS ] - Class to operate on referenced nodes in Maya.

import sys
reference = mMayaCore.referenceLib.Reference(node='someMayaFile:pCube1')
sys.stdout.write(reference.exists())
# True
sys.stdout.write(reference.setNode(node='someMayaFile:pCube1'))
# True
sys.stdout.write(reference.node())
# someMayaFile:pCube1
sys.stdout.write(reference.reload())
# True
sys.stdout.write(reference.duplicate())
# /pathToFile/someMayaFile.ma{2}
sys.stdout.write(reference.remove())
# True
sys.stdout.write(mMayaCore.referenceLib.Reference.create(mayaFile='/pathToFile/someMayaFile.ma'))
# /pathToFile/someMayaFile.ma
sys.stdout.write(mMayaCore.referenceLib.Reference.isNodeReferenced(node='someMayaFile:pCube1'))
# True
# False

Constructor & Destructor Documentation

◆ __init__()

def mMayaCore.referenceLib.Reference.__init__ (   self,
  node = None 
)

Constructor.

Parameters
node[ str | None | in ] - Name of the node.
Exceptions
N/A
Returns
None.

Reimplemented from mMayaCore.nameSpaceLib.NameSpace.

Member Function Documentation

◆ node()

def mMayaCore.referenceLib.Reference.node (   self)

Node.

Exceptions
N/A
Returns
str - Name of the node.
None - If node is not set.

◆ exists()

def mMayaCore.referenceLib.Reference.exists (   self)

Check whether the node exists.

Checks whether node is None. Checks whether the node exists.

Exceptions
N/A
Returns
bool - Result.

◆ setNode()

def mMayaCore.referenceLib.Reference.setNode (   self,
  node 
)

Set node.

Returns False if the node is not a referenced node.

Parameters
node[ str | None | in ] - Name of the node.
Exceptions
N/A
Returns
bool - Result.

◆ reload()

def mMayaCore.referenceLib.Reference.reload (   self)

Reload the referenced node.

Exceptions
N/A
Returns
bool - Result.

◆ duplicate()

def mMayaCore.referenceLib.Reference.duplicate (   self)

Duplicate given referenced node.

Exceptions
N/A
Returns
str - Resolved name of the referenced file.
None - If not is not set.

◆ remove()

def mMayaCore.referenceLib.Reference.remove (   self)

Remove the given referenced node.

Exceptions
N/A
Returns
bool - Result.

◆ isNodeReferenced()

def mMayaCore.referenceLib.Reference.isNodeReferenced (   node)
static

Check whether the given node is a referenced node.

Parameters
node[ str | None | in ] - Name of the node.
Exceptions
N/A
Returns
bool - Result.

◆ create()

def mMayaCore.referenceLib.Reference.create (   mayaFile,
  nameSpace = None 
)
static

Create reference from given file.

If nameSpace argument left out, file name will be the name space for the referenced nodes.

Parameters
mayaFile[ str | None | in ] - Name of the file, Maya ASCII or Maya Binary.
nameSpace[ str | None | in ] - Namespace of the referenced nodes.
Exceptions
N/A
Returns
str - Resolved name of the referenced file.
None - If maya file doesn't exist.

◆ duplicateSelected()

def mMayaCore.referenceLib.Reference.duplicateSelected ( )
static

Duplicate selected referenced nodes.

Exceptions
N/A
Returns
None

◆ removeSelected()

def mMayaCore.referenceLib.Reference.removeSelected ( )
static

Remove selected referenced nodes.

Method actually removes the referenced file which will be retrieved from the referenced nodes.

Exceptions
N/A
Returns
None

◆ reloadSelected()

def mMayaCore.referenceLib.Reference.reloadSelected ( )
static

Reload selected referenced nodes.

Method actually reloads the referenced file which will be retrieved from the referenced nodes.

Exceptions
N/A
Returns
None

The documentation for this class was generated from the following file:
mMayaCore.referenceLib.Reference.duplicateSelected
def duplicateSelected()
Duplicate selected referenced nodes.
Definition: referenceLib.py:272
mMayaCore.referenceLib.Reference.create
def create(mayaFile, nameSpace=None)
Create reference from given file.
Definition: referenceLib.py:251
mMayaCore.referenceLib
[ FILE ] - Operate on referenced nodes in Maya.
Definition: referenceLib.py:1
mMayaCore.referenceLib.Reference
[ CLASS ] - Class to operate on referenced nodes in Maya.
Definition: referenceLib.py:84
mMayaCore.referenceLib.Reference.removeSelected
def removeSelected()
Remove selected referenced nodes.
Definition: referenceLib.py:296
mMayaCore.referenceLib.Reference.isNodeReferenced
def isNodeReferenced(node)
Check whether the given node is a referenced node.
Definition: referenceLib.py:228
mMayaCore.referenceLib.Reference.reloadSelected
def reloadSelected()
Reload selected referenced nodes.
Definition: referenceLib.py:329