[Bf-python] Fastest way for RenderEngine to return combined rgba + z

Asbjørn lordcrc at gmail.com
Thu Jan 31 23:36:16 CET 2013


Hi,

in LuxBlend25 we're returning combined rgba + z (depth) data as follows:

   result = self.begin_result(0, 0, xres, yres)
   lay = result.layers[0]
   lay.rect, lay.passes[0].rect = combinedResults()
   self.end_result(result)

where combinedResults() returns a tuple of two lists, the first a list 
of rgba values, each rgba value also stored as a list), and the second a 
list of floats. This function is implemented in a binary module.

This method is very slow. It seems the overhead of converting the 
internal data to lists is quite high. Returning an iterator for the 
outer list of rgba pixels did not improve the situation noticeably.

Are there better (API) ways of doing this directly, that is, without 
loading files from disk?

Cheers
- Asbjørn




More information about the Bf-python mailing list