Beispiel #1
0
int RE_engine_test_break(RenderEngine *engine)
{
	Render *re = engine->re;

	if (re)
		return re->test_break(re->tbh);
	
	return 0;
}
Beispiel #2
0
void RE_engine_end_result(RenderEngine *engine, RenderResult *result, int cancel, int merge_results)
{
	Render *re = engine->re;

	if (!result) {
		return;
	}

	/* merge. on break, don't merge in result for preview renders, looks nicer */
	if (!cancel) {
		/* for exr tile render, detect tiles that are done */
		RenderPart *pa = get_part_from_result(re, result);

		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 (!cancel || merge_results) {
		if (re->result->do_exr_tile) {
			if (!cancel) {
				render_result_exr_file_merge(re->result, result);
			}
		}
		else if (!(re->test_break(re->tbh) && (re->r.scemode & R_BUTS_PREVIEW)))
			render_result_merge(re->result, result);

		/* draw */
		if (!re->test_break(re->tbh)) {
			result->renlay = result->layers.first; /* weak, draws first layer always */
			re->display_update(re->duh, result, NULL);
		}
	}

	/* free */
	BLI_remlink(&engine->fullresult, result);
	render_result_free(result);
}