From 0a546beb1f3a6b53fdd57da892ccdf893c269010 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 5 Feb 2021 10:49:39 +0100 Subject: Fix T85396: Display Texture Paint UV only working in editmode Caused by rBf83aa830cd00. Since above commit, only meshes in editmode were considered for drawing (because BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs was used), but the option needs to work for texture paint mode as well, so use BKE_view_layer_array_from_objects_in_mode_unique_data instead on pass the draw_ctx->object_mode. note: there is no good filter_fn to check if we have UVs if mesh is not in editmode, this shouldnt cause much of a performance hit though. Maniphest Tasks: T85396 Differential Revision: https://developer.blender.org/D10319 --- source/blender/draw/engines/overlay/overlay_edit_uv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/draw/engines') diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c index 06ef56a212b..22433905b75 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.c +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c @@ -403,8 +403,8 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) * has the correct batches with the correct selection state. See T83187. */ if (pd->edit_uv.do_uv_overlay || pd->edit_uv.do_uv_shadow_overlay) { uint objects_len = 0; - Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( - draw_ctx->view_layer, NULL, &objects_len); + Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data( + draw_ctx->view_layer, NULL, &objects_len, draw_ctx->object_mode); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *object_eval = DEG_get_evaluated_object(draw_ctx->depsgraph, objects[ob_index]); DRW_mesh_batch_cache_validate((Mesh *)object_eval->data); -- cgit v1.2.3