- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MAttributeParameterMapping Class Reference
OpenMayaRender - API module for rendering

Search for all occurrences

## Detailed Description

Class for defining relationship between Maya attributes and fragment parameters.

MAttributeParameterMapping allows implementations of MPxShadingNodeOverride to describe which attribute on a Maya node drives which parameter on the corresponding shader fragment or fragment graph. The plugin can provide a list of mappings in getCustomMappings(). Additional mappings will be automatically created by Maya after getCustomMappings() is called for any attributes that have a parameter on the fragment or fragment graph with the same name and type.

`#include <MPxShadingNodeOverride.h>`

List of all members.

## Public Member Functions
| MAttributeParameterMapping (const MString &paramName, const MString &attrName, bool allowConnection, bool allowRename)
| Constructor.
| ~MAttributeParameterMapping ()
| Destructor.
const MString & | parameterName () const
| Get the parameter name for this mapping.
const MString & | resolvedParameterName () const
| Get the resolved parameter name for this mapping.
const MString & | attributeName () const
| Get the attribute name for this mapping.
bool | allowConnection () const
| This method returns true if Maya is allowed to connect other shade fragments to the parameter named by this mapping.
bool | allowRename () const
| This method returns true if the parameter named by this mapping may be renamed in the final shading effect.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Constructor & Destructor Documentation

MAttributeParameterMapping | ( | const MString & | paramName,
|  | const MString & | attrName,
|  | bool | allowConnection,
|  | bool | allowRename
| ) |  |

Constructor.

Define the association between an attribute on the Maya node and a parameter on the shade fragment.

The attribute name for a mapping may be set to the empty string to indicate that the parameter on the fragment is not directly associated with any attribute on the node but that it should still be tracked and renamed (if allowRename is true). The parameter name must always be non-empty and must exist as a parameter on the associated shading fragment.

Parameters:

  [in] | paramName | The name of the parameter on the shading fragment
  [in] | attrName | The name of the attribute on the Maya node
  [in] | allowConnection | Set to false to prevent Maya from connecting any other fragment to the parameter named by this mapping
  [in] | allowRename | Set to false to prevent Maya from renaming the parameter named by this mapping

## Member Function Documentation

const MString & parameterName | ( |  | ) | const

Search for all occurrences

Get the parameter name for this mapping.

Returns:
  The name of the parameter for this mapping

const MString & resolvedParameterName | ( |  | ) | const

Search for all occurrences

Get the resolved parameter name for this mapping.

After the fragment has been joined with other fragments to form the final shading effect its parameters are renamed to prevent name collisions. This returns the name of the parameter on the final shading effect. This name is useful in MPxShadingNodeOverride::updateShader() for setting parameter values manually.

If the fragment has not yet been joined with other fragments, this will return the same string as parameterName().

Returns:
  The resolved name of the parameter for this mapping

const MString & attributeName | ( |  | ) | const

Search for all occurrences

Get the attribute name for this mapping.

Returns:
  The name of the attribute for this mapping

bool allowConnection | ( |  | ) | const

Search for all occurrences

This method returns true if Maya is allowed to connect other shade fragments to the parameter named by this mapping.

Returns:
  True if connections are allowed

bool allowRename | ( |  | ) | const

Search for all occurrences

This method returns true if the parameter named by this mapping may be renamed in the final shading effect.

If false, name collisions of parameters will be unresolved and results will be unpredictable.

Returns:
  True if the parameter may be renamed

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping
MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping MAttributeParameterMapping