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.
This commit is contained in:
2018-07-23 11:47:06 +02:00
parent f0dd7dd4c0
commit d7b472c198
2 changed files with 2 additions and 2 deletions

View File

@@ -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);

View File

@@ -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; \
} \