Workbench: Fix assert with sculpt in textured color mode

This commit is contained in:
Clément Foucault 2020-08-24 16:24:51 +02:00
parent 5b021dff41
commit 39a09b536e
Notes: blender-bot 2023-02-14 10:21:15 +01:00
Referenced by issue #79909, Assert going to sculptmode with Texture Color Type shading
1 changed files with 6 additions and 1 deletions

View File

@ -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