read and write compressed multilayer EXR from python
Currently it's not possible from python to open a multilayer EXR, access each layer's pixels, modify them and then resave back out to the same or new zipped multilayer.
I believe Blender already uses the OpenEXR C++ library under the hood. Would it be possible to ship the python bindings with Blender so that addon developers can import OpenEXR in their python modules? Or add some other mechanism to BPY that allows this without relying on the OpenEXR module.
Without this, end users would need to install several programs, build OpenEXR from source code for their OS, then install etc.
2 Comments
Wouldn’t that create a disconnection between an blender image and an image loaded via python? In that case you could already do that via the python interpreter. Yes that is not ideal, but adding an api disconnected from blender core would also confuse addon developers.
Better solution would be to be able to use boy to do these tasks. It keeps the api clean and even more useful.
Hi Jeroen. Well ideally, I guess Blender's own image datablock giving access to the EXR layer/pixel data would be preferable, and then some way to save the modified pixels back into the same or new multilayer image datablock. Then python could modify the pixel data without the need for OpenEXR, but unfortunately it appears to be broken. Here's one report on the matter:
developer.blender.org/T53768
Personally though it wouldn't feel like a disconnect to me, just a non UI alternative way of reading, modifying and saving multilayer EXRs. It would also be handy to modify the EXR's directly before importing into Blender or after being output by Blender.