Public Member Functions | Friends

MExternalContentInfoTable Class Reference

This reference page is linked to from the following overview topics: Autodesk Maya 2014.


Search for all occurrences

Detailed Description

This is a table of all the external content for a given MPxNode.

External content is defined as any data that is not stored with the node and that is needed by the node to perform its work. It can be texture files, other scenes, audio files, etc.

Each node that references external content should report it through MPxNode::getExternalContent so that a complete list of external content can be saved with the scene in a way that makes it easy to inspect and edit offline.

#include <MExternalContentInfoTable.h>

List of all members.

Public Member Functions

 MExternalContentInfoTable ()
 Class constructor.
 ~MExternalContentInfoTable ()
 Class destructor.
MStatus addResolvedEntry (const MString &key, const MString &unresolvedLocation, const MString &resolvedLocation, const MStringArray &roles)
 Add an entry in the table.
MStatus addUnresolvedEntry (const MString &key, const MString &unresolvedLocation, const MStringArray &roles=MStringArray())
 Add an entry in the table.
MStatus getInfo (const MString &key, MString &unresolvedLocation, MString &resolvedLocation, MStringArray &roles) const
 NO SCRIPT SUPPORT.
MStatus getEntry (unsigned int index, MString &key, MString &unresolvedLocation, MString &resolvedLocation, MStringArray &roles) const
 NO SCRIPT SUPPORT.
unsigned int length () const
 Retrieves the number of entries in the table.

Friends

class MPxNode
class MFnDependencyNode

Member Function Documentation

MStatus addResolvedEntry ( const MString key,
const MString unresolvedLocation,
const MString resolvedLocation,
const MStringArray roles 
)

Add an entry in the table.

Parameters:
[in]keyAn arbitrary string defined by the caller. This will typically be an attribute name for situations where the content location is stored verbatim in a plug's value.
[in]unresolvedLocationPath as stored in the node (i.e. without any token replacement performed).
[in]resolvedLocationFull path to the content if it exists at the time of creation of this object.
[in]rolesAn enumeration of all roles this content plays in the context of the node. The actual strings are not rigidly defined as of this writing. This is mostly for offline browsing of the content info: to assist in sorting content by role. A better content type system may be introduced later on to formalize this.
Returns:
Return status.
Status Codes:
MStatus addUnresolvedEntry ( const MString key,
const MString unresolvedLocation,
const MStringArray roles = MStringArray() 
)

Add an entry in the table.

The resolved location will be inferred from the application's built-in file resolving for the specified file type. This will automatically add entries into the roles vector that correspond to the search rules for this file type.

Parameters:
[in]keySee documentation for MExternalContentInfoTable::addResolvedEntry.
[in]unresolvedLocationSee documentation for MExternalContentInfoTable::addResolvedEntry.
[in]rolesSee documentation for MExternalContentInfoTable::addResolvedEntry.
Returns:
Return status.
Status Codes:
MStatus getInfo ( const MString key,
MString unresolvedLocation,
MString resolvedLocation,
MStringArray roles 
) const

NO SCRIPT SUPPORT.

Retrieves external content information based on its key.

Parameters:
[in]keySee documentation for MExternalContentInfoTable::addResolvedEntry.
[out]unresolvedLocationSee documentation for MExternalContentInfoTable::addResolvedEntry.
[out]resolvedLocationSee documentation for MExternalContentInfoTable::addResolvedEntry.
[out]rolesSee documentation for MExternalContentInfoTable::addResolvedEntry.

Note: In Python, this method has a different signature:

  def getInfoByKey( 
    key,   # input string
    paths, # output array filled with [ unresolvedLocation, resolvedLocation ]
    roles, # output array filled with [ role1, role2, ..., roleN ]
  )

The function returns a string, the key.

Returns:
Return status.
Status Codes:
MStatus getEntry ( unsigned int  index,
MString key,
MString unresolvedLocation,
MString resolvedLocation,
MStringArray roles 
) const

NO SCRIPT SUPPORT.

Retrieves external content entry based on its position in the table.

Parameters:
[in]indexPosition of the entry to retrieve information from.
[out]keySee documentation for MExternalContentInfoTable::addResolvedEntry.
[out]unresolvedLocationSee documentation for MExternalContentInfoTable::addResolvedEntry.
[out]resolvedLocationSee documentation for MExternalContentInfoTable::addResolvedEntry.
[out]rolesSee documentation for MExternalContentInfoTable::addResolvedEntry.

Note: In Python, this method has a different signature:

  def getEntryByIndex( 
    index, # input integer
    paths, # output array filled with [ unresolvedLocation, resolvedLocation ]
    roles, # output array filled with [ role1, role2, ..., roleN ]
  )

The function returns a string, the key.

Returns:
Return status.
Status Codes:
unsigned int length ( ) const

Retrieves the number of entries in the table.

Returns:
Number of entries.

MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable
MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable MExternalContentInfoTable