Reading Vray-Cameradata from EXR Header

Hey Guys,

i am currently writing a nuke plugin which reads all camera attributes from EXR files but i have a few problems.

BTW: it is great that u write them :wink: THUMBS UP!

I am only using functions from ILMs openEXR c++ files.

Getting Translation from the transform Matrix is easy, but when it comes to rotation i’m out :wink:

I am doing the following:


const M44fAttribute *cameraTransform = file.header().findTypedAttribute<M44fAttribute>("cameraTransform");
const M44f &m4 =   cameraTransform->value(); 
Vec3<float> rxyz;
extractEulerXYZ(m4,rxyz);

const float PI = 3.1415926535897932384626433832795028841971693993751058209 ;			
const float RADIANS = 360 / 2 / PI;

camRotation[0]=rxyz.getValue()[0]*RADIANS;
camRotation[1]=rxyz.getValue()[1]*RADIANS;
camRotation[2]=rxyz.getValue()[2]*RADIANS;

with my test exr-file i get the following value:
rotX = -95.44971466 rotY= -54.8789 and rotZ = -179.93907166
when i look at my maya cam it says:
rotX = 174.5502851 rotY= -54.8789 and rotZ 180.0609194

Now i am asking myself where the error is hidden…is it my code or your code?

I also noticed,that maybe the focal length isn’t written correctly…could that be?

thx in advance
Oli
…by the way: i am going to release this plugin for everyone,once it is finished!

V-Ray swaps the Y and Z axes when writing the camera transformation, so that the Z axis points up. You may need to do the same in your code as well.

Best regards,
Vlado

HELL YEAH! Thx vlado! This fixed it!

Hey,

i just finshed the plugin, but i think u missed something in your code, because when i have a zooming camera, then the only value that changes in the EXR is FOV but not the focalLength.

It would be really cool if you could get this working. I know i could maybe convert FOV to focalLength but I think if the attribute is already present I should use it. And it seems that it’s just a minor bug in your code,is it?!?

thx in advance
Oliver

How do you zoom the camera?

Best regards,
Vlado

I animate the focal length in maya.

any news on this one?

It will only work if you use a physical camera; if you are using a standard Maya camera, then only the FOV will change.

Best regards,
Vlado

this is good to know!
thx vlado!