I would like to know how to read all channels in an exr2 file with pyton.
I use python 2.7 with module OpenEXR-1.2.0
My goal is to open an exr2 file, delete all channels but rgba and deep data, and save the file.
Anyone ever done such things ?
My problem is that with VRay3 we need to render with VRay VFB to save deep exr, but VRay VFB store all render elements in the exr, even some which don’t require more than 8bits rgb. Even with “separate channels” option, all REs are stored in the exr. It make the exr huge, and we don’t always use all REs, sometimes rerender somes etc so having them all in the exr is really cumbersome. So I’m thinking about a post render script that would keep only rgba+deep in the exr.
This is not possible currently as the python EXR module is not based off EXR2.x. I would also strongly advise not to do so, as this is going to be a pretty bad performance hit compared to a native commandline doing so (our tests showed around 2x the time needed, that adds up pretty quickly).
Do you know, with VRay SDK, if it would be hard to write a VRayDeep render element (3dsmax) that export only deep data to an exr2 file ? This would solve all problems, using 3dsmax VFB ! Would such render element could write an exr2 file if 3dsmax doesn’t know this format ? I quite heavily know python, but never go into C SDK etc …
Probably in theory, but i doubt that would be worth the hassle. If you go that route you could just as well do a proper commandline based tool to do the conversion.
Also the easiest way would be using nuke (or whatever deep cabable comp tool you’re using) to script that kind of conversion if you insist. Why would you want to have the elements but drop deep data on them? You can hardly use any of them then no? I can see the bit depth reduction, but for the rest?
Actually we need RGBA (beauty pass) in RGBA half and the deep data. All other render elements in our workflow are mainly 8bits png and separate files, mainly MultiMatteElement and some reflection pass. These elements are need to grade the beauty, then using deep to place some 3d objects, and fog, defocus. We absolutely don’t want every single render element in the same exr file, all in half or float. I’ve done some test and this generate 43Mo file when same stuff in our workflow generate 6Mo total files (without deep data actually). And we render some elements that are never used, or re-render later etc. Having all from start in the exr will make huge files, huge backups etc etc for nothing more and lot less flexible workflow.
That’s why I’m looking at adding deep data to our workflow. VRay frame buffer force us to change all of it, including all our scripts in max, some internal tools etc etc.
Check this for more on he topic : Vray VFB with standard renderelements - Chaos Forums