diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-24 17:24:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-24 17:26:29 +0300 |
commit | 39a09b536ea88b774368ec773a2984d0e3e66ea1 (patch) | |
tree | 04a51b80d3cbadcf8fdb382c63648e559c931983 /source/blender/draw/engines/workbench | |
parent | 5b021dff4136353680ba379fc530f49ce564c104 (diff) |
Workbench: Fix assert with sculpt in textured color mode
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_engine.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c index ca80b6a9002..80a8f310191 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.c +++ b/source/blender/draw/engines/workbench/workbench_engine.c @@ -114,7 +114,7 @@ static void workbench_cache_sculpt_populate(WORKBENCH_PrivateData *wpd, eV3DShadingColorType color_type) { const bool use_single_drawcall = !ELEM(color_type, V3D_SHADING_MATERIAL_COLOR); - BLI_assert(wpd->shading.color_type != V3D_SHADING_TEXTURE_COLOR); + BLI_assert(color_type != V3D_SHADING_TEXTURE_COLOR); if (use_single_drawcall) { DRWShadingGroup *grp = workbench_material_setup(wpd, ob, 0, color_type, NULL); @@ -309,6 +309,11 @@ static eV3DShadingColorType workbench_color_type_get(WORKBENCH_PrivateData *wpd, } } + if (is_sculpt_pbvh && color_type == V3D_SHADING_TEXTURE_COLOR) { + /* Force use of material color for sculpt. */ + color_type = V3D_SHADING_MATERIAL_COLOR; + } + if (r_draw_shadow) { *r_draw_shadow = (ob->dtx & OB_DRAW_NO_SHADOW_CAST) == 0 && SHADOW_ENABLED(wpd); /* Currently unsupported in sculpt mode. We could revert to the slow |