diff options
-rw-r--r-- | source/blender/editors/transform/transform_convert_object_texspace.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 26 |
2 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/editors/transform/transform_convert_object_texspace.c b/source/blender/editors/transform/transform_convert_object_texspace.c index 763af1f3384..1f58ec80f02 100644 --- a/source/blender/editors/transform/transform_convert_object_texspace.c +++ b/source/blender/editors/transform/transform_convert_object_texspace.c @@ -63,7 +63,6 @@ void createTransTexspace(TransInfo *t) } td->flag = TD_SELECTED; - copy_v3_v3(td->center, ob->obmat[3]); td->ob = ob; copy_m3_m4(td->mtx, ob->obmat); @@ -77,6 +76,7 @@ void createTransTexspace(TransInfo *t) } copy_v3_v3(td->iloc, td->loc); + copy_v3_v3(td->center, td->loc); copy_v3_v3(td->ext->isize, td->ext->size); } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index fefd8d3a378..23619a2049a 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -598,21 +598,19 @@ static short snap_mode_from_spacetype(TransInfo *t) return SEQ_tool_settings_snap_mode_get(t->scene); } - if ((t->spacetype == SPACE_VIEW3D) && !(t->options & CTX_CAMERA)) { - /* All obedit types will match. */ - const int obedit_type = t->obedit_type; - if ((t->options & (CTX_GPENCIL_STROKES | CTX_CURSOR | CTX_OBMODE_XFORM_OBDATA)) || - ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVES_LEGACY, OB_LATTICE, OB_MBALL, -1)) { - short snap_mode = ts->snap_mode; - if ((snap_mode & SCE_SNAP_MODE_INCREMENT) && (ts->snap_flag & SCE_SNAP_ABS_GRID) && - (t->mode == TFM_TRANSLATION)) { - /* Special case in which snap to increments is transformed to snap to grid. */ - snap_mode &= ~SCE_SNAP_MODE_INCREMENT; - snap_mode |= SCE_SNAP_MODE_GRID; - } - return snap_mode; + if (t->spacetype == SPACE_VIEW3D) { + if (t->options & (CTX_CAMERA | CTX_EDGE_DATA | CTX_PAINT_CURVE)) { + return SCE_SNAP_MODE_INCREMENT; } - return SCE_SNAP_MODE_INCREMENT; + + short snap_mode = ts->snap_mode; + if ((snap_mode & SCE_SNAP_MODE_INCREMENT) && (ts->snap_flag & SCE_SNAP_ABS_GRID) && + (t->mode == TFM_TRANSLATION)) { + /* Special case in which snap to increments is transformed to snap to grid. */ + snap_mode &= ~SCE_SNAP_MODE_INCREMENT; + snap_mode |= SCE_SNAP_MODE_GRID; + } + return snap_mode; } if (ELEM(t->spacetype, SPACE_ACTION, SPACE_NLA)) { |