Export camera to After Effects

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Export camera to After Effects

Post by ponysmasher » Sun Dec 26, 2010 7:15 pm

Here's a menu script that exports the camera movement to After Effects keyframe format.

Get it here: ds_camera_to_ae.zip

I've had problems (and long render times) with large images in AS pro so I wrote this to make my life easier.

It gets the camera information between the in and out point of the project and gets the camera values from every frame, not just the key frames. This is done for maximum accuracy and it's like when you track a layer in After Effects.

I haven't tried anything too advanced yet, but it seems to work.

The left image is animated in AS, the right is a still frame in After Effects with imported camera motion.
Image

Here's an example of using the script:

Let's say I want these two characters standing on piles of money with the camera moving.
Image

I render out the animation with the characters as PNG files (I want a transparent background) and export the camera movement to a text file.
In After Effects I import the rendered frames and Import a high resolution image of the money (that I scale down appropriatley for the scene).
Image

If I look at the animation right now it looks like this:
Image

But now I set the image layer to 3D (the layer with the guys should NOT be set to 3D as this layer already has the camera movement rendered).
Image

And then create a camera.
Image

I go to the text document with the camera movement (the one exported from AS) and copy the text inside.
Image

I select the camera layer in After Effects and paste (Edit-paste or CTRL+V)

And there we go.
Image

Of course you could add several other 3D layers and arrange them in 3D space and build an environment that way.

You can also import Illustrator files in After Effects, just make sure to click 'Continually rasterize' so you can scale it without getting a mess of pixels.

Note: When pasting keyframes in After Effects they will start from the frame you are on at the moment, so it doesn't matter if the keyframe data in the file starts at some other frame.
User avatar
funksmaname
Posts: 3113
Joined: Tue May 29, 2007 11:31 am
Location: Nelson, New Zealand

Post by funksmaname » Sun Dec 26, 2010 10:47 pm

sweet!
aRh
Posts: 20
Joined: Wed Aug 01, 2007 5:52 am

Post by aRh » Mon Dec 27, 2010 4:15 pm

Many Thanks!.. BTW is this works with ASP 5.6 too?
User avatar
Víctor Paredes
Posts: 4951
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Mon Dec 27, 2010 5:30 pm

Great. It reminds me another script:
Export bone position to After Effects & Particle Illusion
viewtopic.php?p=92202

This script will be very useful to me. Thank you very much :)
Víctor Paredes
Former Moho Product Manager
Rigger and animator in Cartoon Saloon
My Youtube Channel - My webinars
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher » Mon Dec 27, 2010 6:14 pm

selgin wrote:Great. It reminds me another script:
Export bone position to After Effects & Particle Illusion
viewtopic.php?p=92202
Oh, I haven't seen that script! *download*

We really should make a site for all AS scripts with categories and a search function. Maybe I'll do it myself. I'll just have to figure out a way to make the days a couple of hours longer first...
User avatar
Víctor Paredes
Posts: 4951
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Mon Dec 27, 2010 6:50 pm

ponysmasher wrote: Oh, I haven't seen that script! *download*

We really should make a site for all AS scripts with categories and a search function. Maybe I'll do it myself. I'll just have to figure out a way to make the days a couple of hours longer first...
We thought about that some time ago. I contacted a programmer, but he never even started the project.
anyway, check this old thread. If you could make something that would be just awesome. And I'm pretty sure if we contact Smith Micro with a concrete project they will give us some space on their servers :D
Víctor Paredes
Former Moho Product Manager
Rigger and animator in Cartoon Saloon
My Youtube Channel - My webinars
xothermik
Posts: 103
Joined: Fri Nov 13, 2009 12:22 am
Location: abuja, nigeria
Contact:

Post by xothermik » Thu Aug 04, 2011 2:51 am

hi. this script is just what i need for my current project. i seem to be having problem pasting the text file into the AE camera. could it be because of my AE version? im using cs3. so far i'v tried selecting the camera layer and control v-ing without any result. can someone please help?
User avatar
funksmaname
Posts: 3113
Joined: Tue May 29, 2007 11:31 am
Location: Nelson, New Zealand

Post by funksmaname » Thu Aug 04, 2011 3:21 am

did you copy all the text out of the file that's created first? (open the export file and copy all that text first before pasting)... I assume you did but you never know! :)
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher » Thu Aug 04, 2011 8:48 am

I have problems with pasting in both After Effects and Photoshop. Restarting the application usually helps.

It's really annoying when you copy an image in an external application and Photoshop keeps pasting the previous image from the clipboard while other applications paste the new image. I don't know how that even works.
xothermik
Posts: 103
Joined: Fri Nov 13, 2009 12:22 am
Location: abuja, nigeria
Contact:

Post by xothermik » Thu Aug 04, 2011 5:44 pm

did you copy all the text out of the file that's created first? (open the export file and copy all that text first before pasting)... I assume you did but you never know! Smile
yes i did. do you just select the camera layer and paste or is there a particular text dialogue u bring up and paste into?
xothermik
Posts: 103
Joined: Fri Nov 13, 2009 12:22 am
Location: abuja, nigeria
Contact:

Post by xothermik » Thu Aug 04, 2011 5:54 pm

thanks guys i figured it out.
User avatar
neon22
Posts: 51
Joined: Tue Aug 28, 2007 5:41 am
Location: New Zealand

Post by neon22 » Sun Oct 02, 2011 10:09 pm

ponysmasher wrote:I have problems with pasting in both After Effects and Photoshop. Restarting the application usually helps.

It's really annoying when you copy an image in an external application and Photoshop keeps pasting the previous image from the clipboard while other applications paste the new image. I don't know how that even works.
I believe this is happening when your graphics card runs out of memory.
Had it a lot when I had a 256MB card. Now I have 2GB - never happens anymore :-)

As usual - you just need money - piles of money...
User avatar
Víctor Paredes
Posts: 4951
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Re: Export camera to After Effects

Post by Víctor Paredes » Wed Sep 18, 2019 10:54 am

Hi! I know this is an old thread, but do you know if this could work in the opposite way? Here we are looking to import the camera keys from After effects to Moho.
Any ideas about that?

Thank you very much.
Víctor Paredes
Former Moho Product Manager
Rigger and animator in Cartoon Saloon
My Youtube Channel - My webinars
User avatar
Greenlaw
Posts: 4661
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export camera to After Effects

Post by Greenlaw » Wed Sep 18, 2019 3:59 pm

I've wanted that too.

One 3D animation program I use at work called LightWave has a native script the sends the camera or nulls directly to AE, or from AE back to LightWave, with a single button click. I'd like to see something like this added to Moho.

Some 3D animation and compositing programs, can transfer camera and other elements through the FBX format. For example, I use this to transfer camera data, objects and nulls from LightWave or Maya to Fusion. This won't help for AE since it doesn't support FBX, but since Moho partially supports FBX now, it would be cool if it got support for the camera (and other elements if possible) for other animation/compositing programs to use.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2019 Edtion
Lead Digital Animator, Dreamworks Animation

Image
mrc
Posts: 107
Joined: Wed Feb 14, 2018 10:36 am
Location: Berlin, Germany
Contact:

Re: Export camera to After Effects

Post by mrc » Thu Sep 19, 2019 12:11 am

Yes, camera data exchange via FBX would be excellent.
You don't agree with the post above? Click here.
My first Moho project
My second Moho project
Post Reply