// Creation Date: Nov-18-2001 // Last Updated: Nov-18-2001 // Revision: 1.0 // Tested on Maya: 4.01 // // Author: Gino Dammers - gdammers@xs4all.nl // // Procedure Name: // // copyClipboard // // Description: // Copy/Paste's values (not keyframes) from selected channels in the Channelbox // // Use: // From the channelBox select the channels you want copied and run `copyClipboard` // Select an object where you want the info to be paste to and execute `pasteClipboard` // global proc copyClipboard() { //Get the channelBox name from a global string already set in Maya //And set to other variables to remember. global string $gChannelBoxName; global string $pasteChannels[]; global float $pasteValue[]; float $value[]; string $channels[]; string $selObj[] = `ls -sl`; string $selChannels[] = `channelBox -q -sma $gChannelBoxName`; int $selAmount = `size($selChannels)`; if( $selAmount == 0 ) warning "Select atleast 1 channel from ChannelBox to copy from....."; else { for ($count = 0; $count < $selAmount; $count ++) { float $getValue = `getAttr ($selObj[0] + "." + $selChannels[$count])`; $channels[$count] = $selChannels[$count]; $value[$count] = $getValue; } $pasteChannels = $channels; $pasteValue = $value; } } global proc pasteClipboard() { global string $pasteChannels[]; global float $pasteValue[]; string $selObj[] = `ls -sl`; int $sizeChannels = `size($pasteChannels)`; if( `size($selObj)` == 0 ) print "Select atleast 1 object to paste to....."; for ($count = 0; $count < $sizeChannels; $count ++) { if (`objExists ($selObj[0] + "." + $pasteChannels[$count])`) { setAttr ($selObj[0] + "." + $pasteChannels[$count]) $pasteValue[$count]; } } }