class MPxMaterialInformation

Jump to documentation

Material information proxy. (OpenMaya) (OpenMayaMPx.py)

public members:

MPxMaterialInformation ( MObject & materialNode)
virtual ~MPxMaterialInformation ()
bool useMaterialAsTexture ()
virtual bool materialInfoIsDirty (const MPlug & plug)
virtual bool connectAsTexture (const MPlug & plug)
virtual bool textureDisconnected (const MPlug & plug)
virtual bool computeMaterial (MaterialInputData& data)

Documentation

Material information proxy. (OpenMaya) (OpenMayaMPx.py)
Description

The MPxMaterialInformation class is a way for users to override the viewport representation of shaders. The viewport uses a simple phong model for display in the viewport. With this class users can provide their own values for the phong shading parameters.

Functions

MPxMaterialInformation:: MPxMaterialInformation ( MObject & materialNode)

Description

Constructor

Arguments

  • materialNode material info node

MPxMaterialInformation:: ~MPxMaterialInformation ()

Description

The class destructor.

bool MPxMaterialInformation:: useMaterialAsTexture ()

Description

Tells Maya whether to this material should be displayed as a texture, ie whether it should be baked.

Return Value

  • true if the material should be baked texture

bool MPxMaterialInformation:: materialInfoIsDirty (const MPlug & plug)

Description

Called by Maya to when a plug on the shader has been changed. This method tells Maya if the material information is dirty. If it is dirty Maya triggers a refresh of the viewport.

Arguments

  • plug the plug that was changed

Return Value

  • true if the material information is dirty, false otherwise

bool MPxMaterialInformation:: connectAsTexture (const MPlug & plug)

Description

Called by Maya to when an incoming connection is made to plug on the shader. This method tells Maya if connection should be treated as a to a texture. If the connection is treated as a texture the Maya will bake the properties of the source plug for display in the viewport. Currently only one channel/plug on the shader can be treated as a texture.

Arguments

  • plug the plug that was connected

Return Value

  • true if connection should be treated as a texture, false otherwise

bool MPxMaterialInformation:: textureDisconnected (const MPlug & plug)

Description

Called whenever an incoming connection to the shader is broken.

Arguments

  • plug the plug that was disconnected.

Return Value

  • true if connection should be treated as a texture, false otherwise

bool MPxMaterialInformation:: computeMaterial (MaterialInputData& data)

Description

Compute the material properties/information for the shader. These properties are the parameters for a simple phong shading model used for display in the viewport

Arguments

  • data the material properties/information

Return Value

  • true if valid material properties/information were created, false otherwise

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright