AE to C4D

Moderator: Paul Tuersley

Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I've posted a V1.3 update to the script. While fixing a bug, I found it was simple enough to add some extra functionality at the same time.

Here's what's new:
1. Now imports rotation for all layers, not just cameras.
2. Fixed bug when importing cameras with static rotation values. (old link removed)
Posts: 1
Joined: February 16th, 2009, 9:38 am

Any one know if this can be used along with Andrew Kramer's SureTarget preset?
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I haven't used SureTarget, but it appears to require parenting the camera to a null and this script doesn't export parented layers.

It's not out of the question to implement it though. For example you may be able to use toWorld() expressions to create a second unparented camera that matches the movement of the main camera. Then you could export this second camera to C4D.

Or I could implement that method as part of the script, meaning it would be possible to export parented layers in general.

Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France

How would you "parent" a camera with ToWorld ?

I'm very unfamiliar with this.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Yenaphe wrote:How would you "parent" a camera with ToWorld ?

I'm very unfamiliar with this.
I'm suggesting it may be possible to use expressions on a new camera to link its position and rotation to the parented camera. Then you could export the new unparented camera to C4D.

But I don't know the exact expressions required, or even if it's possible. This sounds like a question for Dan Ebberts.
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA

I think these expressions for the second camera will do the trick:

Code: Select all

//  position

C = thisComp.layer("Camera 1");

// point of interest

C = thisComp.layer("Camera 1");

// orientation

C = thisComp.layer("Camera 1");
u = C.toWorldVec([1,0,0]);
v = C.toWorldVec([0,1,0]);
w = C.toWorldVec([0,0,1]);

sinb = clamp(w[0],-1,1);
b = Math.asin(sinb);
cosb = Math.cos(b);
if (Math.abs(cosb) > .0005){
  c = -Math.atan2(v[0],u[0]);
  a = -Math.atan2(w[1],w[2]);
  a = Math.atan2(u[1],v[1]);
  c = 0;

Posts: 5
Joined: March 21st, 2009, 2:01 am

Question for Dan...

First my props. Paul, Dan you amaze me. I am sooooo grateful. Please give me an opportunity to buy something from you guys. I feel like I'm stealing! I would happily pay for some of these scripts or expressions.

I do have a follow-up question.

I was trying to use a second camera that was tied with expressions to the first parented camera--as has been discussed here. It seemed to *almost* work but not quite.

Dan's script was working some magic but maybe needed one tweek to complete the mission. The camera orientation/rotation isn't transfering over properly.

I am wondering if it would work if Dan changed the code that currently operates on the orientation and rewrite it for the rotation. I think Paul's script doesn't work with camera orientation--only the camera rotation.

I'd love to see a solution because Andrew Kramer's SureTarget is sweet.

Thanks again!
Posts: 21
Joined: November 7th, 2006, 2:07 pm

Would this be what you're looking for: ... hilit=bake

seems to bake out rotation for a camera with sure target applied,

[Edit: Oops, a multiplier needs to be added to convert the zoom into focal length ... ]

Hi Paul. I hope you're doing well.
The lack of zoom translation for this system is a bit of a killer, isn't it?
One possible kludge might be to do this (I've only just begun to get my head around C4D scripting):
1) include the zoom values in the jsx script (and hope that C4D gets around to making this "focal length" property work at some point via C.O.F.F.E.E.)
2) on the CSC side, make a null called something like "zoomKeys"
3) as the script builds the camera and nulls, it also adds keys to this 'zoomKeys' null that have the zoom values as COFFEE-accessible key values, like z position values, so that a focal length of 43.5 would be placed into the zoomKeys' position as [0, 0, 43.5].
4) when the script is done, in C4D, the user simply copies the keys of the zoomKeys z axis and pastes them into the "Focal Length" camera property in the timeline (this does work).

It's a funky kludge, but its much better than having to do this by hand.

Of course, one may kludge this already by making a null in AE, expression-linking the z axis to the zoom, exporting to C4D, importing in C4D, copying z axis in C4D, pasting to camera's Focal Length.

p.s. great work as always, PT
Posts: 68
Joined: February 16th, 2009, 12:41 pm

Is this compatible with CS4? I'm getting a "T1P: ATM Parse Error 83:2" at launch.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I just tried doing an export from AE CS4 and it worked ok. Are you sure that's an AE error? It doesn't sound like it. Maybe it's a Cinema 4D error?

Sounds like an AE error, but not related (or possibly strangely related) to the scripting environment. I'm assuming when you say 'launch', you mean the launch of AE. I have seen errors on the web with ATM parse error relating to, not surprisingly, font issues (Adobe Type Manager). So in order to diagnose, it would help to know what else has changed recently in your CS4 installation and font management installation (or perhaps, not changed, as in needing updating).

Posts: 68
Joined: February 16th, 2009, 12:41 pm

Well, a good system restart magically fixed it. Seems to be working fine with CS4.
Posts: 1
Joined: August 3rd, 2009, 8:39 am

hey there,
i'm experiencing some problems exporting the camera-data from AE CS4.
it tells me, there is a problem in line 51, "null" is no object.
i'm not shure, but i guess, it is because i use a german version of AE.
i encountered some problems before, where some lines in the expressions wouldn't work because of not-translations.
any ideas as to what i can do?
Posts: 2
Joined: September 23rd, 2009, 8:10 pm

Great set of scripts!

Have a couple of questions though. Why is it, that when I bring the camera data into C4D, the camera is offset to the right and down quite a ways from the origin of the grid in C4D? Is there a trick to somehow line it up in AE so it translates properly when brought into C4D?

Thanks for this great resource.

Post Reply