diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-28 20:37:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-28 20:59:33 +0300 |
commit | 3f4e3f718fdc1163cc52a84d85978fa94b230211 (patch) | |
tree | 21bdaae3f63721ac481493a58d9abd37395243ce /source/blender/makesrna | |
parent | a7c5f4f20657e12b43337e32bc62a876cbbe6292 (diff) |
Cycles: restore old sample and material override settings for view layers.
Since there will be no view layer overrides in 2.80, this is needed still.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 155c030587d..6e69de774e9 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -274,6 +274,7 @@ void rna_Scene_use_view_map_cache_update(struct Main *bmain, struct Scene *scene void rna_Scene_glsl_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_Scene_freestyle_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_ViewLayer_name_set(struct PointerRNA *ptr, const char *value); +void rna_ViewLayer_material_override_update(struct Main *bmain, struct Scene *activescene, struct PointerRNA *ptr); void rna_ViewLayer_pass_update(struct Main *bmain, struct Scene *activescene, struct PointerRNA *ptr); /* named internal so as not to conflict with obj.update() rna func */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 9389dcf81ef..f3f5371b458 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1424,6 +1424,13 @@ static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value) BLI_uniquename(&scene->r.views, rv, DATA_("RenderView"), '.', offsetof(SceneRenderView, name), sizeof(rv->name)); } +void rna_ViewLayer_material_override_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +{ + Scene *scene = (Scene *)ptr->id.data; + rna_Scene_glsl_update(bmain, scene, ptr); + DEG_relations_tag_update(bmain); +} + void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr) { Scene *scene = (Scene *)ptr->id.data; @@ -3227,6 +3234,19 @@ void rna_def_view_layer_common(StructRNA *srna, int scene) else RNA_def_property_clear_flag(prop, PROP_EDITABLE); if (scene) { + prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "mat_override"); + RNA_def_property_struct_type(prop, "Material"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Material Override", + "Material to override all other materials in this view layer"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_material_override_update"); + + prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED); + RNA_def_property_ui_text(prop, "Samples", "Override number of render samples for this view layer, " + "0 will use the scene setting"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); + prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Alpha Threshold", "Z, Index, normal, UV and vector passes are only affected by surfaces with " |