[Bf-blender-cvs] [199c37d7e44] master: Fix T68291: crash snapping to both verts and edges with linked meshes
Philipp Oeser
noreply at git.blender.org
Tue Aug 6 13:32:31 CEST 2019
Commit: 199c37d7e44776f382920632b334e9d21b06f6aa
Author: Philipp Oeser
Date: Tue Aug 6 10:10:21 2019 +0200
Branches: master
https://developer.blender.org/rB199c37d7e44776f382920632b334e9d21b06f6aa
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
===================================================================
M source/blender/editors/transform/transform_snap_object.c
===================================================================
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index 6f06f8639bd..3f17be605b2 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -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) {
More information about the Bf-blender-cvs
mailing list