From 39a09b536ea88b774368ec773a2984d0e3e66ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 24 Aug 2020 16:24:51 +0200 Subject: Workbench: Fix assert with sculpt in textured color mode --- source/blender/draw/engines/workbench/workbench_engine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/draw/engines/workbench/workbench_engine.c') 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 -- cgit v1.2.3