MAYA TO NUKE CAMERA EXPORT
Made with Maya 2023
This MEL script exports camera animation (including position, rotation and focal length) from Maya to Nuke to perfectly match scenes between them.
To exactly match animation curves, the script bakes the camera animation so you'll have a keyframe every frame.
The script exports a .chan file
1) Load the script into Maya Script Editor
2) Select the camera you want to export
3) Set render settings (Image Size Width and Height)
4) Device aspect ratio and film aspect ratio must have the same value (this because Maya keeps them separately and the focal length is calculated using film aspect ratio), so you have to change manually one of them to in order to match render output and camera when import them into Nuke.
5) Execute the script
6) Select a folder where the file will be saved
7) Click on "Open" button
Before loading the .chan file into Nuke you have to manually change the following settings:
1) open Nuke 3D Camera Properties and in the Projection panel set the same horizontal and vertical aperture you have in Maya cameraShape/Film Back panel (Camera Aperture in mm)
2) inside Nuke Camera panel set the same rotation order you have in Maya camera/Transform Attributes
3) inside Nuke Project Settings (pressing S key) set the same full size format you have in Maya Render Settings/Image Size (including width, height and pixel aspect ratio)
N.B. If you import the .chan file without change these settings the camera will not be imported correctly
Now you can load the .chan file inside Nuke Camera panel