Export camera to After Effects

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

Moderators: Víctor Paredes, 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 »

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: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Post by funksmaname »

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

Post by aRh »

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

Post by Víctor Paredes »

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 :)
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

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
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

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
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
xothermik
Posts: 108
Joined: Fri Nov 13, 2009 12:22 am
Location: abuja, nigeria
Contact:

Post by xothermik »

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: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Post by funksmaname »

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 »

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: 108
Joined: Fri Nov 13, 2009 12:22 am
Location: abuja, nigeria
Contact:

Post by xothermik »

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: 108
Joined: Fri Nov 13, 2009 12:22 am
Location: abuja, nigeria
Contact:

Post by xothermik »

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 »

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
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Export camera to After Effects

Post by Víctor Paredes »

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.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Export camera to After Effects

Post by Greenlaw »

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.
mrc
Posts: 116
Joined: Wed Feb 14, 2018 10:36 am
Location: Berlin, Germany
Contact:

Re: Export camera to After Effects

Post by mrc »

Yes, camera data exchange via FBX would be excellent.
You don't agree with the post above? Click here.
www.tricklabor.com/en
Post Reply