gulvarol / surreal

Learning from Synthetic Humans, CVPR 2017
http://www.di.ens.fr/willow/research/surreal
Other
587 stars 107 forks source link

OpenEXR seems unnecessary when running in Blender v2.79 #8

Closed wildermuthn closed 5 years ago

wildermuthn commented 6 years ago

Source: https://blender.stackexchange.com/questions/69230/python-render-script-different-outcome-when-run-in-background/81240#81240

I am running a newer version of Blender (2.79, built from source on OSX), and I didn't run into the problems you mention in the code or discussed in the SO question above — it works fine in background mode and UI mode both with a standard build of the latest blender source.

As a small note, using 2.79 required a small change to switch from 'Z' output layer to 'Depth' here: https://github.com/gulvarol/surreal/blob/master/datageneration/main_part1.py#L148. Otherwise I've noticed no difference. I haven't seen any memory leaks, but I also haven't done a full run of data generation.

gulvarol commented 6 years ago

I assume you are talking about the problem here: https://github.com/gulvarol/surreal/blob/master/datageneration/main_part1.py#L761

        # NOTE:
        # ideally, pixels should be readable from a viewer node, but I get only zeros
        # --> https://ammous88.wordpress.com/2015/01/16/blender-access-render-results-pixels-directly-from-python-2/
        # len(np.asarray(bpy.data.images['Render Result'].pixels) is 0
        # Therefore we write them to temporary files and read with OpenEXR library (available for python2) in main_part2.py

It's great if it works this way. Thanks for pointing to the link.