diff options
author | Martin Poirier <theeth@yahoo.com> | 2007-01-30 18:48:09 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2007-01-30 18:48:09 +0300 |
commit | ff75e7d302ea6623c2bc7ba55022aa4567243ab9 (patch) | |
tree | 8a28ce17fcf106ac4f26d9eb9f281af5eca03896 /source/blender/src/transform_snap.c | |
parent | a42c8533aa9a87223be11abe3ac2eb4283d7dd64 (diff) |
=== UV Transform ===
[ #5880 ] Crash on editing UVs
Caused by late check for 3d view in transform snap.
Diffstat (limited to 'source/blender/src/transform_snap.c')
-rw-r--r-- | source/blender/src/transform_snap.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c index ad5f02a9143..7a36f84db35 100644 --- a/source/blender/src/transform_snap.c +++ b/source/blender/src/transform_snap.c @@ -151,19 +151,27 @@ void resetSnapping(TransInfo *t) void initSnapping(TransInfo *t) { resetSnapping(t); - setSnappingCallback(t); - if (t->tsnap.applySnap != NULL && // A snapping function actually exist - (G.obedit != NULL && G.obedit->type==OB_MESH) && // Temporary limited to edit mode meshes - (t->spacetype == SPACE_VIEW3D) && // Only 3D view (not UV) - (G.vd->flag2 & V3D_TRANSFORM_SNAP) && // Only if the snap flag is on - (t->flag & T_PROP_EDIT) == 0) // No PET, obviously - { - t->tsnap.status |= SNAP_ON; - t->tsnap.modePoint = SNAP_GEO; + if (t->spacetype == SPACE_VIEW3D) { // Only 3D view (not UV) + setSnappingCallback(t); + + if (t->tsnap.applySnap != NULL && // A snapping function actually exist + (G.obedit != NULL && G.obedit->type==OB_MESH) && // Temporary limited to edit mode meshes + (G.vd->flag2 & V3D_TRANSFORM_SNAP) && // Only if the snap flag is on + (t->flag & T_PROP_EDIT) == 0) // No PET, obviously + { + t->tsnap.status |= SNAP_ON; + t->tsnap.modePoint = SNAP_GEO; + } + else + { + /* Grid if snap is not possible */ + t->tsnap.modePoint = SNAP_GRID; + } } else { + /* Always grid outside of 3D view */ t->tsnap.modePoint = SNAP_GRID; } } @@ -172,7 +180,6 @@ void setSnappingCallback(TransInfo *t) { t->tsnap.calcSnap = CalcSnapGeometry; - switch(G.vd->snap_target) { case V3D_SNAP_TARGET_CLOSEST: @@ -205,9 +212,6 @@ void setSnappingCallback(TransInfo *t) t->tsnap.targetSnap = TargetSnapMedian; } break; - case TFM_RESIZE: - t->tsnap.applySnap = NULL; - break; default: t->tsnap.applySnap = NULL; break; @@ -465,7 +469,7 @@ void snapGridAction(TransInfo *t, float *val, GearsType action) { void snapGrid(TransInfo *t, float *val) { int invert; GearsType action; - + // Only do something if using Snap to Grid if (t->tsnap.modePoint != SNAP_GRID) return; |