class MSwatchRenderBase

Jump to documentation

Swatch Render Base class (OpenMayaRender) (OpenMayaRender.py)

Inheritance:

MSwatchRenderBase

public members:

MSwatchRenderBase ( MObject obj, MObject renderObj, int res)
constructor
virtual ~MSwatchRenderBase ()
destructor
virtual bool doIteration ()
Method called to do swatch image generation, derived classes needs to implement this.
MObject swatchNode () const
returns the node for which the swatch is required to be generated
MObject node () const
returns the node used to compute the swatch
int resolution () const
returns the expected resolution of the swatch image
MImage & image ()
returns the swatch image

Documentation

A class providing an interface through which a plugin can implement a class to provide custom rendered images for swatches which are displayed in hypershade and the Attribute Editor.

By deriving from this class and implementing the doIteration function, swatches for nodes (having the required classification) can be custom rendered by the plugin.

The derived class needs to be registered with Maya using the interface provided by MSwatchRenderRegister. Please refer to documentation of MSwatchRenderRegister for more details.

To indicate that swatch for a certain node type will be generated by the plugin the classfication string of the node needs to contain the following string : "swatch/<swatch generator name>" The swatch generator name string should match the name used to register the swatch generator class.

Description

Serves as a base class for the plugin swatch generator classes.

Functions

MSwatchRenderBase:: MSwatchRenderBase ( MObject obj, MObject renderObj, int res)

Description

Class constructor. Saves the Node object and image resolution in members for future use.

Arguments

  • obj The node object for which the swatch needs to be generated.
  • res The expected resolution of the swatch image.

MSwatchRenderBase:: ~MSwatchRenderBase ()

Description

Class destructor.

bool MSwatchRenderBase:: doIteration ()

Description

Method called from the MSwatchRenderRegister for generation of swatch image. The doIteration function is called repeatedly (during idle events) till it returns true. Using this swatch image can be generated in stages.

MObject MSwatchRenderBase:: swatchNode () const

Description

This method returns the node for which the swatch is required to be generated.

MObject MSwatchRenderBase:: node () const

Description

This method returns the node that is used to compute the swatch.

int MSwatchRenderBase:: resolution () const

Description

This method returns the expected resolution of the swatch

MImage & MSwatchRenderBase:: image ()

Description

This method returns the the render swatch as an image.

Direct child classes:

- MHWShaderSwatchGenerator

Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright