diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-07-27 16:05:46 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-07-27 16:28:15 +0300 |
commit | 70966af5134b0cf53273e3c6da19ad7d5857b0f2 (patch) | |
tree | fba1f343ac327ede662580b3904042604e421d5d /source/blender/draw/engines/workbench/workbench_data.c | |
parent | d6ff77878039a5c3848482c6a82ff626d4b3872c (diff) |
Workbench: option to change background
Replaced the draw world option with a shading.background_type enum.
Where the user can select Theme, World or a Custom color.
World and theme colors do not always work in workbench. We needed to
have an option what the user could control locally (per viewport).
Especially when using linked data.
I removed the world background drawing from the draw_manager. It was never used as EEVEE and Workbench both override the logic.
Not 100% sure about the naming of Theme, World, Viewport.
In other parts of blender's codebase World is sometimes called Scene.
Will stick to the names that describes its location best.
{F3990139}
Reviewers: fclem, campbellbarton
Reviewed By: fclem
Subscribers: venomgfx
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3551
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_data.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_data.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index 5c3ab5f6688..24eb0f38a46 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -45,10 +45,16 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd) wd->matcap_orientation = (wpd->shading.flag & V3D_SHADING_MATCAP_FLIP_X) != 0; wd->background_alpha = (v3d || scene->r.alphamode == R_ADDSKY) ? 1.0f : 0.0f; - if (!v3d || ((v3d->flag3 & V3D_SHOW_WORLD) && (scene->world != NULL))) { + if (!v3d || ((v3d->shading.background_type & V3D_SHADING_BACKGROUND_WORLD) && + (scene->world != NULL))) + { copy_v3_v3(wd->background_color_low, &scene->world->horr); copy_v3_v3(wd->background_color_high, &scene->world->horr); } + else if (v3d->shading.background_type & V3D_SHADING_BACKGROUND_VIEWPORT) { + copy_v3_v3(wd->background_color_low, v3d->shading.background_color); + copy_v3_v3(wd->background_color_high, v3d->shading.background_color); + } else if (v3d) { UI_GetThemeColor3fv(UI_GetThemeValue(TH_SHOW_BACK_GRAD) ? TH_LOW_GRAD : TH_HIGH_GRAD, wd->background_color_low); UI_GetThemeColor3fv(TH_HIGH_GRAD, wd->background_color_high); |