The following is from Dan Maas:
I just query the camera attributes using the normal Maya MEL commands. For example “getAttr cam.worldInverseMatrix” gives you the camera transform and “getAttr cam.focalLength” the focal length. You can call these from the code that generates your procedural.
Maya->RenderMan conversions are as follows: 1. invert the 3rd column of the worldInverseMatrix to convert from right-handed to left-handed coordinates (i.e. multiply m[2] m[6] m[10] and m[14] by -1) 2. RenderMan’s “perspective” camera FOV = rad_to_deg(2_atan((xres/yres)_12.7/cam.focalLength))