Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
Benjibop13

Text file

Thu Aug 16, 2007 5:23 am

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
Topic Author
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Thu Aug 16, 2007 6:16 am

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

Problem solved

Thu Aug 16, 2007 7:36 am

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 Fri May 13, 2016 4:22 am, edited 1 time in total.
 
Paul Tuersley
Topic Author
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Thu Aug 16, 2007 7:43 am

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

Fri Aug 31, 2007 3:56 am

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
Topic Author
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Sat Sep 01, 2007 6:34 am

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: Fri Aug 31, 2007 3:20 am
Location: Netherlands
Contact:

Mon Sep 03, 2007 3:50 am

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
Topic Author
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Mon Sep 03, 2007 4:13 am

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: Fri Aug 31, 2007 3:20 am
Location: Netherlands
Contact:

Mon Sep 03, 2007 5:14 am

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
Topic Author
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Mon Sep 03, 2007 6:27 am

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: Fri Aug 31, 2007 3:20 am
Location: Netherlands
Contact:

Thu Sep 06, 2007 3:55 pm

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: Fri Feb 02, 2007 6:14 am

Sat Dec 08, 2007 4:13 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: Tue Sep 05, 2006 3:45 am
Location: Chiswick, London, UK
Contact:

Re: AE to C4D

Thu Jan 24, 2008 10:23 am

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

http://www.aenhancers.com/viewtopic.php?f=3&t=910&p=3416#p3416
 
sunsneezer
Posts: 1
Joined: Sat May 24, 2008 1:54 pm

Re: AE to C4D

Tue May 27, 2008 5:03 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
Topic Author
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Re: AE to C4D

Fri Aug 15, 2008 4:26 pm

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)

Who is online

Users browsing this forum: No registered users and 3 guests