Global G.moving got nice define flags, and additional meaning.

- move object mode
- move editmode/pose mode
- move with widgets
This commit is contained in:
2005-03-19 20:27:13 +00:00
parent 0542e1ebe3
commit 35ab8a32a1
6 changed files with 12 additions and 6 deletions

View File

@@ -238,6 +238,11 @@ typedef struct Global {
#define L_ENDIAN 1
#define B_ENDIAN 0
/* 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
/* G.special1 */
/* Memory is allocated where? blender.c */

View File

@@ -33,7 +33,7 @@
#ifndef BIF_TRANSFORM_H
#define BIF_TRANSFORM_H
//#define NEWTRANSFORM 1
#define NEWTRANSFORM 1
/* ******************** Macros & Prototypes *********************** */

View File

@@ -4248,7 +4248,7 @@ void draw_object(Base *base)
if((G.f & G_PICKSEL) == 0) {
project_short(ob->obmat[3], &base->sx);
if(G.moving==1 && (base->flag & (SELECT+BA_PARSEL))) BIF_ThemeColor(TH_TRANSFORM);
if((G.moving & G_TRANSFORM_OBJ) && (base->flag & (SELECT+BA_PARSEL))) BIF_ThemeColor(TH_TRANSFORM);
else {
BIF_ThemeColor(TH_WIRE);

View File

@@ -1592,7 +1592,7 @@ void ManipulatorTransform(int mode)
initTransModeFlags(&Trans, mode); // modal settings in struct Trans
initTrans(&Trans); // internal data, mouse, vectors
G.moving |= G_TRANSFORM_MANIP; // signal to draw manipuls while transform
createTransData(&Trans); // make TransData structs from selection
if (Trans.total == 0)

View File

@@ -351,8 +351,8 @@ void initTrans (TransInfo *t)
{
/* moving: is shown in drawobject() (transform color) */
if(G.obedit) G.moving= 2;
else G.moving= 1;
if(G.obedit || G.obpose) G.moving= G_TRANSFORM_EDIT;
else G.moving= G_TRANSFORM_OBJ;
t->data = NULL;
t->ext = NULL;

View File

@@ -758,7 +758,8 @@ void BIF_draw_manipulator(ScrArea *sa)
float len1, len2, size, vec[3];
int totsel;
if(v3d->twflag & V3D_USE_MANIPULATOR); else return;
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;