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
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-03-19 15:17:06 +0300
committerTon Roosendaal <ton@blender.org>2005-03-19 15:17:06 +0300
commita2ed880c9ff659f7dd488076da3104beac728d4d (patch)
tree47a6edca99c0bdf9e8387862141f9d11554003cd /source/blender/src/space.c
parenta96ed881dc04d0a2ce6ab742f7682042e466b0a7 (diff)
Transform widgets; Scale and Rotate versions
To use; press the (temporal) icon in header. Switching widget types is by pressing G, R or S once, if current widget type is different it switches, otherwise it goes to normal Transform(). Widgets need a bit test for picking accuracy, correct drawing etc. The rotate widget has a center button for 'trackball' rotate. That latter can also be used for hotkey-based rotate. In current code, all widgets remain in "Global" space, also in editmode. Also widget updates while using normal transform has to be done. 2 Bugfixes: - rotate in PoseMode had error for 2d 'around' center - transform in postemode could crash, due to typo (& or |)
Diffstat (limited to 'source/blender/src/space.c')
-rw-r--r--source/blender/src/space.c65
1 files changed, 55 insertions, 10 deletions
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index b7ed74a0213..70027f34f15 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -720,7 +720,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
unsigned short event= evt->event;
short val= evt->val;
char ascii= evt->ascii;
- View3D *v3d= curarea->spacedata.first;
+ View3D *v3d= sa->spacedata.first;
Object *ob;
float *curs;
int doredraw= 0, pupval;
@@ -1220,12 +1220,20 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if(okee("Clear location")) {
clear_object('g');
}
- } else if((G.qual==0))
+ } else if((G.qual==0)) {
+ if(v3d->twflag & V3D_USE_MANIPULATOR) {
+ if((v3d->twtype & V3D_MANIPULATOR_TRANSLATE)==0) {
+ v3d->twtype= V3D_MANIPULATOR_TRANSLATE;
+ doredraw= 1;
+ break;
+ }
+ }
#ifdef NEWTRANSFORM
Transform(TFM_TRANSLATION);
#else
transform('g');
#endif
+ }
break;
case HKEY:
if(G.obedit) {
@@ -1485,19 +1493,35 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (G.obedit->type==OB_MESH)
loopoperations(LOOP_CUT);
}
- else if((G.qual==0))
+ else if((G.qual==0)) {
+ if(v3d->twflag & V3D_USE_MANIPULATOR) {
+ if((v3d->twtype & V3D_MANIPULATOR_ROTATE)==0) {
+ v3d->twtype= V3D_MANIPULATOR_ROTATE;
+ doredraw= 1;
+ break;
+ }
+ }
#ifdef NEWTRANSFORM
Transform(TFM_ROTATION);
#else
transform('r');
#endif
+ }
}
- else if((G.qual==0))
+ else if((G.qual==0)) {
+ if(v3d->twflag & V3D_USE_MANIPULATOR) {
+ if((v3d->twtype & V3D_MANIPULATOR_ROTATE)==0) {
+ v3d->twtype= V3D_MANIPULATOR_ROTATE;
+ doredraw= 1;
+ break;
+ }
+ }
#ifdef NEWTRANSFORM
Transform(TFM_ROTATION);
#else
transform('r');
#endif
+ }
break;
case SKEY:
if(G.obedit) {
@@ -1517,14 +1541,25 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
#endif
else if(G.qual==LR_SHIFTKEY)
snapmenu();
- else if(G.qual==0)
+ else if(G.qual==0) {
+ if(v3d->twflag & V3D_USE_MANIPULATOR) {
+ if((v3d->twtype & V3D_MANIPULATOR_SCALE)==0) {
+ v3d->twtype= V3D_MANIPULATOR_SCALE;
+ doredraw= 1;
+ break;
+ }
+ }
#ifdef NEWTRANSFORM
Transform(TFM_RESIZE);
- else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY))
- Transform(TFM_TOSPHERE);
#else
transform('s');
#endif
+ }
+ else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY))
+#ifdef NEWTRANSFORM
+ Transform(TFM_TOSPHERE);
+#endif
+
}
else if(G.qual==LR_ALTKEY) {
if(okee("Clear size")) {
@@ -1534,15 +1569,25 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else if(G.qual==LR_SHIFTKEY) {
snapmenu();
}
- else if((G.qual==0))
+ else if((G.qual==0)) {
+ if(v3d->twflag & V3D_USE_MANIPULATOR) {
+ if((v3d->twtype & V3D_MANIPULATOR_SCALE)==0) {
+ v3d->twtype= V3D_MANIPULATOR_SCALE;
+ doredraw= 1;
+ break;
+ }
+ }
#ifdef NEWTRANSFORM
Transform(TFM_RESIZE);
+#else
+ transform('s');
+#endif
+ }
+#ifdef NEWTRANSFORM
else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY))
Transform(TFM_TOSPHERE);
else if(G.qual==(LR_CTRLKEY|LR_ALTKEY))
Transform(TFM_SHEAR);
-#else
- transform('s');
#endif
break;
case TKEY: