Help - Search - Members - Calendar
Full Version: Camera "chan" exporter plugin (beta)
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Rendering, Compositing and Special Effects > Cameras
GruberR
I've finally managed to get something useful put together. The initial challange was to export camera movement in a format that could be read and interpreted by Terragen 2. Terragen 2 can load a file format that is known as "chan" (channel?) file. It's a text file and contains several columns of numerical data (frame number, x/y/z, rotate-x/-y/-z, focal length, aspect ratio and horizontal aperture width).

The major problem involved was the data conversion to suit Terragen's expected format. X-Rotate is the up/down tilt of the camera (i.e. +/- 90°), Y-Rotate is the rotation around the Y-axis (any angle) and Z-Rotate is +/-180° left/right camera tilt. The actual angles in Terragen can have any value though since the motion blur will support multiple turns. This is why right now Terragen will have a problem when rendering the frame preceding a Y-angle change from negative to positive. Motion blur just can't handle an almost 360° movement in one frame...

I used several tutorial fragments and the A:M SDK to implement my own exporter plugin. You can find it attached here, unzip and copy into the "htx" subdirectory of A:M. Since I consider this a beta version there might be "side effects" involved. I recommend backing up any project (and related) files before using it! Uninstall by deleting the ".htx" file.

TODO: Find a (usable) way to convert the single, current value that A:M uses for the rotation to a smooth increasing/decreasing angle...

See also: Original Posting

If everything works, the plugin will add a menu entry "Channel file" to the "Plugins"-"Export" menu of camera shortcuts.
Feedback appreciated!

Greetings,
Roman

Click to view attachment
HomeSlice
Ooo. Thank you smile.gif
serg2
Cool!
Thanks!
jason1025
QUOTE(HomeSlice @ Mar 16 2010, 08:19 PM) *
Ooo. Thank you smile.gif



What does this do for us AM users?
HomeSlice
QUOTE(jason1025 @ Mar 16 2010, 11:09 PM) *
What does this do for us AM users?

It allows you to export the camera motion data from your animation and (hopefully) import it into Terragen, which is a landscape generation program. (It used to be free, but now I think they charge for the version that supports animaion and full resolution renders.)
So you animate in your favorite animation package with low-rez proxies for the landscape.
Render your shadow pass if one is needed.
Then you create a complete landscape in Terragen
Then you export the camera motion data from A:M
Then you import it into Terragen and render the animation.
Then you bring the Terragen rendered frames into A:M as a Camera Rotoscope in your Choreography and delete the proxy landscape.
Then you bring your shadow pass render into A:M and apply it as a Camera Rotoscope *on top of* the landscape rotoscope.
John Bigboote
Sounds cool. Never used Terragen tho...I could use an A:M camera to After Effects exporter.
higginsdj
I wonder if this would work for VUE. It has some Terragen imports, I'll have to check if it has one for Camera movement.
NancyGormezano
QUOTE(higginsdj @ Mar 17 2010, 02:02 PM) *
I wonder if this would work for VUE. It has some Terragen imports, I'll have to check if it has one for Camera movement.


The great Yoda posted this

Does that do what you need?
higginsdj
Yep - saw that but no explainatroy text on how to use it..... Will have to do a bit of trial and error.
GruberR
QUOTE(John Bigboote @ Mar 17 2010, 05:54 AM) *
Sounds cool. Never used Terragen tho...I could use an A:M camera to After Effects exporter.


I'm already looking into that as well... But I have to understand the way AE treats a 3D-camera first. I've only used the 2D features of AE yet. Besides I haven't found any "import" feature in AE besides the clipboard. So the AE export - if I come around to do it - would place the camera data into the clipboard to be pasted on the camera in AE. In any case it would export a key for every frame to avoid any deviation that different interpolation ideas might cause.

Greetings,
Roman
GruberR
QUOTE(GruberR @ Mar 17 2010, 03:48 PM) *
QUOTE(John Bigboote @ Mar 17 2010, 05:54 AM) *
Sounds cool. Never used Terragen tho...I could use an A:M camera to After Effects exporter.


I'm already looking into that as well... But I have to understand the way AE treats a 3D-camera first. I've only used the 2D features of AE yet. Besides I haven't found any "import" feature in AE besides the clipboard. So the AE export - if I come around to do it - would place the camera data into the clipboard to be pasted on the camera in AE. In any case it would export a key for every frame to avoid any deviation that different interpolation ideas might cause.

Greetings,
Roman


Another step forward on the camera-data front: I managed (I hope) to export full-turning angles. I.e. if your camera spirals down a path, making multiple complet turns it should output as an ever increasing angle. To activate that feature, check the "Full turns" checkbox (only available in conjunction with the "limit angles" option to make the math a bit easier)
The full turn is done by calculating a delta from the previous frame to the current frame and adding that to the "real" angle. It only works of course if the camera doesn't move more than 180° per frame! But I assume any useful animation will not cross that value.

As for the After-Effects exporter: has anybody out there an idea on how AE calculates millimeter/inches from the usual pixel unit? I couldn't find any DPI setting. Is it fixed? Or does it relate to the project settings or global options somewhere???

Greetings,
Roman

Click to view attachment
John Bigboote
I can't help you there, GruberR, but I sure hope somebody sees and knows what you need...I like the copy/paste idea. If A:M could conjunct with AE via common camera attributes... worlds would open-up... big-things would happen, I don't know what, but...BIG. Godspeed.
GruberR
QUOTE(John Bigboote @ Mar 19 2010, 09:06 PM) *
I can't help you there, GruberR, but I sure hope somebody sees and knows what you need...I like the copy/paste idea. If A:M could conjunct with AE via common camera attributes... worlds would open-up... big-things would happen, I don't know what, but...BIG. Godspeed.


