Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-07-20 18:23:18 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-20 18:23:28 +0300
commit443220984978bfc982799848762d77bc1d10e8c0 (patch)
tree971b99619026d94962bb103d1cfebf46cc829f24 /source/blender/makesrna/intern/rna_render.c
parent7484e4529717a61277525bbb6bc9ac7a747e42f1 (diff)
Fix T78321 Eevee: Motion blur crash rendering animation with high steps count
This was caused by `BPy_*_ALLOW_THREADS` being used when it shouldn't. Implemented the simple fix suggested by @brecht : > The simplest solution may be to ensure that Python stuff is only done > when called through the RNA API, and not when Eevee calls it directly.
Diffstat (limited to 'source/blender/makesrna/intern/rna_render.c')
-rw-r--r--source/blender/makesrna/intern/rna_render.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index a41abb1a1dd..ab8fc8936c0 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -27,6 +27,8 @@
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
+#include "BPY_extern.h"
+
#include "DEG_depsgraph.h"
#include "BKE_image.h"
@@ -408,6 +410,19 @@ static PointerRNA rna_RenderEngine_camera_override_get(PointerRNA *ptr)
}
}
+static void rna_RenderEngine_engine_frame_set(RenderEngine *engine, int frame, float subframe)
+{
+# ifdef WITH_PYTHON
+ BPy_BEGIN_ALLOW_THREADS;
+# endif
+
+ RE_engine_frame_set(engine, frame, subframe);
+
+# ifdef WITH_PYTHON
+ BPy_END_ALLOW_THREADS;
+# endif
+}
+
static void rna_RenderResult_views_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
RenderResult *rr = (RenderResult *)ptr->data;
@@ -673,7 +688,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
parm = RNA_def_string(func, "info", NULL, 0, "Info", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
- func = RNA_def_function(srna, "frame_set", "RE_engine_frame_set");
+ func = RNA_def_function(srna, "frame_set", "rna_RenderEngine_engine_frame_set");
RNA_def_function_ui_description(func, "Evaluate scene at a different frame (for motion blur)");
parm = RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "", INT_MIN, INT_MAX);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);