=== UV Transform ===
[ #5880 ] Crash on editing UVs Caused by late check for 3d view in transform snap.
This commit is contained in:
@@ -151,11 +151,12 @@ void resetSnapping(TransInfo *t)
|
|||||||
void initSnapping(TransInfo *t)
|
void initSnapping(TransInfo *t)
|
||||||
{
|
{
|
||||||
resetSnapping(t);
|
resetSnapping(t);
|
||||||
|
|
||||||
|
if (t->spacetype == SPACE_VIEW3D) { // Only 3D view (not UV)
|
||||||
setSnappingCallback(t);
|
setSnappingCallback(t);
|
||||||
|
|
||||||
if (t->tsnap.applySnap != NULL && // A snapping function actually exist
|
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.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
|
(G.vd->flag2 & V3D_TRANSFORM_SNAP) && // Only if the snap flag is on
|
||||||
(t->flag & T_PROP_EDIT) == 0) // No PET, obviously
|
(t->flag & T_PROP_EDIT) == 0) // No PET, obviously
|
||||||
{
|
{
|
||||||
@@ -164,6 +165,13 @@ void initSnapping(TransInfo *t)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Grid if snap is not possible */
|
||||||
|
t->tsnap.modePoint = SNAP_GRID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Always grid outside of 3D view */
|
||||||
t->tsnap.modePoint = SNAP_GRID;
|
t->tsnap.modePoint = SNAP_GRID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +180,6 @@ void setSnappingCallback(TransInfo *t)
|
|||||||
{
|
{
|
||||||
t->tsnap.calcSnap = CalcSnapGeometry;
|
t->tsnap.calcSnap = CalcSnapGeometry;
|
||||||
|
|
||||||
|
|
||||||
switch(G.vd->snap_target)
|
switch(G.vd->snap_target)
|
||||||
{
|
{
|
||||||
case V3D_SNAP_TARGET_CLOSEST:
|
case V3D_SNAP_TARGET_CLOSEST:
|
||||||
@@ -205,9 +212,6 @@ void setSnappingCallback(TransInfo *t)
|
|||||||
t->tsnap.targetSnap = TargetSnapMedian;
|
t->tsnap.targetSnap = TargetSnapMedian;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TFM_RESIZE:
|
|
||||||
t->tsnap.applySnap = NULL;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
t->tsnap.applySnap = NULL;
|
t->tsnap.applySnap = NULL;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user