Well its a little rough and ready but it works, doesn't take too much fiddling (certainly dose take some) and the numbers work our correct.
Bellow is a Lightwave plugin developed for Terragen 9.x by Mark Brown now of Luxology/Modo. I asked him if, since he was no longer supporting or developing the TG2LW plugin, he would not mind my posting the plugin here together with a solution (well hack really lol) for using it with TG2.
He replied "yes" as long as it is made clear that he is no longer developing or supporting it and that his contact details were not made available. The instructions laid out below assume your using Microsoft Excel (tested using Excel 2002) but I'm sure the basics will work with other databases. Also since I am in no way expert at Excel I'm sure quite a few of the steps could be automated within the Visual Basic Module. If anyone can work this please do and post your solution here.
Here is how to get Camera motions out of Ligtwave and into Terragen 2.
- Firstly set up an orthographic camera centered on your area where the camera will be moving over.
- Make a render with a Lwo micro exporter at a detail level good enough to provide the detail you'll ned to move the camera about in Lightwave 512 x 512 @ detail 0.5 should suffice in most cases.
- In Lightwave install the plugin and close and re-start Lightwave to get the plugin to "take". I would recomend creating a custom button as you may find your self making many camera motion files during a project.
- In Lightwave load in your saved Terragen landscape and set up your camera path (refer to the Lightwave user manual for details on this)
- Once your happy with this fire up the TerraScene plugin and make sure the frame numbers match your animation length. (The default is 60 frames, you'll probably need more)
The only part of the plugin we're interested in is the tgs export location, set this to your desired location.
Ok now that was easy, now for the fiddly bit (eek!!)
- Open up Excel and load (File>Open...) your exported tgs script. Because it is not a natively supported format it needs to be interpreted. The first dialog asks to choose between "Fixed Width" and "Delimited", choose "Delimited" and "Start import at row" 10. Press "Next". Now activate the radio buttons for "Tab", "Space" and "Comma". Press "Next" then "Finish"
- Right click on the Tab at the bottom of the work sheet and Insert a new sheet, name this sheet2 and your original worksheet, sheet1
- Go to Sheet1 and launch the Visual Basic Editor (Tools>Macros>Visual Basic Editor or Alt+F11), go to Insert>Module and paste in the following code:
Sub Re_format()
Dim r As Long
Sheet1.Activate
Sheet2.UsedRange.Clear
r = 1
Do
With Sheet2.Cells(Rows.Count, 1).End(xlUp)(2)
.Value = Cells(r, 2)
.Offset(, 1).Resize(, 3) = Cells(r + 1, 2).Resize(, 3).Value
Cells(r + 2, 2).Resize(3).Copy
.Offset(, 4).PasteSpecial Transpose:=True
End With
r = r + 9
Loop While Not IsEmpty(Cells(r + 1, 1))
End Sub
- Press F5 to run it. This will strip out all the information we need and place it in columns.
- We now have Frame No, Positions and Rotations, unfortunately they're in the wrong place for Terragens .chan reader so we'll have to move them.
- Swap Column C & D
- Swap Columns E & F
- Multiply D, F and G by -1 (type in-1 in and empty cell, select cell and copy, edit>paste special select multiply, delete the old -1 cell)
- Add a new column (G) and fill this with your FOV (60), in most cases this is constant and its not included in the tgs export anyway
- Your just about done, select all the cells and copy them into a blank text document and save as a .chan.
- Now all that is left to do is add the .chan file to your Terragen scene.
There are two caveats I have found so far, firstly that the FOV seems to import into both Vertical and Horizontal cells with the radio button checked for "Use vertical FOV", you'll need to change this to Use horizontal FOV in most cases. Secondly the rotation values for heading as exported in the tgs file go from 0 upto 179.999? to -179.999? down to 0 again. Although this will place your camera in the right place it places havoc with motion blur. To fix this select the offending cells in Excel and Paste Special firstly -180 and then 180 in "add" mode.
Thats it, hope its useful to someone. Like I said this is NOT a pollished solution but it dose work and I'm sure some one here can make a much better job of it than I. Let me know if anything is not clear or you can see a better way of doing anything. The VB code is from a StephenR over at the Excel Forum, thanks
Happy animating
Richard