diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-01-28 20:24:17 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-01-28 20:24:17 +0300 |
commit | 49403a676b81b0d6ca3d13c277af6de312153d3b (patch) | |
tree | a38a7c88de53a6a323d6c8030b9caa9ecf9c5aa2 /source/blender/draw/engines/workbench/workbench_forward.c | |
parent | 1af8e0cc6c47b43bf9c94a3f845961f4d22cb34e (diff) | |
parent | 12865caf4f3dd48f343db7167b20e303160004a3 (diff) |
Merge remote-tracking branch 'origin/blender-v2.82-release'
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_forward.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_forward.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 3b588868a94..e5f121a690d 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -594,7 +594,7 @@ static void workbench_forward_cache_populate_texture_paint_mode(WORKBENCH_Data * } else { /* IMAGEPAINT_MODE_MATERIAL */ - const int materials_len = MAX2(1, ob->totcol); + const int materials_len = DRW_cache_object_material_count_get(ob); struct GPUBatch **geom_array = DRW_cache_mesh_surface_texpaint_get(ob); for (int i = 0; i < materials_len; i++) { if (geom_array != NULL && geom_array[i] != NULL) { @@ -668,7 +668,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob) if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d) && !DRW_state_is_image_render(); - const int materials_len = MAX2(1, ob->totcol); + const int materials_len = DRW_cache_object_material_count_get(ob); const Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL; const WORKBENCH_ColorOverride color_override = workbench_object_color_override_get(ob); const bool use_texture_paint_drawing = !(DRW_state_is_image_render() && |