Fix #30512: external render saved render result after reporting error.
This commit is contained in:
@@ -66,6 +66,8 @@ char *BKE_reports_string(ReportList *reports, ReportType level);
|
|||||||
void BKE_reports_print(ReportList *reports, ReportType level);
|
void BKE_reports_print(ReportList *reports, ReportType level);
|
||||||
|
|
||||||
Report *BKE_reports_last_displayable(ReportList *reports);
|
Report *BKE_reports_last_displayable(ReportList *reports);
|
||||||
|
|
||||||
|
int BKE_reports_contain(ReportList *reports, ReportType level);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
#include "BKE_report.h"
|
#include "BKE_report.h"
|
||||||
#include "BKE_global.h" /* G.background only */
|
#include "BKE_global.h" /* G.background only */
|
||||||
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -264,12 +263,24 @@ void BKE_reports_print(ReportList *reports, ReportType level)
|
|||||||
|
|
||||||
Report *BKE_reports_last_displayable(ReportList *reports)
|
Report *BKE_reports_last_displayable(ReportList *reports)
|
||||||
{
|
{
|
||||||
Report *report=NULL;
|
Report *report;
|
||||||
|
|
||||||
for (report= (Report *)reports->list.last; report; report=report->prev) {
|
for (report= reports->list.last; report; report=report->prev) {
|
||||||
if (ELEM3(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO))
|
if (ELEM3(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO))
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int BKE_reports_contain(ReportList *reports, ReportType level)
|
||||||
|
{
|
||||||
|
Report *report;
|
||||||
|
|
||||||
|
for(report=reports->list.first; report; report=report->next)
|
||||||
|
if(report->type >= level)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include "BLI_string.h"
|
#include "BLI_string.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
|
#include "BKE_global.h"
|
||||||
#include "BKE_report.h"
|
#include "BKE_report.h"
|
||||||
#include "BKE_scene.h"
|
#include "BKE_scene.h"
|
||||||
|
|
||||||
@@ -323,6 +324,9 @@ int RE_engine_render(Render *re, int do_all)
|
|||||||
|
|
||||||
RE_engine_free(engine);
|
RE_engine_free(engine);
|
||||||
|
|
||||||
|
if(BKE_reports_contain(re->reports, RPT_ERROR))
|
||||||
|
G.afbreek = 1;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user