[Bf-blender-cvs] [847613c34ec] blender2.8: Render: Abort operator if there is no render_to_image() function

Clément Foucault noreply at git.blender.org
Mon Jan 29 22:23:26 CET 2018


Commit: 847613c34ecdd61effe820e5e4cabe9c3dc4915c
Author: Clément Foucault
Date:   Mon Jan 29 17:09:38 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB847613c34ecdd61effe820e5e4cabe9c3dc4915c

Render: Abort operator if there is no render_to_image() function

===================================================================

M	source/blender/editors/render/render_internal.c

===================================================================

diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 233365ec926..3be890f2c36 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -295,6 +295,7 @@ static void screen_render_view_layer_set(wmOperator *op, Main *mainp, Scene **sc
 static int screen_render_exec(bContext *C, wmOperator *op)
 {
 	Scene *scene = CTX_data_scene(C);
+	RenderEngineType *re_type = RE_engines_find(scene->view_render.engine_id);
 	ViewLayer *view_layer = NULL;
 	Depsgraph *depsgraph = CTX_data_depsgraph(C);
 	Render *re;
@@ -306,6 +307,11 @@ static int screen_render_exec(bContext *C, wmOperator *op)
 	const bool is_write_still = RNA_boolean_get(op->ptr, "write_still");
 	struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
 
+	/* Cannot do render if there is not this function. */
+	if (re_type->render_to_image == NULL) {
+		return OPERATOR_CANCELLED;
+	}
+
 	/* custom scene and single layer re-render */
 	screen_render_view_layer_set(op, mainp, &scene, &view_layer);
 
@@ -858,6 +864,11 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
 	const char *name;
 	ScrArea *sa;
 
+	/* Cannot do render if there is not this function. */
+	if (re_type->render_to_image == NULL) {
+		return OPERATOR_CANCELLED;
+	}
+
 	/* XXX FIXME If engine is an OpenGL engine do not run modal.
 	 * This is a problem for animation rendering since you cannot abort them.
 	 * This also does not open an image editor space. */



More information about the Bf-blender-cvs mailing list