Fix T68291: crash snapping to both verts and edges with linked meshes

this was also happening in snapping with the measure tool

same method as in snap_mesh_polygon() (from rB59286ddcf80c) now used in
snap_mesh_edge_verts_mixed() as well...

Reviewers: mano-wii

Maniphest Tasks: T68291

Differential Revision: https://developer.blender.org/D5422
This commit is contained in:
Philipp Oeser 2019-08-06 10:10:21 +02:00
parent 45ae33a952
commit 199c37d7e4
Notes: blender-bot 2023-02-14 01:21:17 +01:00
Referenced by issue #68291, Measure Tool crashes Blender when snapping (to vertices) in multi object edit mode
1 changed files with 7 additions and 0 deletions

View File

@ -1382,6 +1382,13 @@ static short snap_mesh_edge_verts_mixed(SnapObjectContext *sctx,
};
SnapObjectData *sod = BLI_ghash_lookup(sctx->cache.object_map, ob);
if (sod == NULL) {
/* The object is in edit mode, and the key used
* was the object referenced in BMEditMesh */
BMEditMesh *em = BKE_editmesh_from_object(ob);
sod = BLI_ghash_lookup(sctx->cache.object_map, em->ob);
}
BLI_assert(sod != NULL);
if (sod->type == SNAP_MESH) {