diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-02-27 14:22:16 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-02-27 14:22:16 +0300 |
commit | 2515a125c8329eaa55a0ae5a36a5f3780b056ae4 (patch) | |
tree | 6e3317f947c90fb83ce8064280fac4b623a96b80 /source/blender/makesrna/intern | |
parent | 57bd1a0ae18b327a57c187c48bdb9effcb5f4b6a (diff) | |
parent | f24a4750bdd6fcb409785e6527cdcb0b5f33e222 (diff) |
Fix T74254: EEVEE Render Passes Availability
When disabling AO or BLOOM in the render tab, when the pass is shown in
a 3d viewport the pass wasn't reset. This resulted in showing a black
texture and a not filled UI render pass in the shading popover.
This patch will by default reset to the combined pass. It is intended
that the render_pass in the 3d shading struct isn't set to combined as
people could have disabled AO/bloom by mistake and it could reset
viewports that aren't visible.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5fdc2a18330..762c1985fa9 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1285,6 +1285,21 @@ static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, *r_free = true; return result; } +static int rna_3DViewShading_render_pass_get(PointerRNA *ptr) +{ + View3DShading *shading = (View3DShading *)ptr->data; + eViewLayerEEVEEPassType result = shading->render_pass; + Scene *scene = rna_3DViewShading_scene(ptr); + + if (result == EEVEE_RENDER_PASS_AO && ((scene->eevee.flag & SCE_EEVEE_GTAO_ENABLED) == 0)) { + result = EEVEE_RENDER_PASS_COMBINED; + } + if (result == EEVEE_RENDER_PASS_BLOOM && ((scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED) == 0)) { + result = EEVEE_RENDER_PASS_COMBINED; + } + + return result; +} static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr) { @@ -3381,7 +3396,8 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "render_pass"); RNA_def_property_enum_items(prop, rna_enum_view3dshading_render_pass_type_items); RNA_def_property_ui_text(prop, "Render Pass", "Render Pass to show in the viewport"); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_3DViewShading_render_pass_itemf"); + RNA_def_property_enum_funcs( + prop, "rna_3DViewShading_render_pass_get", NULL, "rna_3DViewShading_render_pass_itemf"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); } |