diff options
author | Sebastian Parborg <zeddb> | 2018-12-27 20:39:39 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-27 20:43:59 +0300 |
commit | 5b9440278ee9001645e4475436f6899c84d4ba1c (patch) | |
tree | fd9846f6ccaf9aef7c0fd9c2f811b5c602da5259 /source | |
parent | c55c15bb775095a68ee3f2e68b052d2a8166417a (diff) |
Fix T59865: UV editor vertex snap to active does not make any sense.
Differential Revision: https://developer.blender.org/D4129
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index f1dc5525dbc..943dedabba2 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -2003,12 +2003,13 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3]) { TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_OK(t); - bool ok = false; - - if (tc->obedit) { + if (t->spacetype != SPACE_VIEW3D) { + return false; + } + else if (tc->obedit) { if (ED_object_calc_active_center_for_editmode(tc->obedit, select_only, r_center)) { mul_m4_v3(tc->obedit->obmat, r_center); - ok = true; + return true; } } else if (t->flag & T_POSE) { @@ -2016,7 +2017,7 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3]) Object *ob = OBACT(view_layer) ; if (ED_object_calc_active_center_for_posemode(ob, select_only, r_center)) { mul_m4_v3(ob->obmat, r_center); - ok = true; + return true; } } else if (t->options & CTX_PAINT_CURVE) { @@ -2025,7 +2026,7 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3]) PaintCurve *pc = br->paint_curve; copy_v3_v3(r_center, pc->points[pc->add_index - 1].bez.vec[1]); r_center[2] = 0.0f; - ok = true; + return true; } else { /* object mode */ @@ -2034,11 +2035,11 @@ bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[3]) Base *base = BASACT(view_layer); if (ob && ((!select_only) || ((base->flag & BASE_SELECTED) != 0))) { copy_v3_v3(r_center, ob->obmat[3]); - ok = true; + return true; } } - return ok; + return false; } static void calculateCenter_FromAround(TransInfo *t, int around, float r_center[3]) |