MEL How-To #07 | ||
| ||
How can I turn off all of a scene's textures for rendering (similar to the flag in PA)?proc enableMaterials( int $enable ) // Usage: // enableMaterials( 0 ); -- turn off all Materials. Everything renders // gray. // enableMaterials( 1 ); -- turn on all Materials (normal render) { string $materials[] = `ls -materials`; for ( $mat in $materials ) shadingConnection -e -cs $enable ( $mat + ".color" ); } To demonstrate what this script is doing, open the MultiLister and double-click on a Material to display it in the Attribute Editor. Hold down the RMB over the ' To truly disable the texture you'd want to toggle the '.transparency,' '.ambientColor,' etc., attributes as well. I'll leave that as an exercise for the reader. Note: The "Ignore When Rendering" option in the UI is only available on mapped attributes, and there's no indication when the -connectionState is disabled for unmapped attributes. This makes sense, I suppose -- a 'connectionState' doesn't affect something that doesn't have any connections. Regardless, setting the ' Thanks to Scott Hamilton of A|W for sharing this technique. | ||
Copyright ©2005 by Bryan Ewert, maya@ewertb.com Maya is a Registered Trademark of Alias |