An animator at my studio asked me to put together a quick tool to copy and paste Tran,Rot,Sca data in worldspace selectively from one key to another. Scripting it was pretty easy. It just grabs and banks the data based upon user input via checkboxes. I ended up making it do local as well since that wasn’t much more work. The tool seemed to work fine because of the way I was working, but when I went to show the animator, it was rather embarrassing.
The basis of the script is copy executes a “bankpos=$.position” and paste executes “$.position=bankpos”. Rather simple. Here’s where it seems to be getting weird. As an example, I click on a controller and go frame 5 and copy the position. I then slide the time to frame 10 and hit paste. Sometimes the controller’s new position will be really close to correct value, and other times I’ve had it fly across the screen. Now if I deselect the controller and reselect it before hitting “Paste” it executes correctly. If copy and paste the data without deselecting the controller in between, it seems to get it wrong. I’ve tried scripting a deselect and reselect both after the copy execution and before the paste, but it doesn’t fix the problem. It only works if I deselect the object in the viewport and reselect it manually.
I can throw the code up if it’ll help, but it isn’t anything special. I was just wondering if anyone has encountered similar issues and, if so, what you did to get around it. It appears to be some sort of bug.
edit: Just found out that If I hit “Paste” twice, the second time the controller will pop into place correctly.
Josh