diff options
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.h | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 31 |
2 files changed, 24 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index dfbc22b1e14..4ac82fcd73f 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -83,8 +83,8 @@ typedef struct TransSnap { short mode; short align; short status; - float snapPoint[3]; - float snapTarget[3]; + float snapPoint[3]; /* snapping from this point */ + float snapTarget[3]; /* to this point */ float snapNormal[3]; float snapTangent[3]; float dist; // Distance from snapPoint to snapTarget diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index dc32a46a301..72901110388 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -554,13 +554,13 @@ void CalcSnapGeometry(TransInfo *t, float *vec) peelObjectsTransForm(t, &depth_peels, t->mval); -// if (stk->nb_points > 0 && stk->points[stk->nb_points - 1].type == PT_CONTINUOUS) +// if (LAST_SNAP_POINT_VALID) // { -// last_p = stk->points[stk->nb_points - 1].p; +// last_p = LAST_SNAP_POINT; // } -// else if (LAST_SNAP_POINT_VALID) +// else // { -// last_p = LAST_SNAP_POINT; + last_p = t->tsnap.snapPoint; // } @@ -1617,13 +1617,26 @@ int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, ListBase Object *ob = dupli_ob->ob; if (ob->type == OB_MESH) { - DerivedMesh *dm; + EditMesh *em; + DerivedMesh *dm = NULL; int val; - - val = peelDerivedMesh(ob, dm, dupli_ob->mat, ray_start, ray_normal, mval, depth_peels); - + + if (ob != obedit) + { + dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); + + val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels); + } + else + { + em = ((Mesh *)ob->data)->edit_mesh; + dm = editmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH); + + val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels); + } + retval = retval || val; - + dm->release(dm); } } |