diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-01-21 01:43:48 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-01-21 01:43:48 +0300 |
commit | 3d7271f059d5cb5c6f2c7adfaec8d35858485da1 (patch) | |
tree | d2018f243ef4bb2dd2f651e574c60d02489a7072 /source/blender/src/transform_conversions.c | |
parent | 32c4bbbcc5d7a8048ec252eda49a408783f03bea (diff) |
=== Transform Snap ===
Snapping Mode: Active
With this mode, the active element (at this time, object or vertice) is used as snapping target. If there is no active element in the selection, it reverts back to median mode.
Edit Mode snapping, other meshes no longer have to be selected to act as snapping point.
Fix a potential bug with snapping point from other meshes.
Diffstat (limited to 'source/blender/src/transform_conversions.c')
-rw-r--r-- | source/blender/src/transform_conversions.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 3f69316e373..de3e9988f8d 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -1952,6 +1952,7 @@ static void createTransEditVerts(TransInfo *t) EditMesh *em = G.editMesh; EditVert *eve; EditVert **nears = NULL; + EditVert *eve_act = NULL; float *vectors = NULL, *mappedcos = NULL, *quats= NULL; float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL; int count=0, countsel=0, a, totleft; @@ -2002,6 +2003,15 @@ static void createTransEditVerts(TransInfo *t) /* note: in prop mode we need at least 1 selected */ if (countsel==0) return; + /* check active */ + if (G.editMesh->selected.last) { + EditSelection *ese = G.editMesh->selected.last; + if ( ese->type == EDITVERT ) { + eve_act = (EditVert *)ese->data; + } + } + + if(propmode) { t->total = count; @@ -2057,8 +2067,13 @@ static void createTransEditVerts(TransInfo *t) if(eve->h==0) { if(propmode || eve->f1) { VertsToTransData(tob, eve); - + + /* selected */ if(eve->f1) tob->flag |= TD_SELECTED; + + /* active */ + if(eve == eve_act) tob->flag |= TD_ACTIVE; + if(propmode) { if (eve->f2) { float vec[3]; @@ -2883,6 +2898,13 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) Mat3One(td->smtx); Mat3One(td->mtx); } + + /* set active flag */ + if (BASACT && BASACT->object == ob) + { + td->flag |= TD_ACTIVE; + } + #ifdef WITH_VERSE if(ob->vnode) { td->verse = (void*)ob; |