Announcement

Collapse
No announcement yet.

Reading Vray-Cameradata from EXR Header

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 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

    I am doing the following:
    Code:
    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!
    OLIVER MARKOWSKI - Head of 3D at RISE | Visual Effects Studios

  • #2
    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
    I only act like I know everything, Rogers.

    Comment


    • #3
      HELL YEAH! Thx vlado! This fixed it!
      OLIVER MARKOWSKI - Head of 3D at RISE | Visual Effects Studios

      Comment


      • #4
        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
        OLIVER MARKOWSKI - Head of 3D at RISE | Visual Effects Studios

        Comment


        • #5
          How do you zoom the camera?

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #6
            Originally posted by vlado View Post
            How do you zoom the camera?
            I animate the focal length in maya.
            OLIVER MARKOWSKI - Head of 3D at RISE | Visual Effects Studios

            Comment


            • #7
              any news on this one?
              OLIVER MARKOWSKI - Head of 3D at RISE | Visual Effects Studios

              Comment


              • #8
                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
                I only act like I know everything, Rogers.

                Comment


                • #9
                  this is good to know!
                  thx vlado!
                  OLIVER MARKOWSKI - Head of 3D at RISE | Visual Effects Studios

                  Comment

                  Working...
                  X