Fix #133073: Overlay-Next: Meshes without UVs crashes the UV Editor

Add missing check for has_active_edit_uvmap.
This commit is contained in:
Miguel Pozo 2025-01-16 17:14:22 +01:00
parent 3fca91ad74
commit 1406b9e656

View file

@ -715,11 +715,18 @@ class MeshUVs : Overlay {
return;
}
ResourceHandle res_handle = manager.unique_handle(ob_ref);
Object &ob = *ob_ref.object;
Mesh &mesh = *static_cast<Mesh *>(ob.data);
const bool has_active_edit_uvmap =
(CustomData_get_active_layer(&mesh.runtime->edit_mesh->bm->ldata, CD_PROP_FLOAT2) != -1);
if (!has_active_edit_uvmap) {
return;
}
ResourceHandle res_handle = manager.unique_handle(ob_ref);
if (show_uv_edit) {
gpu::Batch *geom = DRW_mesh_batch_cache_get_edituv_edges(ob, mesh);
edges_ps_.draw_expand(geom, GPU_PRIM_TRIS, 2, 1, res_handle);