Fix #36091: external render engines like Luxrender don't work well with the save
buffers option, it requires specific tile sizes and if they don't match what OpenEXR expects file saving can get stuck. Now I've made support for his optional, with a bl_use_save_buffers property for RenderEngine, set to False by default.
This commit is contained in:
@@ -41,6 +41,7 @@ class CyclesRender(bpy.types.RenderEngine):
|
||||
bl_use_shading_nodes = True
|
||||
bl_use_preview = True
|
||||
bl_use_exclude_layers = True
|
||||
bl_use_save_buffers = True
|
||||
|
||||
def __init__(self):
|
||||
self.session = None
|
||||
|
@@ -456,6 +456,10 @@ static void rna_def_render_engine(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_EXCLUDE_LAYERS);
|
||||
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
||||
|
||||
prop = RNA_def_property(srna, "bl_use_save_buffers", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SAVE_BUFFERS);
|
||||
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
||||
|
||||
RNA_define_verify_sdna(1);
|
||||
}
|
||||
|
||||
|
@@ -57,6 +57,7 @@ struct Scene;
|
||||
#define RE_USE_POSTPROCESS 8
|
||||
#define RE_USE_SHADING_NODES 16
|
||||
#define RE_USE_EXCLUDE_LAYERS 32
|
||||
#define RE_USE_SAVE_BUFFERS 64
|
||||
|
||||
/* RenderEngine.flag */
|
||||
#define RE_ENGINE_ANIMATION 1
|
||||
|
@@ -253,8 +253,14 @@ void RE_engine_end_result(RenderEngine *engine, RenderResult *result, int cancel
|
||||
/* for exr tile render, detect tiles that are done */
|
||||
RenderPart *pa = get_part_from_result(re, result);
|
||||
|
||||
if (pa)
|
||||
if (pa) {
|
||||
pa->status = PART_STATUS_READY;
|
||||
}
|
||||
else if (re->result->do_exr_tile) {
|
||||
/* if written result does not match any tile and we are using save
|
||||
* buffers, we are going to get openexr save errors */
|
||||
fprintf(stderr, "RenderEngine.end_result: dimensions do not match any OpenEXR tile.\n");
|
||||
}
|
||||
|
||||
if (re->result->do_exr_tile)
|
||||
render_result_exr_file_merge(re->result, result);
|
||||
@@ -438,12 +444,13 @@ int RE_engine_render(Render *re, int do_all)
|
||||
/* create render result */
|
||||
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
||||
if (re->result == NULL || !(re->r.scemode & R_BUTS_PREVIEW)) {
|
||||
int savebuffers;
|
||||
int savebuffers = RR_USE_MEM;
|
||||
|
||||
if (re->result)
|
||||
render_result_free(re->result);
|
||||
|
||||
savebuffers = (re->r.scemode & R_EXR_TILE_FILE) ? RR_USE_EXR : RR_USE_MEM;
|
||||
if ((type->flag & RE_USE_SAVE_BUFFERS) && (re->r.scemode & R_EXR_TILE_FILE))
|
||||
savebuffers = RR_USE_EXR;
|
||||
re->result = render_result_new(re, &re->disprect, 0, savebuffers, RR_ALL_LAYERS);
|
||||
}
|
||||
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||
|
Reference in New Issue
Block a user