# Copying Animcurves

**URL:** https://forum.highend3d.com/t/copying-animcurves/1351
**Category:** Maya
**Tags:** mel
**Created:** [August 22, 2008, 11:27pm UTC](https://forum.highend3d.com/t/copying-animcurves/1351 "2008-08-22T23:27:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![doug-hines](https://forum.highend3d.com/user_avatar/forum.highend3d.com/doug-hines/32/67_2.png) [@doug-hines](https://forum.highend3d.com/u/doug-hines)
#### Post date: [August 22, 2008, 11:27pm UTC](https://forum.highend3d.com/t/copying-animcurves/1351/1 "2008-08-22T23:27:24Z")

</div>

Is there a way to copy a whole anim curve for an attribute and write it to a file, or do I have to go frame by frame and write the attributes per key to the file?

---

<div class="post-metadata">

### Author: ![ewerybody](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/e/bcef8e/32.png) [@ewerybody](https://forum.highend3d.com/u/ewerybody)
#### Post date: [August 25, 2008, 12:52pm UTC](https://forum.highend3d.com/t/copying-animcurves/1351/2 "2008-08-25T12:52:45Z")

</div>

QUOTE  
or do I have to go frame by frame and write the attributes per key to the file?

oh my god no! ![]()

Its really simple! I mean: I hope you don't expect a command like "writeAnimCurveToFile".. but you can do the following:

CODE  
keyframe -q pCube1\_translateX;  
// Result: 0 12 25 //  
keyframe -q -vc pCube1\_translateX;  
// Result: 11 -1.806879 -1.358327 //

keyframe -q gets the key times and -q -vc gets all the values each in an array. You could fprint them to a file how you like. Shouldn't be a problem.

BTW: Doug? your funny code snippet-signature.. you could make it a little shorter:  
delete `listRelatives -ad`; ... Then it wouldn't be funny anymore. But you could omit the select! ;D
