How to import a Maya camera!

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  06 June 2005
How to import a Maya camera!

hi everyone,

sorry this has taken so long to sort out but my wife gave birth last week to our new son and our priorities have been re-arranged somewhat!

anyway for people who are interested here is a small explanation of how to get exact camera data out of maya and into cinema 4d. this is pretty much one of those last resort kind of things (because it requires you to have maya anyway). my explanation kind of assumes that you already know how to use maya and cinema and just need a nudge in the right direction.

start out in maya and select the camera you need to export. at the top right of the screen click on the toggle to show the channel box/layer editor. choose file/export selection and show the export dialog. change to the export format to the .move format (this will create a basic tab delimited text file upon export). swipe over the channels you wish to include in your export, depending on the situation this would be the channels for translation, rotation and scale as well as the horizontal aperture width and focal length (as this defines the fov in cinema) and then click the 'add from channels' button in the export dialog to add these to your move file. aperture width and focal length have to be added manually to the list in the export dialog using the format of camerax.fl or camerax.hfa (you can see the correct extension to use if you click on the 'channels' menu in the channel box and choose channels/channel names/short). once you have finished adding the channels you wish to use you can click on export selection and save the move file. i tend to make sure i use a .txt extension for the file as most macs and pc's will get mighty confused by the default .mov extension which generally belongs to quicktime).

the next step is to open the move file in a text editor (such as notepad on the pc or text wrangler on the mac) and then at the top of the file add in the names of the channels as tab delimited text. this isn't entirely necessary but i like to do that so i can keep track of what the channels actually represent, so i will add in tx (tab) ty (tab) tz (tab) , etc. as the first line. save this altered text file.

now open up a copy of my cinecam template (i've attached this to this post) and select the null Raw camera data. from the plugins menu choose cinema 4d/ascii animation import and locate your move file. in the dialog that appears you will need to set headline to be checked (so the names you gave the channels are used as the names of the sequences created), separator is set to tab, track is set to real, and time is set to frame. press okay and cinema should tell you that it has succesfully imported the data. open the timeline and you should see that you now have tracks representing your camera data. you now need to drag them to the correct places (tx ty and tz should be dragged and dropped onto the X Y Z sequences of the null Camera_trans, rx ry and rz should be dragged to Camera_rot). should you have included it there is also a null for other camera data, position X being for focal length and position Y being for the horizontal aperture width. there is an xpresso expression that takes all this data and pipes it into the camera called shot_layout_v1. the xpresso expression compensates for the different orientation of the axes in maya and the fact that maya measures the aperture width in inches.

you should now have a camera that matches the camera in maya! you can now bake the shot shot_layout_v1camera so it becomes independant of the expresso set-up. finally you just have to remember to adjust your render settings to match the maya cameras aspect ratio.

cheers, simon w.
Attached Files
File Type: zip CineCam_template_new.c4d.zip (6.4 KB, 495 views)

Last edited by Simon Wicker : 06 June 2005 at 05:23 AM.
 
  06 June 2005
Congratulations on your new baby!!

And thank you for the explaination! That's fantastic!!
__________________
I'm just a CosmicBear from another galaxy... gosh, i'm so homesick
 
  06 June 2005
Congratulations to you, your wife and your new son Simon
__________________
www.albertoblasi.com | architect & graphic designer
 
  06 June 2005
Great news
Best wishes to you and your family from me and my wife Yvonne.
How come we never saw a wip?

Cheers
Björn
__________________
- www.bonkers.de -
The views expressed on this post are my personal opinions and do not represent the views of my employer.
 
  06 June 2005
congratulations for your son!

and thanks for the tipp.
cheers
stefan
 
  06 June 2005
thanks everyone. calvin is doing well and his sisters are very happy to have a baby brother to look after.

cheers, simon w.
 
  06 June 2005
Simon... that is wonderful news. Congratulations to you and your family

Also, many many thanks for sharing this. It is something that I will be using very often. Absolutely fantastic explanation. Maybe at some point we'll get a .ma importer? After all,
if After Effects can read an .ma, then it is probably a fairly simple thing.

Thanks again.
 
  06 June 2005
Can ypu post the wireframe mesh??

Congrats Daddy-O!

Best
BT
 
  06 June 2005
Congratulations Simon, have one myself so i get the idea about priorities being different :-)

