Fix T70226 EEVEE: Crash/Assert entering edit mode with instanced meshes...

... and modifiers.

This was caused by wrong mesh being taken into account when in edit mode.
This commit is contained in:
Clément Foucault 2019-09-28 00:19:30 +02:00
parent 6cbfa8d511
commit ad22d3111f
Notes: blender-bot 2023-02-14 06:19:41 +01:00
Referenced by issue #70226, Blender crash when try to edit a mesh in devlook
1 changed files with 3 additions and 1 deletions

View File

@ -1044,7 +1044,9 @@ void DRW_mesh_batch_cache_create_requested(
MBC_EDITUV_FACES_STRETCH_ANGLE | MBC_EDITUV_FACES | MBC_EDITUV_EDGES | MBC_EDITUV_VERTS)) {
/* Modifiers will only generate an orco layer if the mesh is deformed. */
if (cache->cd_needed.orco != 0) {
if (CustomData_get_layer(&me->vdata, CD_ORCO) == NULL) {
/* Orco is always extracted from final mesh. */
Mesh *me_final = (me->edit_mesh) ? me->edit_mesh->mesh_eval_final : me;
if (CustomData_get_layer(&me_final->vdata, CD_ORCO) == NULL) {
/* Skip orco calculation */
cache->cd_needed.orco = 0;
}