TGS to CHAN.... freeby animation tools

Started by bigben, April 27, 2007, 02:18:36 AM

Previous topic - Next topic

bigben

I've started working on some camera paths to test out some workflows (and their accuracy).  So far I've sorted out a TGS conversion to a CHAN file that imports correctly into TG2.... that was the easy part.  Using Terranim to set the camera position on a TER was close, but nowhere near close enough. As I don't have any other software I've come up with a workflow that should work with what I've got.


  • Record key frame camera positions (and speed) from TG2 in a spreadsheet (easier to insert extra frames)
  • Convert to Terranim project file via database, using dummy values to convert metres to TG units so that it will load correctly onto a dummy terrain.
  • Export TGS from Terranim
  • Convert TGS to tabulated text (automated with a Word macro)
  • Import into database and export CHAN file for TG2

This may seem a bit fiddly, but it's free, and it should be accurate since I'm only using Terranim (or Campath) to interpolate keyframes. One of the sequences I have planned involves weaving through trees, so collecting keyframes in TG is going to be essential for this. I'll keep this separate from my other database in case it looks like being useful as a distributed runtime (Mac or Windows).  I've tacked on a chan file converter as well with easily configurable preferences to match the settings from your program to import correctly into TG2.

If anyone's interested in the app you'll need to let me know, otherwise I'll just keep it to myself  ;)





hyper1

Ben,
I'm interested in this workflow.  I'm doing something similar in Lightwave 9.2.  I've already keyframed from within TG2, but the animation tools are very rudimentary and the spline curves really over shoot the end points.  So, I set up the scene in LW and I'm using all of the camera's capabilities within that program.  When the animation looks good in LW, I plan to bake all of the frames for import all of those values back into TG2.

Bottom line is I'm real interested in the success of your workflow, so please keep us posted on your experience!

bigben

OK, that's a big enough user group to proceed  ;)

I was tossing up how to handle CHAN file conversions given the idiosyncracies of the different programs.  For now I think I'll set it up to import the fields and then have the user specify which the field mappings for TG2, with the option of inverting values (and rotating heading 180°). This would only have to be done once, with the options stored as global variables for subsequent conversions.

It would be possible to have built in presets for different programs but that would require people sending me the relevant info to program in... or I could set up a customisable list of presets.

For those working with TGS, I'm only looking at camera position at the moment, converting Campos and Tarpos to the relevant data using the TER spacing for scaling.

Arandil

Hey bigben.  Shortly here, starting sometime in May, I'll be starting work on an Orbiter to TG2 addon which will write out .chan files.  I have a few more concerns than .chan file format to deal with (like the whole Sun revolves around the planet in TG2, but the planet revolves around the Sun in Orbiter, have to compensate for that, etc.), and my output should be TG2 compatible, but I will definitely be following this project and looking for overlap.  I do want to write out .chan files for objects other than the camera.

Could we get a feature/goal list posted?

Thanks!

bigben

#4
Hi Arandil

I've concentrated solely on camera position at the moment because that is the only thing that uses a chan file in TG AFAIK.  The rest are just lists of values that can be imported on a one off basis, requiring a separate text file for each variable (or set of variables).  TGS, for example, also supports sun position, cloud position and water level although I was going to handle these separately in my database.  If I can get my head around the math and bludgeon FM into doing it as well, it should be possible to have a sun position calculator built in for each of the planets in the solar system. (enter planet, date, time, coordinates for start and end).. but that's a goody for the end of the project.

It would be a relatively simple process of making allowances for other standard fields, and exporting these to files.  I'd just need to know what data is typically being used (and what conversions are required) to make allowances for it. I'm doing this in Filemaker Pro so development time of a prototype should be relatively short.  The runtime is a bit hefty to download but updates are easy, requiring only the database to be replaced.

My other animation database won't be released as it requires reprogramming the database for each project, which can't be done via a runtime (even if you wanted to).  It can get a bit complex.  My cloud animation test for example altered between 8-10 variables in multiple nodes to animate 1 cloud layer. 

Attached a screengrab of the rough version.  Some of the elements are just there for my own use, or for demonstration.  I don't think terrain centering is going to be used at all unless people find they can get accurate placement directly from Terranim/Campath. For me the differences were too great to be useful. The scaling info for TGS will be used to generate a dummy project for Terranim/Campath, and then reconvert back.

<edit> Looking at the screengrab I spotted a major error in my TGS conversion (it was really late.... honest ;)) The script was direct from Terranim. Running a test render to check the accuracy.

bigben