Your template could probably work for anim data coming from AE as well.
We have projects all the time that we start of in AE (because its our main tool)
just to realize we need some 3d elements added or we realize we have to finish every thing of i C4d.
We never figured out how to do this so this might be the solution.
I dont have AE at home but ill try it tomorrow.
Anybody know how this expresso rig needs to be reconfigured for this to work?

AE anim data look like this:

Adobe After Effects 5.0 Keyframe Data Units Per Second 30
Source Width 720
Source Height 576
Source Pixel Aspect Ratio 1.06667
Comp Pixel Aspect Ratio 1.06667


Position Transform Effect Parameter #2
Frame X pixels Y pixels
z pixels
40 379.676 274.557 0.000
41 379.705 274.878 0.000
42 379.616 275.353 0.000


Regards
Bonsak
 
  06 June 2005
Congratulations!

And thanks for this! I was stuck in mismatched mayacam world awhile back and know the pain.
 
  06 June 2005
Wow--this is defiitely one to copy into my scrap file--thanks for sharing.

Also--I believe you've really got your priorities mixed up.
Congratulations! Guess its old hat at this point.
 
  06 June 2005
Originally Posted by bonsak: Your template could probably work for anim data coming from AE as well. We have projects all the time that we start of in AE (because its our main tool) just to realize we need some 3d elements added or we realize we have to finish every thing of i C4d. We never figured out how to do this so this might be the solution. I dont have AE at home but ill try it tomorrow. Anybody know how this expresso rig needs to be reconfigured for this to work?

AE anim data look like this:

Adobe After Effects 5.0 Keyframe Data Units Per Second 30
Source Width 720
Source Height 576
Source Pixel Aspect Ratio 1.06667
Comp Pixel Aspect Ratio 1.06667


Position Transform Effect Parameter #2
Frame X pixels Y pixels
z pixels
40 379.676 274.557 0.000
41 379.705 274.878 0.000
42 379.616 275.353 0.000



Hi Bonsak,

depending on the 'handedness of after effects (i.e. how it arranges the axes) you may or may not need the 'maya' style axis flipping that i have included in my xpresso setup. looking at the way AE is organising the text file it exports you will need to strip out anything above the headline (the Frame X pixels Y pixels Z pixels line) and in the ascii animation import dialog tell cinema that the first set of numbers represents the frame number.

you may also have to split the file into sections as it seems that AE may be placing the rotation data after the translation data rather than alongside it.

if AE has the same axis set-up as cinema you would just need to import this to a null and then drag the tracks to your camera. most of the tricky stuff i implemented was just to deal with the flipped z axis in maya.

cheers, simon w.
 
  06 June 2005
Hi Simon
Thanks for the info on AE.
When i try to import this file (AE keyframes) as comma delimited text, i get one track for each value. :-)
Ive tried other formats but this is the only one that generates tracks so far.
I checked "header" and "comma"

Frame,X position,Y position,Z position
0,109,288,0
1,114.055,288.095,0.0950346
2,118.036,287.116,-0.88406
3,123.914,288.034,0.0336009
4,128.986,288.145,0.144902
5,134.233,288.432,0.431867
6,138.289,287.528,-0.471938
7,144.059,288.336,0.336467
8,149.076,288.393,0.393323
9,152.877,287.233,-0.76693
10,...........

Do you have an example of the Maya export so i can compare?

Regards
Bonsak
 
  06 June 2005
hi bonsak,

i've attached a maya move file. can you attach your sample AE file so i can test it out here? it may be that you need to do a find and replace on the commas and make them tabs. if it turns out to be a bug i can let maxon know.

cheers, simon w.
Attached Files
File Type: zip chs040_layout_cam.txt.zip (1.3 KB, 90 views)
 
  07 July 2005
hi, I'm trying to importe a camera from maya to C4D.

all the translate and rotation channels tranfert weel with simon's thechnics.
it's ok for the focal lenght but i have problem with the film aperture.

in maya there is 2 attributs: horizontal and vertical film aperture
but in c4d I don't find something equal.
there is the field of view but with the simon's technic, when i render in c4d, it's doesn't match with the maya render.

moreover, i have to connect manualy in the xpresso the relation between the camera data and shoot_layout_V1, as you can see in the attached picture

can you explain how you can transfert good Aperture info from maya to C4D?
why you only use the horizontal apertur and not the vertical one?

help or advice will be very apreciate
Attached Images
File Type: jpg Image 1.jpg (50.3 KB, 121 views)
__________________
escuse my bad english
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:01 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.