diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-25 02:41:37 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-25 02:41:37 +0400 |
commit | 28dd9c6a40859bf8d707b072174557d37240f162 (patch) | |
tree | c5436dcea18b4e70b1c363f84d1a52bf050a8a36 /source/blender/editors/transform | |
parent | 02fbfa5c70732e691606546ecce60fdfe3f80d9f (diff) |
Fix #35767: transforming nodes in the node editor changed the wireframe color
of the active object in the 3D view. This was due to sharing a global G.moving
flag to indicate that transform is active, now it's only set per transform data
type so different editors don't influence each other.
Diffstat (limited to 'source/blender/editors/transform')
5 files changed, 22 insertions, 13 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 53ecfe3a685..d160e1562b0 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -604,6 +604,7 @@ int calc_manipulator_stats(const struct bContext *C); void createTransData(struct bContext *C, TransInfo *t); void sort_trans_data_dist(TransInfo *t); void special_aftertrans_update(struct bContext *C, TransInfo *t); +int special_transform_moving(TransInfo *t); void transform_autoik_update(TransInfo *t, short mode); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 81af26b0d05..44c2158bf74 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5701,6 +5701,21 @@ void special_aftertrans_update(bContext *C, TransInfo *t) #endif } +int special_transform_moving(TransInfo *t) +{ + if (t->spacetype == SPACE_SEQ) { + return G_TRANSFORM_SEQ; + } + else if (t->obedit || ((t->flag & T_POSE) && (t->poseobj))) { + return G_TRANSFORM_EDIT; + } + else if (t->flag & (T_OBJECT | T_TEXTURE)) { + return G_TRANSFORM_OBJ; + } + + return 0; +} + static void createTransObject(bContext *C, TransInfo *t) { TransData *td = NULL; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 7afced78746..666612880e5 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1047,12 +1047,6 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even Object *obedit = CTX_data_edit_object(C); PropertyRNA *prop; - /* moving: is shown in drawobject() (transform color) */ -// TRANSFORM_FIX_ME -// if (obedit || (t->flag & T_POSE) ) G.moving = G_TRANSFORM_EDIT; -// else if (G.f & G_PARTICLEEDIT) G.moving = G_TRANSFORM_PARTICLE; -// else G.moving = G_TRANSFORM_OBJ; - t->scene = sce; t->sa = sa; t->ar = ar; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index d1d40689a4a..8972229d618 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1592,7 +1592,6 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov /* ********************************************* */ /* main call, does calc centers & orientation too */ -/* uses global G.moving */ static int drawflags = 0xFFFF; // only for the calls below, belongs in scene...? void BIF_draw_manipulator(const bContext *C) @@ -1605,9 +1604,7 @@ void BIF_draw_manipulator(const bContext *C) int totsel; if (!(v3d->twflag & V3D_USE_MANIPULATOR)) return; -// if (G.moving && (G.moving & G_TRANSFORM_MANIP)==0) return; -// if (G.moving==0) { { v3d->twflag &= ~V3D_DRAW_MANIPULATOR; @@ -1654,11 +1651,13 @@ void BIF_draw_manipulator(const bContext *C) if (v3d->twtype & V3D_MANIP_ROTATE) { if (G.debug_value == 3) { - if (G.moving) draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL); - else draw_manipulator_rotate_cyl(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); + if (G.moving & (G_TRANSFORM_OBJ|G_TRANSFORM_EDIT)) + draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL); + else + draw_manipulator_rotate_cyl(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); } else - draw_manipulator_rotate(v3d, rv3d, 0 /* G.moving*/, drawflags, v3d->twtype); + draw_manipulator_rotate(v3d, rv3d, 0, drawflags, v3d->twtype); } if (v3d->twtype & V3D_MANIP_SCALE) { draw_manipulator_scale(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index c0adf065f57..eb204be3220 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -357,10 +357,10 @@ static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event) } retval = initTransform(C, t, op, event, mode); - G.moving = 1; /* store data */ if (retval) { + G.moving = special_transform_moving(t); op->customdata = t; } else { |