diff options
author | Martin Poirier <theeth@yahoo.com> | 2006-12-29 01:42:58 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2006-12-29 01:42:58 +0300 |
commit | 3c13561ab59b6abb667b846955040a00a9c5be7a (patch) | |
tree | d27d66083a9c6dcd9da79061b43d1d608f10c7c7 /source/blender/src/transform_snap.c | |
parent | d665beb5df7ba099f0da983bfe939ab30e54dfba (diff) |
=== Transform Snap ===
Fixed the bug where it would snap to a selected (moving) vertex.
Fixed a bug with Snap Closest with only one vertex selected.
=== Internals: EditMesh Mods ===
Modify and documented findnearestvert.
Added a new parameter to restrict the search to selected or unselected vert instead of just adding a bias to them (as previously). Currently, the "strict" method bypasses the openGL optimisation, people with more knowledge about that should feel invited to fix it.
=== Internals: EditMesh Tools ===
Adding missing newline at the end.
Diffstat (limited to 'source/blender/src/transform_snap.c')
-rw-r--r-- | source/blender/src/transform_snap.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index 0754058a5da..3290faa289d 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -309,10 +309,10 @@ void CalcSnapGeometry(TransInfo *t, float *vec) /*if (G.scene->selectmode & B_SEL_VERT)*/ { EditVert *nearest=NULL; - int dist = 50; // Use a user defined value here + int dist = 40; // Use a user defined value here // use findnearestverts in vert mode, others in other modes - nearest = findnearestvert(&dist, 0); + nearest = findnearestvert(&dist, SELECT, 1); if (nearest != NULL) { @@ -409,7 +409,12 @@ void TargetSnapClosest(TransInfo *t) // Base case, only one selected item if (t->total == 1) { - closest = t->data; + VECCOPY(t->tsnap.snapTarget, t->data[0].iloc); + + if(t->flag & (T_EDIT|T_POSE)) { + Object *ob= G.obedit?G.obedit:t->poseobj; + Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget); + } } // More than one selected item else @@ -420,7 +425,11 @@ void TargetSnapClosest(TransInfo *t) float dist; VECCOPY(loc, td->iloc); - Mat4MulVecfl(G.obedit->obmat, loc); + + if(t->flag & (T_EDIT|T_POSE)) { + Object *ob= G.obedit?G.obedit:t->poseobj; + Mat4MulVecfl(ob->obmat, loc); + } dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint); |