AE to C4D

Moderator: Paul Tuersley

Benjibop13

It seems to be a problem with the way the .txt file is being read.
The test one supplied opens in Notepad as one continuous line of text where as the the one I created (from the same AE project) is displayed as a series of lines in Notepad. Is there a way of converting this back to one line of text?
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I think this problem is caused by Mac and Windows treating line returns differently. I had this in the past where just using "\r" for a line return in my script worked fine on Mac, but it needed "\r\n" to work properly on Windows. That text file was created on a Mac, which is probably why it works fine, but it isn't intended to be in one continuous line, so it sounds like your exported text file is more "right" than mine. In which case, I may need to change both the AE and C4D script to work properly on Windows.

There's a fair chance that these scripts just don't work on Windows at all because of this. Unfortunately I don't have access to a Windows machine for testing. Maybe one of my fellow scripters could lend a hand to sort this out?

I don't have an easy fix for you, but stay tuned.
Benjibop13

I created my script as normal in AE. Then I opened the .txt file in Microsoft Excel and then saved it out as a text (macintosh) file. Then I opened it in Notepad and removed all the " it put in it but going to File > Replace. In the 'Find what' dialog box enter " and in the 'Replace with' box enter nothing. Hit Replace All and the file looses all the ". I then opened the script into C4D no problems
Last edited by Benjibop13 on May 13th, 2016, 4:22 am, edited 1 time in total.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Glad to hear you've found a workaround. Hopefully I'll get it working properly on Windows soon.
Barend Onneweer
Posts: 5
Joined: August 31st, 2007, 3:20 am
Location: Netherlands
Contact:

Hi,

I'm trying to export layer position and rotation data from CS3 to C4D using this script. I'm on Windows so it seems I'm out of luck.

I've succesfully imported the supplied test project into C4D R10, but when I export keyframe data using the AE script I get zero results.

I tried opening the txt file into Excel and saving to a Mac txt file which seems to remove the linebreaks mentioned above. I don't see the " that Benjibop mentions.

I compared my own txt output to the demo file and can't figure out what the problem is.

I uploaded the file if someone would be so kind to take a look at it.

http://www.raamw3rk.net/AE_to_C4D.txt

Needless to say that I'd love for this script to work on Windows, but I'd be happy for now if I figured out the workaround.

Thanks in advance,

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

Here's an update to the script that should work on Windows. It's not a perfect solution as the text file will probably appear as a single line if opened on Windows, but at least it imports into C4D correctly. Thanks to Ben and Jeff for their help.
pt_AEtoC4D_v1.2.zip (old link removed)
Barend Onneweer
Posts: 5
Joined: August 31st, 2007, 3:20 am
Location: Netherlands
Contact:

Hi Paul,

First, thanks for your support. I've tried the new scripts, and now I've been able to import someting into C4D. But it seems the camera isn't quite where it should be, and the null layers show up in C4D without rotation keyframes.

The position keyframes are imported correctly though...

I'd love for this to work.

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

It doesn't import the camera field of view, could that be what you're seeing? Also, it doesn't import rotation on anything but the camera.

Paul
Barend Onneweer
Posts: 5
Joined: August 31st, 2007, 3:20 am
Location: Netherlands
Contact:

Argh...

Yes I just fixed the camera - which wasn't moving anyway.

No rotation keyframes for layers... ouch. I'm trying to animate an object in AE, and then replace it with a C4D object.

Hmmm... maybe I can tie a camera to the layer in After Effects, and then export an extra camera as a placeholder?

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

You should be able to use extra cameras to export position and rotation of other layers. In After Effects you can use expressions to link the camera to a layer's position and rotation, or copy/paste the keyframes.

There's no major reason it doesn't import other layers' rotation (it already exports it to the text file), I just had to stop somewhere.

Paul
Barend Onneweer
Posts: 5
Joined: August 31st, 2007, 3:20 am
Location: Netherlands
Contact:

Hi Paul,

Just to let you know I succesfully used an extra camera in AE (linked to the original layer with expressions) to export the animated rotation and position to C4D.

It would be nice if Adobe and Maxon would step in and improve integration beyond what they have now - but it's excellent that scripting allows users (well, some of them anyway) to add their own workarounds to the toolbox.

Thanks a lot for sharing and coming back to me on this.

Barend
pixelrise
Posts: 5
Joined: February 2nd, 2007, 6:14 am

Paul and the other dudes there, thank you for that. It's amazing.
I was waiting that for a long time.
Works really nice.. AE CS3 & C4D 10.5 :wink:
Darkmoon_UK
Posts: 62
Joined: September 5th, 2006, 3:45 am
Location: Chiswick, London, UK
Contact:

Subscribers to this thread may be interested in an improved way to get data from Excel, here:

http://www.aenhancers.com/viewtopic.php ... 3416#p3416
sunsneezer
Posts: 1
Joined: May 24th, 2008, 1:54 pm

I subscribed to the forum to thank you for this very useful script. :D
I used RPF camera import for C4D to AE and now it works both ways! Hurray for the new possibilities!
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.

pt_AEtoC4D_v1.3.zip (old link removed)
Post Reply