Added some batch rendering control, although most of it will made redundant by Dark Fire's software http://forums.planetside.co.uk/index.php?topic=68.45. I'm persisting with it for now because I do a few things a bit differently, and investigating the process can show up other unexpected issues (technical or practical) that others can take into account for creating more useful tools.

The database exports .bat files to render individual frames and generates a log file of completed renders which can be reimported into the database for managing remaining frames/ checking progress.  I haven't set up splitting renders to multiple computers yet, but I have set up a sequential render.

[attachthumb=#1]
every 64th frame of an 8000+ frame animation

I've found Picassa useful for checking the rendered frames for errors like this unexpected one, or creating "storyboard" montages like the one above.
[attachthumb=#2]

Rendering can be stopped at anytime with remaining frames (and manually selected frames) easily distributed for resuming rendering.
[attachthumb=#3]


bigben

OK, I'm back to the CHAN conversion now.  This is all programmed in but I should make some scripts and custom menus to make it usable by other people.  I'll release an alpha version next week for people to try out.
For CHAN files it will import tabulated text with up to 8 fields (allowing for frame numbers).

The user then specifies which output field each input field maps to and specifies other options to manipulate each output field:

  • Scale factor for camera position
  • Invert values
  • Add 180° to camera heading
  • Optional setting of a fixed FOV

It will require a little trial and error until TG imports them correctly, but once you have the options set you can forget about them and import/export to your heart's content.

bigben

Haven't forgotten this  ;)

I've had a few issues with ascii encoding of my output files, but if I can't solve them I'll document a workaround. I'll try and release an alpha next week (which is exactly what i said last time, but this time I really am that close). 

What would be really helpful is if someone could send me a short CHAN file (or even paste it into a reply)

Chan conversion

  • Imports tabulated text (up to 8 fields if frame number is included(?)).
  • User assigns a field type to each input field (only needs to be done once)
  • Each output field has options to invert values, reverse angles 180° (trial and error, assisted by some documentation)
  • User sets optional scaling factor and offset in x,y,and/or z
  • Export converted CHAN file for TG2

TGS conversion


  • Word template with macro to convert TGS from Terranim to tabulated text (will make one for Campath later)
  • User imports converted data and sets Terrain spacing
  • Export converted CHAN file for TG2
Both conversions also allow setting the camera fov to a fixed value

Batch file generator

  • User provides output path and input TGD filename
  • Exports any number of .bat files with either sequential or progressive frame orders (progressive renders every 1024th frame, then 512, 256 etc...)
  • Additional commandline logs frame numbers rendered

Here's a quick test I did of a progressive render of a TGS conversion (only passes through the edge of the canyon once ;)).  About 1200 frames of an 18,000 frame animation. The first section is every 8th frame and changes to every 16th.
<http://www.path.unimelb.edu.au/~bernardk/tgdemo/gc_prog_test.wmv> 4.3Mb

In the pipeline



  • Ertft2tp Joblist generator:
    Darkfire's software is much more useful in a networked environment than multiple .bat files but is still in early beta. The joblist only works in sequential order, but a progressive render can be done by creating multiple jobs for each stage (e.g. job1 = every 1024th frame, job 2 = every 512th frame etc...)
  • Campath file generator:
    Convert TG2 camera position to Campath project file to generate TGS of intermediate frames (Using Campath because it allows 360° rolls)
  • Population optimiser:
    Optimise size and placement of a population to follow the camera. Calculate position and a,b dimensions to create the smallest sized population covering the field of view (with padding) at a set range of distances from the camera.


JohnnyBoy


bigben

Thanks for that....

Hmmmm... space delimited :(   I'll either have to parse the file in FM or convert it prior to import (only likes comma or tab delimited). At least it handles the wee numbers correctly.

Can you just confirm that the field mappings I picked are correct (see screengrab)

JohnnyBoy

It's: Frame posX posY posZ rotX rotY rotZ FOV

bigben

Thanks

That'll give me enough to make some notes for this screen and set up a default mapping.

MicWit

Hi,

I was wondering if this is only for the commercial version of terragen 2, or if it could work in the free version?

I used to use terragen in combination blender to animate terrains with a procedure like this:
- Create terrain in terragen
- Export terrain from terragen, and import into blender
- Create camera animation over terrain
- Export camera data from blender
- Load camera data into script in terragen to render all frames
- Load frames back into Blender and set the terrain model (that was loaded before) as a shadow matte
- Add objects to terrain and render

Would it be possible to get this workflow happening with TG2 (preferably free version) using your procedure (just with a script in blender instead of terranim)

Thanks,
Michael

bigben

There is no script as such in TG2 as there was with 0.9. The camera positions and animation of other variables is included in the TGD document, but to access this feature you require a "paid" version.