class MHWShaderSwatchGenerator

Jump to documentation

: public MSwatchRenderBase Hardware shader swatch generator utility class (OpenMayaUI) (OpenMayaUI.py)

Inheritance:

MHWShaderSwatchGenerator < MSwatchRenderBase

public members:

MHWShaderSwatchGenerator ( MObject obj, MObject renderObj, int res )
static MSwatchRenderBase * createObj ( MObject obj, MObject renderObj, int res)
static const MString & initialize ()
static void getSwatchBackgroundColor (float& r, float& g, float& b, float& a)
virtual bool doIteration ()

Inherited from MSwatchRenderBase:

public members:

virtual bool doIteration ()
MObject swatchNode () const
MObject node () const
int resolution () const
MImage & image ()

Documentation

Hardware shader swatch generator utility class

Description

Derived from the MSwatchRenderBase class as a utility for generating a swatch for a plugin hardware shader class.

Functions

MHWShaderSwatchGenerator:: MHWShaderSwatchGenerator ( MObject obj, MObject renderObj, int res )
Constructor

Class constructor. Initializes base class MSwatchRenderBase with obj, renderObj and res.

MSwatchRenderBase * MHWShaderSwatchGenerator:: createObj ( MObject obj, MObject renderObj, int resolution )

Description

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

Arguments

  • obj The node object for which the swatch needs to be generated.
  • renderObj The node used to actually compute the swatch. In most situation, this can be the same as obj. This parameter can be used to request the computation of the swatch on another node, and display the swatch on the obj node.
  • res The expected resolution of the swatch image.

const MString & MHWShaderSwatchGenerator:: initialize ()

Description

This method sets a swatch name, and registers a new swatch generator creation function for the swatch name. The string returned from this method can be used for node classification purpose.

bool MHWShaderSwatchGenerator:: doIteration ()

Description

This method will be called from the MSwatchRenderRegister for generating a swatch image.

This doIteration function is called repeatedly (during idle events) till it returns true.

void MHWShaderSwatchGenerator:: getSwatchBackgroundColor (float& r, float& g, float& b, float& a)

Description

This method returns the default background color for the hardware rendered swatch.

This class has no child classes.


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