|
|
|
Export
Maya camera to Nuke .chan file
quick'n'dirty tutorial |
|
Fast! Few pictures, even fewer words... let's get started. Open your scene in Maya and select the camera you want to export. Show the channelbox and select Add Attribute via right mouse button on it; create two attributes, framenum and vfov. ![]() ![]() Integer for frame # and float for vertical field-of-view... hmm... Now select the newly created attributes, right click, and Expressions... Trivial one for framenum, in vfov instead put cameraN.vfov =
2*rad_to_deg(atan2(cameraShapeN.vfa/2.0*25.4,cameraShapeN.fl));
Don't forget to adjust N's according to
your cameranomasty guidelines,
and to take into account film gate vs resolution gate issues.![]() ![]() Yummy expressions... they look like they're screaming 'Bake me!' What next? You guessed, bake! Select translate, rotate and the two new attributes in the channelbox, then Edit/Keys/Bake simulation dialog. ![]() What could I possibly say? Rapidly done; it's export time at last! File/Export selection dialog: choose move in file type and an attribute list appears at the bottom; add framenum, tx, ty, tz, rx, ry, rz, vfov - order matters! If you don't want to type you can quickly fill the list with 3 channelbox selections and the From Channel Box button. Export. ![]() This will produce a nice .chan file for Nuke, no more no less - well, besides the Quicktime-unfriendly extension Last thing to do before leaving Maya is to take note of the horizontal and vertical film aperture of the camera. Find it in your local cameraShape nodes shop. ![]() These strange things are measured in inches; that's why they're strange Get rid of Maya by gently closing it, or killing the process, or, if you feel it's not enough, switching off the office mains (as a last resort, you could try and organize a strike at the local power plant). Give the exported move file a proper .chan extension, fire up Nuke and create a 3D camera right away. In the Projection tab put Maya's horiz/vert apertures * 25.4 (type it directly in the input field) and discover a refreshing metric world. ![]() Maybe, just maybe, this was a regular 36x24mm? Finally import chan file (in Camera tab) and check if the focal lenght matches. There's a high chance you'll have to change rotation order to XYZ (Maya default). ![]() Almost... increase precision at will, or just put the right numbers That's all folks! Hadn't you abruptly closed Maya, you could now see in the Script Editor a MEL script waiting to be. Hehe. |
|
|