Extracting raw keyframe data from After Effects keyframe data

Posted by on May 16, 2010 in After Effects, code, how to, Mac | 4 Comments

You can easily “export” keyframe data from After Effects by copying the key frames in the timeline, then pasting them to a text file.

We want to extract raw key frame data, from After Effects formatted key fame data, via shell script, so that it can be used by Maya or other animation apps.

After Effects keyframe data looks like this:

Adobe After Effects 8.0 Keyframe Data Units Per Second 29.97 Source Width 900 Source Height 506 Source Pixel Aspect Ratio 1 Comp Pixel Aspect Ratio 1 Effects Sound Keys #1 Output 1 #22 Frame 1 0.000261479 2 0.00608461 3 0.0153011 4 0.0274689 5 0.0395869 6 0.0493024 7 0.0562797 8 0.0557284

We need something more like this:

0.000261479 0.00608461 0.0153011 0.0274689 0.0395869 0.0493024 0.0562797 0.0557284

Use this shell script to extract the keys: AfterEffectsKeyExtract.sh
Read this for a detailed explanation of the script.
Usage (in the terminal): path/to/AfterEffectsKeyExtract.sh path/to/keyFrameData.txt


Use this shell script to batch process several files:
BatchExtract.sh
Usage (in the terminal): path/to/BatchExtract.sh path/to/directory

Also see: http://oliverwolfson.com/importing-keyframe-data-to-maya/

Here is a primer on shell scripting. You can run a shell script on a Mac or in Linux, through the Terminal, or on a PC with a app like Cygwin.

UPDATE! The NEW! The python script, linked here, will do the same, import After Effects Sound Keys keyframes, from .txt files, to Maya, but it will also take care of the formatting, so there is no need to run the shell script on your After Effects keyframes before importing. Look for the NEW! script.

Email this to someoneTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInShare on StumbleUponShare on RedditDigg this

4 Comments

  1. HorsePower Studios
    July 7, 2010

    I’m really eager to use this script but you don’t say what it is I need to do in order to use it.

  2. Oliver
    July 13, 2010

    You need to know a bit about shell scripting to use it. On the Mac you will need to be familiar with the Terminal app, which can be found in the Applications/Utilities folder. There are many tutorials and videos on the web that will get you going quickly.

    Look at my “Usage” notes above. If you need more information about using shell scripts, please read: http://oliverwolfson.com/shell-scripting-notes/

  3. Romain
    July 25, 2012

    Thanks !! It’s perfect !

  4. galo hernandez
    August 31, 2012

    Hi, i tried to find something like this for weeks, thanks a lot. I want to know if i can use it in this idea: I want to track an object in a video (5 minutes long) then get all those keyframes of that object for exporting them to flash. In flash i want to use all this keyframes as 1 object for manipulating them with buttons for example. Is possible?. thanks a lot

Leave a Reply