C++ API Reference
MExternalContentInfoTable Class Reference

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

#include <MExternalContentInfoTable.h>

Public Member Functions

 MExternalContentInfoTable ()
 Class constructor.
 
 ~MExternalContentInfoTable ()
 Class destructor.
 
MStatus addResolvedEntry (const MString &key, const MString &unresolvedLocation, const MString &resolvedLocation, const MStringArray &roles)
 This method is obsolete. More...
 
MStatus addResolvedEntry (const MString &key, const MString &unresolvedLocation, const MString &resolvedLocation, const MString &contextNodeFullName, const MStringArray &roles)
 Add an entry in the table. More...
 
MStatus addUnresolvedEntry (const MString &key, const MString &unresolvedLocation, const MStringArray &roles=MStringArray())
 This method is obsolete. More...
 
MStatus addUnresolvedEntry (const MString &key, const MString &unresolvedLocation, const MString &contextNodeFullName, const MStringArray &roles=MStringArray())
 Add an entry in the table. More...
 
MStatus getInfo (const MString &key, MString &unresolvedLocation, MString &resolvedLocation, MStringArray &roles) const
 NO SCRIPT SUPPORT. More...
 
MStatus getInfo (const MString &key, MString &unresolvedLocation, MString &resolvedLocation, MString &contextNodeFullName, MStringArray &roles) const
 NO SCRIPT SUPPORT. More...
 
MStatus getEntry (unsigned int index, MString &key, MString &unresolvedLocation, MString &resolvedLocation, MStringArray &roles) const
 obsolete, use the one with contextNodeFullName param NO SCRIPT SUPPORT More...
 
MStatus getEntry (unsigned int index, MString &key, MString &unresolvedLocation, MString &resolvedLocation, MString &contextNodeFullName, MStringArray &roles) const
 NO SCRIPT SUPPORT. More...
 
unsigned int length () const
 Retrieves the number of entries in the table. More...
 
 MExternalContentInfoTable (void *data)
 Class constructor.
 

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.

Examples:
AbcImport/AlembicNode.cpp, AbcImport/AlembicNode.h, dx11Shader/dx11Shader.cpp, dx11Shader/dx11Shader.h, glslShader/GLSLShader.cpp, glslShader/GLSLShader.h, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheShapeNode.h, sceneAssembly/adskRepresentations.cpp, sceneAssembly/adskRepresentations.h, sceneAssembly/assemblyDefinition.cpp, sceneAssembly/assemblyDefinition.h, sceneAssembly/assemblyReference.cpp, and sceneAssembly/assemblyReference.h.

Member Function Documentation

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

This method is obsolete.

[From Maya 2019]

Deprecated:
Context (owner Node full name) must be provided to the Maya resolver. Use the one with the contextNodeFullName input param.
Deprecated:
Context (owner Node full name) must be provided to the Maya resolver. Use the one with the contextNodeFullName input param.

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:
  • MS::kSuccess The method successfully added the entry.
  • MS::kFailure The method failed to add the entry.
Examples:
sceneAssembly/assemblyDefinition.cpp.
MStatus addResolvedEntry ( const MString key,
const MString unresolvedLocation,
const MString resolvedLocation,
const MString contextNodeFullName,
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]contextNodeFullNameThe fullname of the URI owner (node) if it applies, an empty string otherwise.
[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:
  • MS::kSuccess The method successfully added the entry.
  • MS::kFailure The method failed to add the entry.
MStatus addUnresolvedEntry ( const MString key,
const MString unresolvedLocation,
const MStringArray roles = MStringArray() 
)

This method is obsolete.

Deprecated:
Context (owner Node full name) must be provided to the Maya resolver. Use the one with the contextNodeFullName input param.

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:
  • MS::kSuccess The method successfully added the entry.
  • MS::kFailure The method failed to add the entry.
Examples:
sceneAssembly/adskRepresentations.cpp, and sceneAssembly/assemblyReference.cpp.
MStatus addUnresolvedEntry ( const MString key,
const MString unresolvedLocation,
const MString contextNodeFullName,
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]contextNodeFullNameSee documentation for MExternalContentInfoTable::addResolvedEntry.
[in]rolesSee documentation for MExternalContentInfoTable::addResolvedEntry.
Returns
Return status.
Status Codes:
  • MS::kSuccess The method successfully added the entry.
  • MS::kFailure The method failed to add the entry.
MStatus getInfo ( const MString key,
MString unresolvedLocation,
MString resolvedLocation,
MStringArray roles 
) const

NO SCRIPT SUPPORT.

This method is obsolete.

This method is obsolete. [From Maya 2019]

Deprecated:
Use the one with the contextNodeFullName output param.
Deprecated:
Use the one with the contextNodeFullName output param.

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:
  • MS::kSuccess The method successfully retrieved the entry.
  • MS::kFailure The method failed to retrieve the entry.
MStatus getInfo ( const MString key,
MString unresolvedLocation,
MString resolvedLocation,
MString contextNodeFullName,
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]contextNodeFullNameSee 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 ]
contextNodeFullName, # output full name of the owner Node (context)
roles, # output array filled with [ role1, role2, ..., roleN ]
)

The function returns a string, the key.

Returns
Return status.
Status Codes:
  • MS::kSuccess The method successfully retrieved the entry.
  • MS::kFailure The method failed to retrieve the entry.
MStatus getEntry ( unsigned int  index,
MString key,
MString unresolvedLocation,
MString resolvedLocation,
MStringArray roles 
) const

obsolete, use the one with contextNodeFullName param NO SCRIPT SUPPORT

This method is obsolete.

Deprecated:
Use the one with the contextNodeFullName output param.

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:
  • MS::kSuccess The method successfully retrieved the entry.
  • MS::kFailure The method failed to retrieve the entry.
Examples:
sceneAssembly/assemblyDefinition.cpp.
MStatus getEntry ( unsigned int  index,
MString key,
MString unresolvedLocation,
MString resolvedLocation,
MString contextNodeFullName,
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]contextNodeFullNameSee 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 ]
contextNodeFullName, # output full name of the owner Node (context)
roles, # output array filled with [ role1, role2, ..., roleN ]
)

The function returns a string, the key.

Returns
Return status.
Status Codes:
  • MS::kSuccess The method successfully retrieved the entry.
  • MS::kFailure The method failed to retrieve the entry.
unsigned int length ( ) const

Retrieves the number of entries in the table.

Returns
Number of entries.
Examples:
sceneAssembly/assemblyDefinition.cpp.

The documentation for this class was generated from the following files: