Open EXR metadata from 3dsmax

Hey gang,
Im seeing that 3ds max saves metadata to the EXR file format. Does anyone know how that is done? I saw a value of exr/cameraTargetDistance and it seems to get that information from the vray render settings, not the max camera. Is this coming from vRay? How can I add my own EXR meta data to the image sequence?

Fred

If you are save through the 3ds Max frame buffer, then you can define your own metadata, I think. If you save through the V-Ray VFB, then for the moment this is not exposed in the UI.

Best regards,
Vlado

Ah perfect - I was just talking to someone in here about that - using a position pass and camera data to allow multiple layers of vray renders to automatically go in front and behind each other correctly. This is available in vray for maya as far as I know but you’re saying if I render another blank pass from the main render buffer and not the vray version, it’ll allow me to save the camera data as a workaround?

If all you need is the camera target distance, enable DOF for a moment, turn on the “Get from camera” option, and then disable DOF. Then V-Ray will write the correct camera target into the file.

Best regards,
Vlado

On the other hand, if you need arbitrary data, look in the MaxScript help - it should say how to specify additional metadata for the standard 3ds Max OpenEXR saver.

Best regards,
Vlado

Hmm, it might be a bit more than that. I think this is tool people in here are looking at - http://www.vfxtalk.com/forum/nuke-plugin-reading-vray-cameradata-exr-released-t22969.html

Yep, you get the exact same info from 3ds Max - the only caveat is the camera target distance, which I explained how to get out properly. The Y and Z axes of the camera transformation might also need to be swapped, but that can be done in Nuke.

Best regards,
Vlado

Brilliant. Off to do some testing, much appreciated for the confirmations!

Additional data can be injected via automated post processes if needed. Which is what we do here for quite a lot of info. When swapping Y and Z mind you that rotations are a tad more complex then just exchanging them :stuck_out_tongue:

btw…that was a short visit on irc :stuck_out_tongue:

Thorsten

Hi Vlado, you mention the V-Ray VFB exr settings are not exposed via UI currently. Are they available through scripting / vray sdk?

In particular, we would like to control the compression method (currently uses block zip, we would like to have zips), and also add our custom metadata pre/post render, potentially mid-render too. Currently we use custom render elements for this, but its very clunky.

cheers,
laszlo

Vlado mentioned in another thread about adding options to the vrimg2exr that the internal vray builds can now write directly to scanline exr files, so hopefully if it uses the data window too we’ll have nice nippy files in nuke / fusion!

P.s. give lele a punch in the beard.

They are available from C++ by modifying the V-Ray sequence data structure, for example from a render element, a V-Ray settings plugin or any other V-Ray plugin that has access to this structure. The code would be something like this:```
void setupSequenceData(VR::VRaySequenceData &sdata) {
sdata.params.vfb.exrCompression=(VUtils::ExrCompression) compression; // Set compression method
sdata.params.vfb.exrUseHalf=(bitsPerChannel==16)? true : false; // Bits per channel
sdata.params.vfb.extraAttribStr = extraAttributes.empty() ? NULL : extraAttributes.ptr(); // Additional metadata attributes
if (autoDataWindow) sdata.params.vfb.modeflags|=VM_EXR_DATAWIN; // Automatically compute data window from the alpha channel
}


The VM\_EXR\_DATAWIN flag is only available in the latest nightly builds. For the format of the additional attributes, see the Open EXR options section in the V-Ray for Maya help index here: http://www.spot3d.com/vray/help/maya/150R1/render\_params\_common.htm#image\_options

Best regards,
Vlado

This is beautiful Vlado thank you! I’ll give that a try right away.

joconnell: Ill make sure to punch Lele somewhere :slight_smile: He shaved his beard (for the ladies i think), but his head has plenty of hairy spots left.

Golden! Great stuff. Thanks for bringing that up! Will definitely have to look into that

How does this actually work Vlado - is it a case where the vrimg is being held in memory or on disk as the buckets write to tiles of the image, then the lot is converted to a scanline as a final post process on the render?

If the frame buffer is in memory (e.g. you have selected the “Memory frame buffer” option for the VFB), then all the data is kept in memory anyways, so V-Ray just overwrites the tiled OpenEXR file with a scanline one at the end of the frame.

Best regards,
Vlado

Hi Vlado,

I tried the exr settings, and they all seem to work with the exception of the extra attributes. I tried a couple of different ways, but none actually added any extra attributes for some reason. I tried using the examples:

int_attr=53;float_attr=3.14;vec4_attr=(1, 2, 3, 4)

I also tried it with vray for maya’s multichannel exr manually through the GUI, but the attributes dont seem to make it into the exr. Am i doing something wrong, or the feature has a bug?

(i’m using nuke to get a metadata listing, and a command line app i wrote, so maybe those are checking at the wrong place?)


  sdata.params.vfb.extraAttribStr = extraAttributes.empty() ? NULL : extraAttributes.ptr(); // Additional metadata attributes

Can you tell me exactly how you are setting them?

Nevermind, there was a bug there. Should be fine for the next build tomorrow.

Best regards,
Vlado

You are too fast :slight_smile: I was just pasting my response in :slight_smile:

Thanks man!

For the record, with what version was access to extra meta data introduced (on the max end that is)

Regards,
Thorsten