MEL How-To #67 | ||
| ||
How do I control the visibility for the currently active Display Layer?A quick scan through the MEL Command Reference indicates the following commands are available for accessing Display Layer information: createDisplayLayer editDisplayLayerGlobals editDisplayLayerMembers The second of these commands is used to query and set the current Display Layer; e.g.: string $currentDisplayLayer = `editDisplayLayerGlobals -q -currentDisplayLayer`; // Result: defaultLayer // A Display Layer's visibility is controlled in the same manner as other Maya
nodes -- that is, by its ‘ setAttr defaultLayer.visibility true; So, to toggle the visibility of the current Display Layer: string $currentDisplayLayer = `editDisplayLayerGlobals -q -currentDisplayLayer`; string $visAttr = ( $currentDisplayLayer + ".visibility" ); setAttr $visAttr ( !`getAttr $visAttr` ); Related How-To's
| ||
Copyright ©2005 by Bryan Ewert, maya@ewertb.com Maya is a Registered Trademark of Alias |