diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-01-19 01:09:29 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-01-19 01:09:29 +0300 |
commit | ff52dcbf0dd4ab81e9aebcfff3702c987d05e98c (patch) | |
tree | 8870473c50a3c69664f4d36e9bedae0cdcce1e82 /source | |
parent | bae2de3f1a23205bc2a11a7065fee450c4a591a9 (diff) |
Bugfix: Transform Snap
Would crash if snapping from a mesh in edit mode to a group instance including that same mesh.
Reported by UncleZeiv on IRC
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/transform_snap.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index e7937e72c2b..eeb5eaeec10 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -1186,10 +1186,21 @@ int snapObjects(int *dist, float *loc, float *no, int mode) { Object *ob = dupli_ob->ob; if (ob->type == OB_MESH) { - DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); + DerivedMesh *dm; + int editmesh = 0; int val; - val = snapDerivedMesh(ob, dm, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth, 0); + if (ob == G.obedit) + { + dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); + editmesh = 1; + } + else + { + dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); + } + + val = snapDerivedMesh(ob, dm, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth, editmesh); retval = retval || val; |