diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-01-26 19:48:45 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-01-26 19:48:45 +0300 |
commit | 974981a63704e654e620336a3417f8e6fd259cd3 (patch) | |
tree | 3259de81df2d4cc27fc2a9f02074d6308b79a093 /source/blender/blenkernel/intern | |
parent | 79927e730ea3c72f7c4b5f1cf85c8d8c1c940b14 (diff) |
Fix T95222: Crash selecting vertices with modifier applied on cage
Caused by 0f89bcdbebf where it was needed for cage and evaluated mesh
to have same behavior in respect of having edit_mesh pointer assigned.
This change makes it so that edit_data is not implied to exist when the
edit_mesh pointer is not null. This was already the case in some other
code.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_iterators.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh_iterators.c b/source/blender/blenkernel/intern/mesh_iterators.c index b77d0e38f0f..ff2ac8ecee9 100644 --- a/source/blender/blenkernel/intern/mesh_iterators.c +++ b/source/blender/blenkernel/intern/mesh_iterators.c @@ -46,7 +46,7 @@ void BKE_mesh_foreach_mapped_vert( BMIter iter; BMVert *eve; int i; - if (mesh->runtime.edit_data->vertexCos != NULL) { + if (mesh->runtime.edit_data != NULL && mesh->runtime.edit_data->vertexCos != NULL) { const float(*vertexCos)[3] = mesh->runtime.edit_data->vertexCos; const float(*vertexNos)[3]; if (flag & MESH_FOREACH_USE_NORMAL) { @@ -106,7 +106,7 @@ void BKE_mesh_foreach_mapped_edge( BMIter iter; BMEdge *eed; int i; - if (mesh->runtime.edit_data->vertexCos != NULL) { + if (mesh->runtime.edit_data != NULL && mesh->runtime.edit_data->vertexCos != NULL) { const float(*vertexCos)[3] = mesh->runtime.edit_data->vertexCos; BM_mesh_elem_index_ensure(bm, BM_VERT); @@ -164,7 +164,8 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh, BMIter iter; BMFace *efa; - const float(*vertexCos)[3] = mesh->runtime.edit_data->vertexCos; + const float(*vertexCos)[3] = mesh->runtime.edit_data ? mesh->runtime.edit_data->vertexCos : + NULL; /* XXX: investigate using EditMesh data. */ const float(*lnors)[3] = (flag & MESH_FOREACH_USE_NORMAL) ? @@ -231,7 +232,7 @@ void BKE_mesh_foreach_mapped_face_center( void *userData, MeshForeachFlag flag) { - if (mesh->edit_mesh != NULL) { + if (mesh->edit_mesh != NULL && mesh->runtime.edit_data != NULL) { BMEditMesh *em = mesh->edit_mesh; BMesh *bm = em->bm; const float(*polyCos)[3]; |