Page 1 of 1

The maxwellLayeredMaterial "preview" button

Posted: Tue Oct 18, 2011 3:51 am
by r3dcube
Hi,

I was trying to write a script that would just push the preview button for all the maxwell shaders in the scene. When scenes crash it seems to lose the connection between the swatches in hypershade. Pressing the button with echo all commands only brings up a lot of query's... Hoping this is a mel command...

cheers,
B

Re: The maxwellLayeredMaterial "preview" button

Posted: Tue Oct 18, 2011 10:42 am
by Mihnea Balta
You just need to set the "updateSwatch" material attribute to true:
Code: Select all
setAttr materialNode.updateSwatch true;

Re: The maxwellLayeredMaterial "preview" button

Posted: Tue Oct 18, 2011 11:41 pm
by r3dcube
That's it... worked great. Is there a list of Maxwell Mel commands somewhere? I've found the scripts in the \Autodesk\Maya2012\scripts\others folder.

Re: The maxwellLayeredMaterial "preview" button

Posted: Wed Oct 19, 2011 8:34 am
by Mihnea Balta
The main interface between MEL and the plug-in code is the "maxwell" command. You can get a list of the flags supported by this command by typing "help maxwell", but most of them are not useful directly, because they handle internal details and are called by more complex MEL code.

There are lots of functions in the maxwell*.mel scripts found in scripts/others, but they are mostly concerned with building the UI, adding custom attributes etc. There are no special commands. You can browse those files to see if you find anything you're interested in, or to see how some of the details are implemented.