/* NAME: dbCopyAttributes.mel VERSION: 1.0 CATEGORY: Utilities FUNCTION: Quickly copies selected attributes from one object to multiple other. For a similar script with more functionality, see dbCopyTransform.mel USAGE: 1. Copy the dbCopyAttributes.mel into your Maya Scripts directory (Usually found in "My Documents\maya\\scripts\"). 2. Select your source object and your target objects in that order. 3. Select attributes in the channel box that you wish to transfer over. 4. In the Maya Script Editor, type in "dbCopyAttributes" AUTHOR: David Bokser E-MAIL: me@davidbokser.com WEBSITE: www.davidbokser.com */ global proc dbCopyAttributes() { string $objects[] = `ls -sl`; string $channels[] = `channelBox -q -sma mainChannelBox`; string $values[] = {}; for($channel in $channels) { $values[`size($values)`] = `getAttr ($objects[0] + "." + $channel)`; } int $i = 1; int $p = 0; for($i = 1; $i < `size($objects)`; $i++) { for($p = 0; $p < `size($channels)`; $p++) { if(!`getAttr -lock ($objects[$i] + "." + $channels[$p])`){ float $currentVal = $values[$p]; setAttr ($objects[$i] + "." + $channels[$p]) $currentVal; } } } }