Monday, March 30, 2009

MEL: Toggle Background Color in Maya

Ever wanted a button to toggle the background color of your viewport(s) in Maya? We needed one the other day to toggle to white for playblasts/reviews and back to grey for working normally.

//
int $toggled_color ;
if($toggled_color == 0)
{
displayRGBColor "background" 1. 1. 1. ;
$toggled_color = 1 ;
}
else
{
displayRGBColor "background" 0.688 0.688 0.688 ;
$toggled_color = 0 ;
}
//

Middle mouse drag this into your shelf to make a button for it. It's currently set at White and Grey. You'll need to know the RGB values to change the colors.

0 comments:

Post a Comment