// // llResetChannels.MEL // ////////////////////////// // // Maya script file // ////////////////////////// // // Author : Lluís Llobera // (lluisllobera@hotmail.com) // // Creation date : 5/XII/2005 // Update 1.1 : 8/XII/2005 // // Main procedure : type "llResetChannels" in the Command Line or Script Editor // ////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // This script will reset all the current selected objects' attributes to their default // creation value. If some channels are selected in the Channel Box, then the script // will only reset those attributes. // // To use it, I recommend creating a new hotkey and simply pasting the whole script // in the "command" box. // // Enjoy! // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// // llResetChannels // ////////////////////////////////// // // MAIN PROC // // Checks if there are any selected attributes, // then resets them for each selected object after making sure that // they are not locked or hidden. // ///////////////////////////////// global proc llResetChannels () { int $SELECTED = 0 ; string $HIGHLIGHTEDCHANNELS[] = `channelBox -q -sma -soa -ssa mainChannelBox` ; if (`size $HIGHLIGHTEDCHANNELS` > 0) $SELECTED = 1 ; for ($ELEMENT in `ls -sl`) { if ($SELECTED == 0) $HIGHLIGHTEDCHANNELS = `listAttr -k $ELEMENT` ; for ($CHANNEL in $HIGHLIGHTEDCHANNELS) if (`objExists ($ELEMENT + "." + $CHANNEL)`) if (`getAttr -k ($ELEMENT + "." + $CHANNEL)`) if (!`getAttr -l ($ELEMENT + "." + $CHANNEL)`) { $DEFAULT = eval ("attributeQuery -n " + $ELEMENT + " -ld " + $CHANNEL) ; setAttr ($ELEMENT + "." + $CHANNEL) $DEFAULT[0] ; } ; } ; // for ($ELEMENT in `ls -sl` } ; // global proc llResetChannels llResetChannels ; //////////////////////////////////////////////////////////////////////////////////////// // // EoS llResetChannels.mel // ////////////////////////////////////////////////////////////////////////////////////////