diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-24 21:02:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-24 21:02:35 +0300 |
commit | 2c70b1785c02f8f2c3ac8aeae279a9b8a484d141 (patch) | |
tree | 53c6f6da46b1703fdef08026e2cf0a73d60b2d63 /source/blender | |
parent | 82f019e954e48d0a48fca140c79a1250e0821e9f (diff) |
bugfix [#24887] Crash on snapping verts on other object
now the derived mesh and the editmesh will always have matching faces.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 3 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 863dc0984b8..882295b931c 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -578,12 +578,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float tree = BLI_bvhtree_new(numFaces, epsilon, tree_type, axis); if(tree != NULL) { - /* XXX numFaces is from different mesh as em_evil, made loop check for efa too */ /* XXX, for snap only, em & dm are assumed to be aligned, since dm is the em's cage */ EditMesh *em= data->em_evil; if(em) { EditFace *efa= em->faces.first; - for(i = 0; i < numFaces, efa; i++, efa= efa->next) { + for(i = 0; i < numFaces; i++, efa= efa->next) { if(!(efa->f & 1) && efa->h==0 && !((efa->v1->f&1)+(efa->v2->f&1)+(efa->v3->f&1)+(efa->v4?efa->v4->f&1:0))) { float co[4][3]; VECCOPY(co[0], vert[ face[i].v1 ].co); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 750165219e5..6128c62f670 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1542,7 +1542,8 @@ int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obma if (editobject) { em = ((Mesh *)ob->data)->edit_mesh; - dm = editmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH); + /* dm = editmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH); */ + dm = editmesh_get_derived_base(ob, em); /* limitation, em & dm MUST have the same number of faces */ } else { |