[Bf-blender-cvs] [d7b472c1989] blender2.8: Fix wrong view layer rendered from command line

Sergey Sharybin noreply at git.blender.org
Mon Jul 23 11:54:55 CEST 2018


Commit: d7b472c19898a04a4b90da45d2749872ef56bd88
Author: Sergey Sharybin
Date:   Mon Jul 23 11:47:06 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd7b472c19898a04a4b90da45d2749872ef56bd88

Fix wrong view layer rendered from command line

The issue was caused by Render Single Layer option enabled, which is
very handy for artists work, so they can hit F12 and see view layer
they are currently working in a final rendered state. This saves a lot
of time since all the "non-interesting" objects are ignored for such
iterations.

However, for the render farm we need to render view layers which are
explicitly set for render, and ignore active view layer.

Reasonable solution seems to be to ignore the Render Single Layer
option when rendering from the command line. It is really something
more like UI behavior option.

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

M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/render/intern/include/render_result.h

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

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index dd08be4c943..b44a53fa90b 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5412,7 +5412,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
-	RNA_def_property_ui_text(prop, "Render Single Layer", "Only render the active layer");
+	RNA_def_property_ui_text(prop, "Render Single Layer", "Only render the active layer. Only affects rendering from the interface, ignored for rendering from command line");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
diff --git a/source/blender/render/intern/include/render_result.h b/source/blender/render/intern/include/render_result.h
index 3096949b49f..ab7eee128f0 100644
--- a/source/blender/render/intern/include/render_result.h
+++ b/source/blender/render/intern/include/render_result.h
@@ -123,7 +123,7 @@ bool render_result_has_views(struct RenderResult *rr);
 	     iter_ != NULL;                                   \
 	    iter_ = iter_->next, nr_++)                       \
 	{                                                     \
-		if ((re_)->r.scemode & R_SINGLE_LAYER) {          \
+		if (!G.background &&  (re_)->r.scemode & R_SINGLE_LAYER) {  \
 			if (nr_ != re->active_view_layer) {           \
 				continue;                                 \
 			}                                             \



More information about the Bf-blender-cvs mailing list