Alexander Zinatulin posts a small utility script for Autodesk Maya which will render shader swatches for HyperShade swatch previews when using the mental ray materials and mia_materials. Ken_Swatch_Me will render a swatch preview based on the material parameters with the click of a button.

This script will help you test your materials

Interestingly, because you are actually rendering a preview, you can change the type of object that will be used in the swatch preview. Ken_Swatch_Me will allow you to create a preview swatch for Maya with a standard sphere, cylinder, cube, or apple, diamond or even the suzanne monkey, while allowing you to selectively control the background, key and fill light intensities, and lighting directions for the swatch.

Using Ken_Swatch_Me is simple, place BigSwatchWindow.mel, ken_swatch_me.mel and Ken folder to your scripts folder, place icon.png to your icons folder, then run “ken_swatch_me” in the script editor. Check out the ken_swatch_me script for generating shader swatch previews in Maya Mental Ray here.