diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-10-13 02:33:32 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-10-13 02:33:32 +0400 |
commit | 3a1216a2f299025c992561f55c0bb29034c79bdf (patch) | |
tree | fa8248f553582e5442810853a8e7f084c28bd947 /source/blender/editors/armature/editarmature_sketch.c | |
parent | 1fc616351ba8ead153c0c951a91cfadcd740cc17 (diff) |
Project option for snap to faces.
This is similar to the old retopo all option but uses the snapping code and not the openGL depth buffer (it's thus more precise).
Not sure if making it available as a snap option is sensible, this is up for discussion.
NOTE: it will get slow fast on large meshes, we need to plug in an acceleration structure into snapping.
This will need an icon too.
Diffstat (limited to 'source/blender/editors/armature/editarmature_sketch.c')
-rw-r--r-- | source/blender/editors/armature/editarmature_sketch.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 74876691dac..989070c1147 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1174,6 +1174,7 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok SK_Stroke *snap_stk; float vec[3]; float no[3]; + float mval[2]; int found = 0; int dist = SNAP_MIN_DISTANCE; // Use a user defined value here @@ -1197,9 +1198,12 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok point_added = 1; } } + + mval[0] = dd->mval[0]; + mval[1] = dd->mval[1]; /* try to snap to closer object */ - found = snapObjectsContext(C, dd->mval, &dist, vec, no, SNAP_NOT_SELECTED); + found = snapObjectsContext(C, mval, &dist, vec, no, SNAP_NOT_SELECTED); if (found == 1) { pt->type = dd->type; |