am attempting to access the pixel information for a viewport render, but sadly, I'm coming up short...
Getting that information using Python would be ideal, because it would allow me to update Blender, and still maintain that functionality. Worst case scenario would be to alter source code for that specific feature. I’m not shy of getting my hands dirty, I’m currently in my Masters degree in Informatics Engineering, but again, this would not be ideal.
I can’t use either the write_still = True or the save_render(filepath), because writing to file takes too long to do (it costs around 70ms on my machine, meaning it doubles my times).
So far what I tried was accessing the Render Result in bpy.data.images, only to find it empty. I used the trick described here. Long story short, you dynamically add a Render Layer Node in the compositor and connect it to a Viewer Node, and there you can access the pixel information.
This works… for renders only. I am bound to using viewport rendering because it is the only way I can get remotely acceptable times for the task I was assigned. For viewport rendering, the Render Layer Node is always empty.
I can visually see in the image editor that the Render Result has finished, and the render is successful. However, the Python API from everything that I researched doesn’t allow me to access those pixels… Anyone have any guesses?
Even if you don't have an answer, thanks for taking the time to read this!