# After Effects To Blender 2.70a Javascript Python Generator

**URL:** <https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162>\
**Category:** Released Add-ons and Extensions\
**Created:** [September 25, 2011, 9:38am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162 "2011-09-25T09:38:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [September 25, 2011, 9:38am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/1 "2011-09-25T09:38:07Z")

</div>

Hi All,

I have revised the _After Effects_ To Blender exporter to update it for Blender 270a api changes. See [post #44](http://www.blenderartists.org/forum/showthread.php?232032-After-Effects-To-Blender-2-70a-Javascript-Python-Generator&p=2656971&viewfull=1#post2656971) for caveats with this version.

As far as tracking and camera matching tasks, however, we are still in untested waters.

The concept behind this _Adobe Javscript_ (.jsx included in the attached ZIP file) is like any other exporter. The exporter scans the host application for data and generates output in a different format. The format, in this case, is Blender 2.70a python.

**USAGE:**  
Run the Javascript from the _After Effects_ **File\Scripts\Run Script File** _menu._.  
Select the layers you want to export in your _After Effects_ comp.  
Click the export button and wait for python generation to complete.  
Exit or Hide _After Effects._  
   
Locate the generated python script (many times it just appears on the desktop).  
Open Blender 2.70a or better and load the generated python script into a text window.  
Run the code in that window.  
The code in the python script will attempt to construct a scene similar to the scene in _After Effects_.

**FIXES For Alpha v1.0:**  
_It now works in CS5 &CS6_ (yeah!).  
The correct FPS is being relayed to Blender from _After Effects_.  
Text from _After Effects_ appears as extruded font object inside Blender.  
Footage layers appear as correctly sized planes with a material applied to them pointing to the footage.  
Axis orientation for the whole Blender scene is rotated 90 degrees along the x-axis to match _After Effects_.  
Lens default value more closely matches _After Effects_ for a tighter Pixel-to-Pixel match.

**FEATURE ATTEMPTS FOR ALPHA:**  
I am calling these attempts because the code is still in that state.  
Full Camera Animation (need to test animating FOV, DOF, is aspect ratio right…?)  
Solids are exported as animated empties.  
Footage is exported as a plane with a material assigned to it that links the AE footage to the plane as a movie or image sequence texture. (Ambitious, but I think necessary to make this a one-shot wonder kind of script.)  
Text layers from AE are converted to actual 3D font objects in Blender.

**TODO:**  
Lots of testing needs to be done.  
I have tested it on a couple of scenes with CS5 and CS6 only. So further testing on creative cloud versions is needed.

### Attachments

 ![](https://blenderartists.org/uploads/default/original/3X/9/7/979bca943036fb9fc19ba661d6001732dafe5bb4.jpg)  
[ATOM\_CS5\_AE\_2\_Blender266\_04162013.zip](https://blenderartists.org/uploads/default/original/3X/b/d/bdaa65709f60d139ff5b88de4a358e8871e762b3.zip) (18.1 KB)[ATOM\_AE2Blender27\_05302014.zip](https://blenderartists.org/uploads/default/original/3X/d/f/df5a900dd1eb548c3c0dc2130f6d154da9d67f8d.zip) (15.6 KB)

---

<div class="post-metadata">

**Author:** ![Meta-Androcto](https://blenderartists.org/user_avatar/blenderartists.org/meta-androcto/32/3989_2.png) [@Meta-Androcto](https://blenderartists.org/u/Meta-Androcto)\
**Post date:** [September 26, 2011, 4:09am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/2 "2011-09-26T04:09:24Z")

</div>

thanks for all your cool work 🙂

---

<div class="post-metadata">

**Author:** ![Ecceptor](https://blenderartists.org/user_avatar/blenderartists.org/ecceptor/32/16900_2.png) [@Ecceptor](https://blenderartists.org/u/Ecceptor)\
**Post date:** [September 27, 2011, 4:04am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/3 "2011-09-27T04:04:52Z")

</div>

It work for Cs5 too…but rotation doesn’t work…and I must rotate camera -180 degree on X axis in blender to match with after effect…

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [September 27, 2011, 5:29am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/4 "2011-09-27T05:29:42Z")

</div>

Nice to know. I cloned the Lightwave exporter when I began my 2.49 script. Next time I am working on the script I’ll include that as a change.

So if you exported an animated camera, how did you rotate it 180 degrees in Blender without losing the animation?

---

<div class="post-metadata">

**Author:** ![Ecceptor](https://blenderartists.org/user_avatar/blenderartists.org/ecceptor/32/16900_2.png) [@Ecceptor](https://blenderartists.org/u/Ecceptor)\
**Post date:** [September 27, 2011, 11:08am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/5 "2011-09-27T11:08:14Z")

</div>

Parent camera to Empty object…then rotate it,one more thing we need to adjust camera focal length in blender same like after effect…But that is easy thing to do…,

---

<div class="post-metadata">

**Author:** ![adde3](https://blenderartists.org/user_avatar/blenderartists.org/adde3/32/8284_2.png) [@adde3](https://blenderartists.org/u/adde3)\
**Post date:** [January 25, 2012, 9:17am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/6 "2012-01-25T09:17:32Z")

</div>

So glad i found this thread. If I use the script in AE CS5 on a Mac the resulting python script seems to have no line breaks when opened in any blender version.

Any idea how to fix that?  
Thanks so much!  
Andre´.

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [January 25, 2012, 4:41pm UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/7 "2012-01-25T16:41:25Z")

</div>

It was the same on CS3. It is a known After Effects Javascript bug. it was supposed to be fixed by now. There are some 3rd party text editors that can repair the output but I don’t know Macs all that well.

---

<div class="post-metadata">

**Author:** ![InfantryRocks](https://blenderartists.org/letter_avatar_proxy/v4/letter/i/3da27b/32.png) [@InfantryRocks](https://blenderartists.org/u/InfantryRocks)\
**Post date:** [January 27, 2012, 9:28am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/8 "2012-01-27T09:28:46Z")

</div>

Hey, Atom, just saw this thread, and you seem to be the only game in town! Any further progress on getting this guy going for Blender 2.6?

I can get the camera to export into Blender, but it is off-kilter, and I’m unsure of how to re-orient it. I did parent the camera to an Empty, but I guess I’m screwing it up since it pivots the camera around the origin like a big hinge.

Anyway, my test consists of a simple text layer and a camera movement. The camera exports, but when I try to include the text layer it sits on “Checking for Animation” for a long time. Does this just take a long time or am I missing something?

Thanks for your work on this script, it could be EXTREMELY helpful in my future projects.

Chris

---

<div class="post-metadata">

**Author:** ![adde3](https://blenderartists.org/user_avatar/blenderartists.org/adde3/32/8284_2.png) [@adde3](https://blenderartists.org/u/adde3)\
**Post date:** [January 31, 2012, 9:51am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/9 "2012-01-31T09:51:52Z")

</div>

The free app “Text Wrangler” can put in the needed unix line breaks to the exported .py file. The script runs in blender 2.59, but unfortunately the everything sticks on the x axis in the blender world. Sorry, but I can´t help more ☹

---

<div class="post-metadata">

**Author:** ![loogas](https://blenderartists.org/user_avatar/blenderartists.org/loogas/32/21885_2.png) [@loogas](https://blenderartists.org/u/loogas)\
**Post date:** [June 15, 2012, 3:05pm UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/10 "2012-06-15T15:05:57Z")

</div>

Has there been any progress in this area? After Effects has the new camera tracker now and it would be great to do everything there, export the camera data and some solids into Blender, do the 3d stuff, then just render and finish all the stuff in AE.

I’ve been looking for a solution before Blender introduced its own camera tracker, we had The Foundry Camera Tracker in AE which was a dream come true. I think integrating apps is the future - 3dsmax and After Effects have this kind of relationship already.

Thanks Atom for doing a great job before but the script doesn’t transfer camera rotation animation in CS5.5 and CS6. Is an update possible? Anyone? 🙂

---

<div class="post-metadata">

**Author:** ![lakeivan](https://blenderartists.org/letter_avatar_proxy/v4/letter/l/e19adc/32.png) [@lakeivan](https://blenderartists.org/u/lakeivan)\
**Post date:** [June 17, 2012, 4:47am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/11 "2012-06-17T04:47:57Z")

</div>

This is my “placeholder post.” I am trying to download the script linked above, but I haven’t posted ten posts yet, which I think is the reason I can’t download it. Rather than filling up the forum with 10 extra posts when I have nothing to say, it would be great if the forum moderators could help me to access the link to the script. Thank you.

---

<div class="post-metadata">

**Author:** ![Richard\_Marklew](https://blenderartists.org/user_avatar/blenderartists.org/richard_marklew/32/4458_2.png) [@Richard\_Marklew](https://blenderartists.org/u/Richard_Marklew)\
**Post date:** [June 17, 2012, 7:51am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/12 "2012-06-17T07:51:40Z")

</div>

> [@lakeivan](#):
>
> This is my “placeholder post.” I am trying to download the script linked above, but I haven’t posted ten posts yet, which I think is the reason I can’t download it. Rather than filling up the forum with 10 extra posts when I have nothing to say, it would be great if the forum moderators could help me to access the link to the script. Thank you.

Number of posts shouldn’t have any affect on you downloading files. What problem do you have when you try to get the blend file ?

---

<div class="post-metadata">

**Author:** ![zeffii](https://blenderartists.org/user_avatar/blenderartists.org/zeffii/32/14153_2.png) [@zeffii](https://blenderartists.org/u/zeffii)\
**Post date:** [June 17, 2012, 8:37am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/13 "2012-06-17T08:37:07Z")

</div>

> There was an attempt at converting Mask data to Blender curves.

A while back someone came in the [ba.org](http://ba.org) looking for a way to convert his Mocha or AE mask files to blender. I did write one but it’s sort of limited to spline points. AE and Mocha seem to use X-Spline which i think is a lot like the new curve type used for masking…

> **[GitHub - zeffii/AE--afterfx--Mocha-shape-import: For roto animated shapes (...](https://github.com/zeffii/AE--afterfx--Mocha-shape-import)**
>
> For roto animated shapes ( to blender 2.5x ). Contribute to zeffii/AE--afterfx--Mocha-shape-import development by creating an account on GitHub.

if anyone is interested. but with the new-fangled mask tools, i can’t imagine anyone wanting to start rotoscoping inside an external app any more.

---

<div class="post-metadata">

**Author:** ![CoDEmanX](https://blenderartists.org/letter_avatar_proxy/v4/letter/c/77aa72/32.png) [@CoDEmanX](https://blenderartists.org/u/CoDEmanX)\
**Post date:** [June 17, 2012, 8:38am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/14 "2012-06-17T08:38:55Z")

</div>

> There was an attempt at converting Mask data to Blender curves.

With Mask editing in trunk, mask data should be imported as actual mask! 😃

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [June 18, 2012, 5:00am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/15 "2012-06-18T05:00:30Z")

</div>

The camera being off kilter is probably due to the API change in the matrix order from 2.6.2 to 2.6.3. This script certainly could use more development. I currently don’t have the time for such work on this script. The problem should be fixed in the javascript portion. Try swapping Z for X when writing out the final coordinates for the camera.

---

<div class="post-metadata">

**Author:** ![loogas](https://blenderartists.org/user_avatar/blenderartists.org/loogas/32/21885_2.png) [@loogas](https://blenderartists.org/u/loogas)\
**Post date:** [June 22, 2012, 1:56pm UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/16 "2012-06-22T13:56:30Z")

</div>

Thanks Atom for your reply. I sure can understand that you’re busy but the number of people who could update the script is quite limited, I suppose. I have no idea about coding, I tried to do some stuff in the past but then moved on to other things. I’ve been looking into the code and thought that the reason behind rotations not coming through is for example this:  
For position there is a value [0] indicating which axis this means, e.g.:  
var temp\_xpos = layerCopyParent.position.valueAtTime(t, false)[0];

However, for rotation we have this:  
var temp\_xrot = layerCopy.rotationX.valueAtTime(t, false);  
There’s no [0] at the end. But even if I added it (everywhere where I spotted it “missing”, [1] and [2] for other axis respectively) it doesn’t help. That was just a crazy guess and as far as I could go not knowing the code at all 😉

Sometimes AE’s orientation (not rotation) comes through but only in one axis and still not correct. Swapping Z for X etc. in AE wouldn’t be a problem if just the numbers would go through, we could use expressions and fix it, but we really need somebody to fix the script. If it worked at least in CS5 (I’m aware that not everybody has updated to CS6 yet), that would be a great thing. I’m really trying hard to trust Blender more and introduce it into my workflow in one of the projects I’m doing now. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [September 21, 2012, 1:52pm UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/17 "2012-09-21T13:52:51Z")

</div>

> but the number of people who could update the script is quite limited  
> Ok, so I took another stab at it.

I have updated the script from Alpha to Beta. I feel it works a little better now and I have corrected the CS5 bug so it should run in After Effects versions other than CS3. I was using a depreciated call to activate the OS dialog. That has been corrected.

I am calling this release Beta v1.0. Feel free to test away and post bugs/suggestions!

---

<div class="post-metadata">

**Author:** ![loogas](https://blenderartists.org/user_avatar/blenderartists.org/loogas/32/21885_2.png) [@loogas](https://blenderartists.org/u/loogas)\
**Post date:** [October 1, 2012, 5:36am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/18 "2012-10-01T05:36:53Z")

</div>

Sorry for replying so late, I was away and without regular Internet access. Just imagine my big smile when I came back and noticed your update 🙂 Thank you so much for doing this Atom. I’ve run the script in CS6 in a crane shot - it seems that the motion is reversed (the crane in AE goes up, in Blender it goes down) but the most important thing is that the rotation and other movements are being transferred, not like with the previous script used in versions above CS3.  
I’ll test it more in the following days and post some conclusions. I have one big project coming and I would love to use AE with Blender on that job, which is impossible without your script.

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [October 1, 2012, 7:20am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/19 "2012-10-01T07:20:37Z")

</div>

If you have a small CS5 (I don’t have access to CS5.5/CS6 at this time) _After Effects_ aep file that shows this reversed up/down problem, post it here in a ZIP file and I’ll take a look. When I read your post it made me realize I had not tested UP/DOWN camera movement, just movement into the scene via Z translation.

---

<div class="post-metadata">

**Author:** ![loogas](https://blenderartists.org/user_avatar/blenderartists.org/loogas/32/21885_2.png) [@loogas](https://blenderartists.org/u/loogas)\
**Post date:** [October 1, 2012, 10:08am UTC](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162/20 "2012-10-01T10:08:11Z")

</div>

I’ll prepare a file tomorrow when I get access to CS5 and post it here. Thanks so much Atom! 🙂  
EDIT:  
Ok, I’ve created two simple compositions in AE CS5, highlighted all the solids etc, run the script and then opened it in Blender 2.63a (after deleting default elements in the scene). I’ve done no changes afterwards, just saved the files.  
You can download the files here: [https://www.dropbox.com/sh/j9vs16tdyx99b01/rEuql7R9zK](https://www.dropbox.com/sh/j9vs16tdyx99b01/rEuql7R9zK)  
The comps:

1. The crane shot tracked the dirty way using The Foundry Camera Tracker in AE CS5 - in Blender the camera moves down instead of up. I’ve added some solids for reference, the footage solid is very big but this is because it’s 2D in AE I suppose. I’ve included the footage in a separate zip file (it’s very small) in case you need it. Here’s a preview:  

2. AE normal composition - I’ve just added a 3d solid, animated the camera a bit and added two text layers. They look completely different in Blender in the first frame - they’re out of frame.

After Effects first frame:

 ![](https://blenderartists.org/uploads/default/original/3X/a/a/aa1c4806ddcbbff80d1a682f7b8a810a22b42f9c.JPG)  

Blender first frame:

 ![](https://blenderartists.org/uploads/default/original/3X/2/e/2e997338cb3fa0488faf06b2a1852a2641dae3ef.JPG)  
  
Is it because of the lens? It’s set up as 28mm in AE, I haven’t touched it in Blender. The movement of the camera is also a bit different in Blender 😉

Thank you for your time and effort Atom 🙂 I’m looking forward to your findings.

[Next page](https://blenderartists.org/t/after-effects-to-blender-2-70a-javascript-python-generator/520162.md?page=2)
