diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-02-27 14:15:33 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-02-27 14:15:33 +0300 |
commit | f24a4750bdd6fcb409785e6527cdcb0b5f33e222 (patch) | |
tree | db384d7a944db3d9999717204e943b483e30dfd1 /source/blender/makesrna | |
parent | 01162f756a02739314b10fd817759e0c6f344d07 (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')
-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 3d5d5091bf1..292d3959fad 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1283,6 +1283,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) { @@ -3379,7 +3394,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); } |