Planetside Software Forums

General => Terragen Discussion => Topic started by: digitalguru on July 14, 2016, 07:03:34 PM

Title: For Terragen and Maya users
Post by: digitalguru on July 14, 2016, 07:03:34 PM
I've just uploaded an update of my Maya script - Terraman.

It's pretty much a major re-write, much faster to import / export cameras and has much improved object animation export to Terragen.

If you're a Maya / Terragen user, please feel free to download and have a play with it!

Let me know what you think, or let me know if you find any bugs  :)

You can download it from Creative Crash:
https://www.creativecrash.com/maya/script/terraman

There is also a video tutorial:
https://www.youtube.com/watch?v=IlxcmCoX82I

and supporting scene files:
https://dl.dropboxusercontent.com/u/81475291/terraman_tutorial_files.zip

Thanks!

DG
Title: Re: For Terragen and Maya users
Post by: Matt on July 15, 2016, 12:47:57 AM
 :o  :)

Incredibly impressed with all this. Thanks for sharing!

What are the default output paths, and will they work for everybody without editing them?

Matt
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 05:32:47 AM
You're not going to believe this, but one of my tasks today at work is to figure out this workflow!
This could be a great help. Thanks so much for releasing it. I'll let you know how I get on.
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 07:40:03 AM
Thanks Matt!

If you mean the Terragen file, you'll have to edit the paths for the Micro exporters to your local path - I left them blank in the original tutorial to let users fill in their own, but that might be a bit confusing so I've left my local paths in and re-uploaded the tgd fille and also attached to this post.

ajcgi -

hope this helps! noticed from another post you're working at 1:10 scale, just remember to to set the "World Scale" to 1:10 before you start importing anything from Terragen to Maya and you should be good to go.
Title: Re: For Terragen and Maya users
Post by: KyL on July 15, 2016, 09:01:32 AM
Excellent tool!

I'm impressed by the fact you managed to export complex animation. Well done and thanks!

How do you enable the speed display in Maya btw?
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 09:15:54 AM
Thanks Kyl,

To get the speed display you should select the camera node (it only works with the Dolly and Glide camera rig types).

If you can't see it check under Display/Heads Up Display form the MAya menu to see if there is an item called Camera Speed

if that's not there then make sure the code has been added to your userSetup.mel:

source "tgdUtils"; tgdUtils();

which loads the heads up display when Maya starts up
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 10:52:48 AM
Ok so I successfully got geometry and camera aligned in Maya!
And then Nuke! :D
Dude, you rock. That's saved a world of hurt hopefully. 1:10 worked fine.  :D
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 11:04:04 AM
I hadn't tried NUke, so kudos to you  :)

What did you do  - import the .chan file?
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 11:43:01 AM
Gah! There's an alignment issue I just noticed. Maya to Nuke via chan is the way and that lines up nicely between the two but... my chan into Maya is sliiiightly off value once imported and it's knocking my horizon down. See attached jpeg. Any clues?
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 11:47:36 AM
Quotemy chan into Maya is sliiiightly off value once imported and it's knocking my horizon down

where's the .chan coming from?

p.s if you show me your steps, I could get a better idea of what's going on, or a test file?
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 12:03:23 PM
Ok so the .chan comes out of Terragen via the Camera export as in your video.
This is how the chan looks:

1001 -108667 -292496 3.40204e+006 4.51821 -79.3968 -94 37.8493
Orientations I actually get:
                                                              83.890  3.932  -90.737

As far as I see, the numbers match my Terragen scene perfectly so it's all as I expect and as per your video, but then bringing it into Maya with terraMan results in the orientation being wrong, but the position and FOV come in perfectly. The steps are following your video. :D ;)

I've kept rotate order as xyz.
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 12:06:29 PM
are you using the Terraman rig cameras to import the .chan data into Maya?
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 12:11:26 PM
Yup, here's a Maya scene, minus the landscape which is huuuuge.
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 12:15:30 PM
can you send the chan file too?
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 12:20:00 PM
Here you are
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 12:27:16 PM
well the camera is on its side when I import the chan into a new camera, but obviously I can't see how that relates to your Terragen scene

is it possible to send  the Terragen scene so I can bake it out myself to check?

QuoteI've kept rotate order as xyz.

in Maya or Terragen?

p.s

is this scene flying off into space?

if the .chan file was output from Terragen, I just entered the numbers into a Terragen camera and it's in orbit around the planet...

Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 12:51:31 PM
The planet is Mars ;)
Here's a very stripped down scene, but the basics are there. As I'm using MOLA data I am positioning the cameras in a fiddly, not-at-N-Pole way for each shot. Can't explain too much without breaking NDA. :)

XYZ rotation in both scenes
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 12:56:10 PM
Before I forget, this is TG3 on win7 x64 , and Maya 2015 x64 on Linux
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 15, 2016, 01:03:28 PM
aha! well I did put the script out there so people could test it and see if they could break it  :o

obviously one of the things I hadn't anticipated was a camera going into orbit around Mars  :)

will have to have a think about this one....

Title: Re: For Terragen and Maya users
Post by: ajcgi on July 15, 2016, 01:11:00 PM
Haha, we all like a challenge! It's a fun project this. It will be nice to share more info later in the year. Really pushing my knowledge of Terragen, and it appears, Maya. ;)
Title: Re: For Terragen and Maya users
Post by: KyL on July 15, 2016, 03:30:42 PM
Quote from: digitalguru on July 15, 2016, 09:15:54 AM

If you can't see it check under Display/Heads Up Display form the MAya menu to see if there is an item called Camera Speed

if that's not there then make sure the code has been added to your userSetup.mel:

source "tgdUtils"; tgdUtils();

which loads the heads up display when Maya starts up

I didn't realized it was sourced from your script I thought this was built into maya! Very nice to include that it's going to be really helpful.

I will for sure make extensive use of your script on my next project :)
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 16, 2016, 03:21:36 PM
Hey ajcgi,

Thanks for spotting that, one of the reasons for putting the script out there was that others users would try things I wouldn't necessarily think of testing - like rendering planets!

I've attached an update to the script, try it out and see how you get on.  Also included some scene files used to test it out.

Couple of notes about the script:

The script was written so that everything should work with the default setup in Terragen, so you don't have to adjust anything to get the pipeline working (well, not now hopefully).

For instance, a default Terragen camera uses "Use horizontal fov" as its Perspective setting, you don't need to change this, just adjust the Focal length for your shot. (although when writing out a .chan file, Terragen converts the fov to vertical before exporting).

When you import a .chan file into Terragen it changes to "Use vertical fov". Leave the "Source rotation order" to "ZXY (Nuke Default)".

When you import a .chan file into a Terraman Basic Camera in Maya, the rotation values might look different, as the script converts rotation order on import.

I changed one of the rotation orders in the import camera in the script and it works with your scene now, though on your original camera it's a bit off. I think that may be a precision error since the camera is so far away from the origin.

There's a good page on it in the Terragen Wiki.

They suggest making sure the North Pole of the planet is centred on the World origin to minimise any problems with coordinate accuracy, so I tried it in a new scene with the recommended position and it lines up well between Maya and Terragen. (MarsNew_v01.tgd).

I'd also try on of the smaller scales when importing the planet - like 1:1000 or even 1:10000, you can always export the Maya camera manually and scale it up for the 1:10 scenes.

Have a go with it (try with a new Y position of the planet), please let me know if it works.

Get the test files from:
https://dl.dropboxusercontent.com/u/81475291/mars_scene_files.rar

DG
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 18, 2016, 04:48:10 AM
Thanks! :)
Will give it a go now. Moving the camera to the North Pole is what I'd ordinarily do, but I'd like to avoid it in this instance as it gives us flexibility to move around the planet. MOLA data can't be rotated, translated etc without going via Global Mapper.
When it comes to static cameras, the camera is easily interchanged using FBX into Maya, but occasionally I'm wanting to get animated cameras in and out for various reasons, hence looking at your script.
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 18, 2016, 05:21:25 AM
Ok, so that's much better! My horizon is roughly where I'd expect it to be. Won't have a chance to test it much in the next week or so but I'll let you know how I get on. Thanks ever so much! :D
Title: Re: For Terragen and Maya users
Post by: digitalguru on July 18, 2016, 08:14:14 AM
Cool, glad it worked.
Title: Re: For Terragen and Maya users
Post by: Hetzen on July 18, 2016, 10:38:32 AM
Hi AJ, I think I know which project you're working on ;) Just a word of warning, you are going to get lots of floating point errors the further away you get from the origin. Just a fraction off in rounding co-ordinates and rotation is going to make a big difference when you start getting towards the equator. Things will drift between apps. You really should try and adjust your data to the pole.
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 18, 2016, 10:56:14 AM
It lines up with FBX. Don't worry about my floating points. ;)
Atm I'm effectively doing a sequence of RnD shots running over thousands of kilometres so realigning and adjusting to feedback each time would be a ballache. I've had rounding errors before on other projects and that's one of the reasons why our Maya stuff is smaller than real life. So far so good, but as soon as I get misalignment it will be into Global Mapper to reorient to the North Pole. Aside from anything, another bonus of being at the North Pole is that cloud altitude is actually where you'd expect it to be. The coords of a localised cloud is done in global space, not in relation to the centre of the planet, ie Y is up, not out.
Title: Re: For Terragen and Maya users
Post by: Hetzen on July 18, 2016, 11:22:13 AM
I'm glad you're comfortable with your floating points. :D

There's all sorts of advantages being at the pole like you mention. Scaling between apps get's you so far but I think you'll find that you'll have to convert quite a lot of any ground shots (if any) you're doing as you really don't have to travel too far from TG's origin to see mismatches. Just a heads up.

Btw, the cloud altitude does work from the planet center outwards, it's the placement of the localised region that is in world space. If you copy co-ordinates on the side of the planet and paste them into your cloud layer, adjusting the altitude will change the x,y,z of the localised centre of the cloud.
Title: Re: For Terragen and Maya users
Post by: ajcgi on July 18, 2016, 11:44:32 AM
Yeah that's kinda what I meant. :P
Normally I do everything at the North Pole. Hopefully one day when I'm not on NDA I can fully explain why I'm not. ;)
Title: Re: For Terragen and Maya users
Post by: decksounds13 on January 29, 2017, 12:06:24 AM
Is there another location to get the scene files?  The dropbox link is broken...
Title: Re: For Terragen and Maya users
Post by: digitalguru on January 29, 2017, 07:19:56 AM
I'd forgotten about that, thanks for reminding me!

I've just re-installed my pc and the dropbox links are reset, here are the new ones:

https://dl.dropboxusercontent.com/u/81475291/terraman_tutorial_files.rar