3

My issue is that I want to access the buffer data from python, pixel after pixel, for being able to use it for arbitrary computations. How can I achieve this?

(Please dont tell me about exporting to different kinds of formats like exr etc, because I want to do computations in place).

Also I'm talking about blender 2.68 or higher.

luke1985
  • 593
  • 6
  • 20

2 Answers2

1

Image.pixel is not available for Render Results, nor does it contain depth-information.

You can get the depth in Node Compositor / Cycles, but I don't believe it's possible to read with python in-place.

CodeManX
  • 29,298
  • 3
  • 89
  • 128
0

Yes, this is possible. You can use this trick to get the rendered pixels: https://blender.stackexchange.com/a/23309/13212

However, instead of connecting the image output of the Render Layers to the Viewer's Image input, you can connect the Z output of the Render Layers. This will give you the depth pixels for each pixel four times (in each color channel)

Jan Rüegg
  • 693
  • 1
  • 5
  • 9