Tech Tip Tuesday: Transfer Animation Curves

Copying and pasting curves isn’t necessarily difficult in Maya, but there’s a lot of options to fiddle with, and a lot of times all you want to do is simply copy all animation directly from one node to another. For example, mirroring FK animation, swapping out puppets or props, animating a swarm of something, etc. So just select your source and destination nodes, and run one of the following:

MEL:

{
string $sel[] = `ls -sl`;
if(size($sel)==2){
    copyKey $sel[0];
    pasteKey -option "replaceCompletely" $sel[1];
}
}

Python:

sel = mc.ls(sl=True)
if len(sel) == 2:
    mc.copyKey(sel[0])
    mc.pasteKey(sel[1], option='replaceCompletely')
Share Button
This entry was posted in Maya, MEL, Python, Tech Tip Tuesday. Bookmark the permalink.

2 Responses to Tech Tip Tuesday: Transfer Animation Curves

  1. Matt Pidgeon says:

    This script is a lifesaver! many thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *