Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-25 02:41:37 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-25 02:41:37 +0400
commit28dd9c6a40859bf8d707b072174557d37240f162 (patch)
treec5436dcea18b4e70b1c363f84d1a52bf050a8a36 /source
parent02fbfa5c70732e691606546ecce60fdfe3f80d9f (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')
-rw-r--r--source/blender/blenkernel/BKE_global.h3
-rw-r--r--source/blender/blenkernel/intern/mball.c4
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c4
-rw-r--r--source/blender/editors/mesh/editmesh_inset.c4
-rw-r--r--source/blender/editors/space_image/space_image.c13
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c4
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/transform/transform.h1
-rw-r--r--source/blender/editors/transform/transform_conversions.c15
-rw-r--r--source/blender/editors/transform/transform_generics.c6
-rw-r--r--source/blender/editors/transform/transform_manipulator.c11
-rw-r--r--source/blender/editors/transform/transform_ops.c2
12 files changed, 36 insertions, 33 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 8a55d3e8a17..0699344a887 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -192,8 +192,7 @@ enum {
/* G.moving, signals drawing in (3d) window to denote transform */
#define G_TRANSFORM_OBJ 1
#define G_TRANSFORM_EDIT 2
-#define G_TRANSFORM_MANIP 4
-#define G_TRANSFORM_PARTICLE 8
+#define G_TRANSFORM_SEQ 4
/* G.special1 */
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 0546c85db67..d09490db235 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -2283,7 +2283,7 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
if (process.totelem == 0) return;
if ((G.is_rendering == FALSE) && (mb->flag == MB_UPDATE_NEVER)) return;
- if (G.moving && mb->flag == MB_UPDATE_FAST) return;
+ if ((G.moving & (G_TRANSFORM_OBJ|G_TRANSFORM_EDIT)) && mb->flag == MB_UPDATE_FAST) return;
process.thresh = mb->thresh;
@@ -2325,7 +2325,7 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
}
else {
width = mb->wiresize;
- if (G.moving && mb->flag == MB_UPDATE_HALFRES) width *= 2;
+ if ((G.moving & (G_TRANSFORM_OBJ|G_TRANSFORM_EDIT)) && mb->flag == MB_UPDATE_HALFRES) width *= 2;
}
/* nr_cubes is just for safety, minimum is totsize */
nr_cubes = (int)(0.5f + totsize / width);
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index ed55383e8a4..6033e7ee471 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -117,7 +117,7 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
opdata->mesh_backup = EDBM_redo_state_store(em);
opdata->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
- G.moving = true;
+ G.moving = G_TRANSFORM_EDIT;
opdata->twtype = v3d->twtype;
v3d->twtype = 0;
}
@@ -179,7 +179,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
v3d->twtype = opdata->twtype;
- G.moving = false;
+ G.moving = 0;
}
MEM_freeN(opdata);
op->customdata = NULL;
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index ef1767de3bd..dba19ee5da6 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -136,7 +136,7 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
opdata->mesh_backup = EDBM_redo_state_store(em);
opdata->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
- G.moving = true;
+ G.moving = G_TRANSFORM_EDIT;
opdata->twtype = v3d->twtype;
v3d->twtype = 0;
}
@@ -157,7 +157,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
v3d->twtype = opdata->twtype;
- G.moving = false;
+ G.moving = 0;
}
if (sa) {
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index fd57bf6101f..2b106e13836 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -376,15 +376,10 @@ static void image_refresh(const bContext *C, ScrArea *sa)
/* check if we have to set the image from the editmesh */
if (ima && (ima->source == IMA_SRC_VIEWER && sima->mode == SI_MODE_MASK)) {
- if (sima->lock == FALSE && G.moving) {
- /* pass */
- }
- else {
- if (scene->nodetree) {
- Mask *mask = ED_space_image_get_mask(sima);
- if (mask) {
- ED_node_composite_job(C, scene->nodetree, scene);
- }
+ if (scene->nodetree) {
+ Mask *mask = ED_space_image_get_mask(sima);
+ if (mask) {
+ ED_node_composite_job(C, scene->nodetree, scene);
}
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 20374e562e9..af4b4055156 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -403,7 +403,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla
glDisable(GL_BLEND);
}
- if (G.moving || (seq->flag & whichsel)) {
+ if ((G.moving & G_TRANSFORM_SEQ) || (seq->flag & whichsel)) {
const char col[4] = {255, 255, 255, 255};
if (direction == SEQ_LEFTHANDLE) {
BLI_snprintf(numstr, sizeof(numstr), "%d", seq->startdisp);
@@ -760,7 +760,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
}
get_seq_color3ubv(scene, seq, col);
- if (G.moving && (seq->flag & SELECT)) {
+ if ((G.moving & G_TRANSFORM_SEQ) && (seq->flag & SELECT)) {
if (seq->flag & SEQ_OVERLAP) {
col[0] = 255; col[1] = col[2] = 40;
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 63906c4d429..1ce8cf9082e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2685,7 +2685,7 @@ static void draw_em_measure_stats(ARegion *ar, View3D *v3d, Object *ob, BMEditMe
float grid = unit->system ? unit->scale_length : v3d->grid;
const bool do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0;
const bool do_global = (v3d->flag & V3D_GLOBAL_STATS) != 0;
- const bool do_moving = G.moving;
+ const bool do_moving = (G.moving & G_TRANSFORM_EDIT) != 0;
float clip_planes[4][4];
BMIter iter;
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 {