This repo includes a script for After Effects, and add-on for Blender, that allows animated composition layer data to be exported from the former to the latter.
To install the After Effects script, first download it and then select it via File > Scripts > Install Script File...:
You'll need to restart After Effects after installing it.
Make sure that "Allow Scripts to Write Files and Access Network" is enabled:
To use the script, you must first make sure you're in the Composition view:
Then run the script:
When you run the script, a dialog box will appear:
The settings are as follows:
Choose the destination of the exported composition data file. This file can then be imported into Blender.
Some animated properties, and properties controlled via expressions, have keyframes that cannot be directly imported into Blender, and they must be "baked" in After Effects, meaning that the property's value is calculated once per frame. This setting controls the time range that the keyframes will be generated over.
When checked, this ensures that only the layers you select will be exported. If "Bake transforms" is not checked, the selected layers' parents will be imported as well even if they aren't selected, in order to ensure that the child layers are properly transformed.
When checked, all layer transforms will be "baked" in After Effects instead of being imported keyframes-and-all into Blender. In case of a bug in the importer, complicated scenarios (like a 3D layer parented to a 2D layer parented to a 3D layer), or unimplemented features (like Auto-Orient), this may be necessary.
For those properties with keyframes that cannot be directly imported and must be "baked" (see above), this setting controls how many times they will be sampled per frame. The default setting of 1 is usually fine, but if there's some extremely fast motion (most common when simulating camera shake with a "wiggle" expression), and/or you want accurate motion blur trails, you can increase this.
To install the Blender add-on, download, install, and then enable it via the add-on preferences:
To import camera data exported from After Effects, navigate to File > Import > After Effects composition data, converted (.json):
There are several import options on the righthand pane of the file dialog:
This is the factor by which all units in the imported composition will be scaled. The default value, 0.01, maps one pixel to one centimeter, which matches Cinema 4D.
This determines how a composition with a different frame rate from the Blender scene's frame rate will be handled. The options are:
If checked, this will position objects relative to Blender's origin rather than the composition center (which is down and to the right of Blender's origin).
This matches the Cineware option for using a centered comp camera, and you should check this box if you select that option:
If checked, this will set the scene's render resolution to the resolution of the imported composition.
If checked, this will place all imported objects into a new collection.
If checked, this will adjust the Start and End frames of the Blender scene's playback/rendering range to those of the imported composition's work area.
If checked, this will create timeline markers and bind them to the imported camera layers' in/out points. This means that Blender will automatically switch between cameras the same way After Effects does.
Once the desired options have been set, navigate to the .json file exported via the After Effects script, and click Import AE Comp:
If a script file depends on other script files, After Effects' "Install Script File" option will not work. To get around this, I've created a preprocessor script that lives in util/preprocess.py
. To use it, simply run it via Python:
python3 util/preprocess.py
Or if you're on Windows:
py -3 util\preprocess.py
This will generate Export Composition Data to JSON.jsx
.
If you're working on the script, you don't need to re-preprocess the file every time you make a change--the @include
directives are also recognized by After Effects itself. Simply run the script file located in export-comp-from-ae
via File > Scripts > Run Script File.
These are in no particular order. If one of these features is helpful for your use case, open an issue and I can prioritize it.
Import options:
After Effects features:
Transforms: