importing camera animationf from Maya

Started by Jason71, December 18, 2009, 05:52:01 PM

Previous topic - Next topic

Jason71

Hi all

Im having a really tough time wrapping my head around importing camera from maya into Terragen.  In a nutshell, my transZ and RotY always are the opposite sign from what it is in maya.  Why is this, and how can i get camera animation into TG for rendering? 

As a test setup, i have a simple object model and a camera.  I export the object model as an OBJ and import it into terragen.  After rescaling the obj to 0.01 it appears to be the correct size (in meters), as it was in maya. 

Now i select the render camera in TG, and open its attributes.  here's where it gets wierd.  If i copy the translate and rotate numbers right out of maya it *almost* works.  but not quite.  I have to multiply the translate Z value and the rotate Y value by -1 to get a perfect match.  This I dont understand...

However, knowing this oddness exists, i can just manually crank through a still image.  But because of this, an animation is not an option becasue the values don't work together properly in the process im using.

I've looked through the forums but I cant find any threads where this problem or procedure is explicitly defined.  Im hoping someone can spell out the importing camera process :)  because we use maya heavily and terragen would be wonderful but this issue is a fundamental hang up for us..

any help is appreciated!





Kadri

#1
http://forums.planetside.co.uk/index.php?topic=3706.0

This topic is not direct about Maya but maybe there are useful things for you.

Edit : http://forums.planetside.co.uk/index.php?topic=5317.0

Cheers.

Kadri.

Hetzen

I had some issues importing a camera from Maya, and posted my findings in this thread....

http://forums.planetside.co.uk/index.php?topic=7779.0

Also, Maya defaults it's units as cm, which is why you have to scale your object. In the latest version of TG, there is a scale function on the .chan file, which I've not tried yet, but this sounds like it will get around this aspect of conversion.

Henry Blewer

"Also, Maya defaults it's units as cm, which is why you have to scale your object. In the latest version of TG, there is a scale function on the .chan file, which I've not tried yet, but this sounds like it will get around this aspect of conversion."

Boy, Matt was really quite busy. That's a great idea to include!
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Hetzen

Just to add, have a look at the translation of your maya camera, TG only accepts ZXY. What you can do is make a ZXY camera in maya, and link it to your original camera then bake the animation.

There's a link to a very good video in the above thread, which I would suggest everyone looks at to understand rotation limitations of all 3D cameras.

Hetzen

Quote from: njeneb on December 19, 2009, 08:44:08 AM
"Also, Maya defaults it's units as cm, which is why you have to scale your object. In the latest version of TG, there is a scale function on the .chan file, which I've not tried yet, but this sounds like it will get around this aspect of conversion."

Boy, Matt was really quite busy. That's a great idea to include!

Yeah, there's some really good stuff in this update. Like film backs for the camera. 3D Studio Max doesn't even have that!!!

Henry Blewer

Film Backs? What are they? I am still kicking the tires and missed this one.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Hetzen

#7
If you want to match accurately anything shot with a real camera, you need to know what the camera's appature size is, which in the case of video is the size of the light sensor. Most programs default to 35mm. But top end video cameras, like Red Cam for example, have a variety of settings...

http://www.jfi.net/RED/REDFormats3.pdf

...so it's essential to know this if you want your cg to line up correctly, especially if you're using motion capture or motion control.

For example, you can use the same lens values on two different cameras set at the same aspect ratio, and one can have more image than the other, due to one have a bigger area, or different aspect ratio, to capture the image light on.

Henry Blewer

Ok. If I remember correctly, Lightwave had presets to cover many of these 'hardware' settings. I think Blender makes a try for this also. Thanks!
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Jason71

Hi all,

thanks for the replies guys its been very helpful!  Its not solved yet, but Ive made some progress..

I've done some tests using a zxy rot order camera and baking that out.  ive been able to create the chan file, but when i import it into terragen it seems to only have the first frame's data.  As I move the time slider in TG, the camera does not move and the position/rotation values on the camera do not update.   Is there something else i have missed?

Im not sure if this has any impact but im working with the free demo version of TG2.  Is this preventing this animated camera from .. .animating?

:)

Kadri

#10
Quote from: Jason71 on December 21, 2009, 02:19:40 PM
...
Im not sure if this has any impact but im working with the free demo version of TG2.  Is this preventing this animated camera from .. .animating?
...

I use the free version too...But it hasn't animating capability unfortunately .
You have to buy the "Terragen 2 with Animation" version.
http://www.planetside.co.uk/content/view/17/29/

Edit : http://forums.planetside.co.uk/index.php?topic=8270.0   wow :)
       
Cheers.

Kadri

Jason71

Hetzen, in the thread you posted, you mention you had found a technique of creating a new camera with the zxy rotation order, and you linked it to an already animated camera that was xyz.  I have a camera plopped on my desk that has this problem and we cant go back and reanimate it.

I didnt quite understand how to link the two cameras together to get something to bake the way you described.  Could you elaborate?  when i link my attributes together in the connection editor (maya), the rotation order problem is still in my face.


Hetzen

#12
Jason, I'm afraid I don't know the workings of Maya at all to give you a specific how to. What we did, was to link a fresh zxy camera with the same FOV and film back settings as the animated xyz camera, then the Maya guy was able to bake the locked motion from the original camera on the new one, then exported that. Sorry, I'm out of office to ask him, but you should be able to do this, as this is what we ended up doing in the end, so I know it's possible.

The following link was also a great help, whilst making us chuckle at the same time...

http://lowrez.marklowne.com/exportchan.html

Best of luck.

Jason71

ah, cool.  well i futzed around with it a bit more and I got it to work :)  thanks Hetzen for your post. while not software specific, it got me on the right track.  For those who use maya and want to know how to fix this, here's what I did:

Originally we had a maya camera+aim with an xyz rotation order already animated with keys. 

1.  I created a new camera (no aim, just a regular camera, "camera2") in my scene and made it a zxy rot order camera.

2.  I used an aim constraint on camera2 so it points to the camera1 aim locator.  In the aim constraint, I changed the aim vector to x=0,y=0 and z=-1 so it now points properly to the old aim.

3.  In the connection editor, I connected the translate XYZ of the old camera to the translate XYZ of the new camera.  Now my two cameras sit on top of on another in the viewport and 'look' at the same point in space.

4.  Then I selected new camera (camera2) and baked out the animation.  the final camera path flight is identical to the original one, but the new camera has the correct rotation order.

Cheers!