After Effects to Blender Script
For the video production work that we do here at Blueprint, After Effects is essential. In animation projects and graphics projects for live-action videos, After Effects works wonders in compositing and for other graphical post-production work.
After Effects comes bundled with Cinema 4D lite, which as the name implies, is a scaled down version of C4D. It works well for certain types of production, but we have found we can get more functionality and creative freedom using Blender 3D.
Now, it is nowhere near as easy to move back and forth between these softwares as between AE and C4D. Unless we get a little help.
Thanks to Atom, a member of the Blender Artists forum, there is a great .jsx script that can be run on elements in your After Effects composition that will actually export these elements into a Blender friendly format, Python. The script can be found here.
Since it is just a .jsx script, it is very simple to use, and you can export just about anything. Now of course, whatever you export won’t necessarily import “as-is” into Blender. The script is mainly meant to facilitate matching camera movement between the two programs.
To use the script, simply download the .zip file and unpack it. In After Effects, with your composition open, select File>Scripts>Run Script File. Navigate to the unpacked .jsx file, and open it. A dialogue box will pop up. Select your camera layer, and any other layers you want to export, and then click “export.” A moment later the script will generate a python script that you can execute from the text editor in Blender.
To execute the script in Blender, open a project and navigate to the text editor. Click open file and navigate to where you saved the exported python file. Open the file, and then click “Run.” The 3D viewport should then populate with the camera and empties representing elements in your composition.
One problem you might run into is a formatting issue. When I have opened the exported python file in Blender, the script has appeared as one long line of text, instead of a properly formatted python script with standard indentation and white-spacing.
In this format, it is obviously not executable. One workaround to this issue that has worked for me is first opening the saved python script in Adobe’s Edge Code application, and then doing a “Save-As” of the script, as itself. Edge Code will properly format the script so that the next time you open it in Blender it will be executable.
In combination with Bartek Skorupa’s handy Blender to AE .jsx exporter addon for Blender, this script by Atom really goes a long way for setting up a functional two-way production pipeline between Blender and After Effects, which for us has opened up a world of creative opportunity