Here you go, have another beta smile.gif

This version has the "chan" export from earlier and also includes a "AE 8 clipboard export" via a second export menu entry. Works rathe well for me but you might want to adjust all the parameters in the export dialog to fit your needs. The defaults work for: HDV (1440*1080 at 1.333 pixel aspect) and A:M set up for "centimeters" as a unit. Most of the export settings for After Effects are just "header data" that the clipboard data has... I don't know how important they are for the paste but better be sure to set up the correct values. You can select a 3D-camera in your composition, add a keyframe, select the keyframe and copy it to the clipboard, then paste it to Notepad (or any other plain text editor) to check these settings.
The "mm to pixel" setting is used for the export. To get a 1:1 export, use a scale factor that creates millimeter when multiplied with your coordinates, make sure that the mm to pixel setting is correct and export. The "horizontal film size" is used to compute the "zoom" setting from the field of view. It also relies on a correct mm to pixel setting.

Similar, just select the camera you want to paste the data, move the time selector to the first frame and paste.

Again, I wouldn't recommend using this plugin with any non-backed-up material!

Feedback and bug reports are welcome!

Click to view attachment

Greetings,
Roman
pixelplucker
Thanks, going to give it a whirl, have world builder here and it reads terragen camera data so I might be able to use the am camera from that.
pixelplucker
Blah, world builder doesn't support camara data input other than from lightwave.... oh well
GruberR
QUOTE(pixelplucker @ Mar 25 2010, 08:49 AM) *
Blah, world builder doesn't support camara data input other than from lightwave.... oh well


Sorry, had a busy week and couldn't check the forum.
Well... as long as I'm at it... Got any specs and/or samples on how that should look like? ;P
pixelplucker
I have to check, not even sure if I can export any camera data out of wb
frosteternal
QUOTE(GruberR @ Mar 19 2010, 09:39 PM) *
...
As for the After-Effects exporter: has anybody out there an idea on how AE calculates millimeter/inches from the usual pixel unit? I couldn't find any DPI setting. Is it fixed? Or does it relate to the project settings or global options somewhere???
...


After Effects uses pixels as the unit to manipulate camera & 3-D objects, the dpi is not used because AE is not designed for print.
The camera has Position coordinates x,y,z
and "Point of Interest" (aim at) coordinates x,y,z
negative z values move the object towards the user, positive move away from the user
Click to view attachment

GruberR
QUOTE(frosteternal @ Jun 24 2010, 06:21 AM) *
QUOTE(GruberR @ Mar 19 2010, 09:39 PM) *
...
As for the After-Effects exporter: has anybody out there an idea on how AE calculates millimeter/inches from the usual pixel unit? I couldn't find any DPI setting. Is it fixed? Or does it relate to the project settings or global options somewhere???
...


After Effects uses pixels as the unit to manipulate camera & 3-D objects, the dpi is not used because AE is not designed for print.
Click to view attachment


Thanks, I already gathered that much tongue.gif BUT: A:M uses cm/inch to keep the data and not pixels, as is the camera setup dialog in AE - it only turns into pixels once you actually have the camera in your composition. So what I wanted to know: is there a magic formula that AE uses to do the conversion between the setup dialog and the composition or is there a setting I'm missing. There has to be a DPI value for that conversion somewhere and either it is fixed for all comp presets, it is adjustable somewhere or it differs with the comp size... Either way I would like this to be reliable and as of now I have used a "dpi" setting based on what my camera setup dialog converted pixels into mm. But if that value changes, the data might be off when pasting into different comps. sad.gif

Click to view attachment
frosteternal
QUOTE(GruberR @ Jun 24 2010, 01:47 PM) *
.....
So what I wanted to know: is there a magic formula that AE uses to do the conversion between the setup dialog and the composition or is there a setting I'm missing. There has to be a DPI value for that conversion somewhere and either it is fixed for all comp presets, it is adjustable somewhere or it differs with the comp size... Either way I would like this to be reliable and as of now I have used a "dpi" setting based on what my camera setup dialog converted pixels into mm. But if that value changes, the data might be off when pasting into different comps. sad.gif

Click to view attachment

Thanks for clarifying. The millimeter etc setting in the camera setup are mainly used to compute focal blur and lens distortion effects.
I may be underthinking this, but I can't visualize a situation where the camera movement would need conversion.. (zoom etc are another story...)
Different comps are going to interpret the data identically.

If you move the camera left by ten pixels in a 1080P resolution comp, that keyframe will be the same value when pasted into a VGA res comp. The keyframes and units aren't scaled by any particular "real-world" unit. Everything is just pixels.

Perhaps an import plugin could just have a "Scale" argument that would be a multiplier for the values?
photoman
Perhaps you should just use the simple constant of screen resolution, 72dpi, for the conversion?

Or add a menu that has a multiplication factor for exporter to AE?

Photoman
HomeSlice
Don't know if it will work out, but if A:M renders at 72 pixels per inch, that might possibly mean that if the camera moves 1 inch across the plane of the screen, it translates 72 pixels?
1 inch = 72 pixels
1 cm = 28.3464 pixels

1 pixel = 0.0139 inches
1 pixel = 0.0353 cm
GruberR
Again, thanks for all the input. I'll have to check and validate your suggestions. The reason why I don't just want an input line that says "dpi" is that I would like the AE camera to be able to create a meaningful camera movement and of course provide a proper setup for any effects that use "mm" based settings. The factor I'm using now works for my HD footage (1920*1080) but I don't have the time right now to validate it in other resolutions (busy, busy, busy) so I was hoping somebody had a similar problem before and knows the answer to save some research efford biggrin.gif

Greetings, Roman
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.