Public Member Functions | Protected Member Functions

MFnReference Class Reference

This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013.


Search for all occurrences

Detailed Description

Function set for querying information about file references.

Reference nodes are used to track data about file references. Referenced files may be loaded and unloaded. They also store data about changes made to objects in the referenced file. The class MItReferenceEdits may be used to retrieve information about such changes.

The class MFileIO may be used to perform actual operations on references such as loading, unloading, adding and removing references.

#include <MFnReference.h>

Inheritance diagram for MFnReference:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual MFn::Type type () const
 Function set type.
virtual ~MFnReference ()
 Destructor.
 MFnReference ()
 Default constructor.
 MFnReference (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.
MString fileName (bool resolvedName, bool includePath, bool includeCopyNumber, MStatus *ReturnStatus=NULL) const
 Returns the name of file associated with this reference.
MString associatedNamespace (bool shortName, MStatus *ReturnStatus=NULL) const
 Returns the namespace associated with this reference.
MString parentFileName (bool resolvedName, bool includePath, bool includeCopyNumber, MStatus *ReturnStatus=NULL) const
 Returns the name of parent file associated with this reference.
MObject parentReference (MStatus *ReturnStatus=NULL) const
 Returns the reference node associated with the parent file.
bool containsNode (const MObject &node, MStatus *ReturnStatus=NULL) const
 Returns true if the specified node is from this reference or one of its child references.
bool containsNodeExactly (const MObject &node, MStatus *ReturnStatus=NULL) const
 Returns true if the specified node is from this reference.
void nodes (MObjectArray &nodes, MStatus *ReturnStatus=NULL) const
 Returns an array of the nodes associated with this reference.
bool isLoaded (MStatus *ReturnStatus=NULL) const
 Returns true if the reference is loaded.
bool isLocked (MStatus *ReturnStatus=NULL) const
 Returns true if the reference is locked or if the referenced file was saved as locked.
bool isExportEditsFile (MStatus *ReturnStatus=NULL) const
 Returns true if the reference is an export edits file.
 MFnReference (const MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.

Protected Member Functions

virtual const char * className () const
 Class name.

Constructor & Destructor Documentation

MFnReference ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
MFnReference ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:

Member Function Documentation

MFn::Type type ( ) const [virtual]

Function set type.

Return the class type : MFn::kReference.

Reimplemented from MFnDependencyNode.

MString fileName ( bool  resolvedName,
bool  includePath,
bool  includeCopyNumber,
MStatus ReturnStatus = NULL 
) const

Returns the name of file associated with this reference.

Parameters:
[in]resolvedNameIf true, return the resolved name rather than the original file name. The unresolved name is the string originally specified when the file was loaded into Maya; this may contain environment variables, may be a relative path, and may otherwise not precisely indicate where the file can be located on disk. The resolved name is the actual path name that Maya is using to locate the file after relative paths and environment variables have been expanded, and any other necessary steps have been used to resolve its physical location.
[in]includePathIf true, include the file path in the return string.
[in]includeCopyNumberIf true, include the copy number (if there is one) in the return string.
[out]ReturnStatusreturn status
Returns:
The name of the referenced file
Status Codes:
MString associatedNamespace ( bool  baseName,
MStatus ReturnStatus = NULL 
) const

Returns the namespace associated with this reference.

Parameters:
[in]baseNameIf true, return the base name of the reference
[out]ReturnStatusreturn status
Returns:
The namespace of this reference
Status Codes:
MString parentFileName ( bool  resolveName,
bool  includePath,
bool  includeCopyNumber,
MStatus ReturnStatus = NULL 
) const

Returns the name of parent file associated with this reference.

Parameters:
[in]resolveNameIf true, return the resolved name rather than the original file name. The unresolved name is the string originally specified when the file was loaded into Maya; this may contain environment variables, may be a relative path, and may otherwise not precisely indicate where the file can be located on disk. The resolved name is the actual path name that Maya is using to locate the file after relative paths and environment variables have been expanded, and any other necessary steps have been used to resolve its physical location.
[in]includePathIf true, include the file path in the return string.
[in]includeCopyNumberIf true, include the copy number (if there is one) in the return string.
[out]ReturnStatusreturn status
Returns:
The name of the parent file to the reference. Returns an empty string if there is no parent file.
Status Codes:
MObject parentReference ( MStatus ReturnStatus = NULL) const

Returns the reference node associated with the parent file.

Parameters:
[out]ReturnStatusreturn status
Returns:
The parent reference of this reference or MObject::kNullObj if there is no associated reference.
Status Codes:
bool containsNode ( const MObject node,
MStatus ReturnStatus = NULL 
) const

Returns true if the specified node is from this reference or one of its child references.

The containsNodeExactly method can be used to test membership without including the child references.

Parameters:
[in]nodeThe node to be checked
[out]ReturnStatusreturn status
Returns:
Whether or not the node is from the reference or one of its child references.
Status Codes:
bool containsNodeExactly ( const MObject node,
MStatus ReturnStatus = NULL 
) const

Returns true if the specified node is from this reference.

Membership in child references is not checked. The containsNode method may be used to test membership in a reference and its child references.

Parameters:
[in]nodeThe node to be checked
[out]ReturnStatusreturn status
Returns:
Whether or not the node is from the reference.
Status Codes:
void nodes ( MObjectArray nodeList,
MStatus ReturnStatus = NULL 
) const

Returns an array of the nodes associated with this reference.

Parameters:
[out]nodeListthe nodes from this reference
[out]ReturnStatusreturn status
Status Codes:
bool isLoaded ( MStatus ReturnStatus = NULL) const

Returns true if the reference is loaded.

Parameters:
[out]ReturnStatusreturn status
Returns:
Whether or not the reference is loaded
Status Codes:
bool isLocked ( MStatus ReturnStatus = NULL) const

Returns true if the reference is locked or if the referenced file was saved as locked.

Parameters:
[out]ReturnStatusreturn status
Returns:
Returns true if the reference is locked or if the referenced file was saved as locked
Status Codes:

Reimplemented from MFnDependencyNode.

bool isExportEditsFile ( MStatus ReturnStatus = NULL) const

Returns true if the reference is an export edits file.

An export edits file is a file of type ".editMA" or ".editMB" which was created using Maya's offline file functionality.

Parameters:
[out]ReturnStatusreturn status
Returns:
Whether or not the reference is an export edits file
Status Codes:

MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference
MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference MFnReference