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:
authorMartin Poirier <theeth@yahoo.com>2005-04-01 02:18:08 +0400
committerMartin Poirier <theeth@yahoo.com>2005-04-01 02:18:08 +0400
commit4db0cbc74151e78bb59a02b094fee7677705aa30 (patch)
tree8dce1cd3de37cb70676cbb5965276c7169d0a842 /source/blender/src/transform.c
parent7532aa248f86571dc456f6247c507f110c4388b0 (diff)
Push/Pull (aka: non proportionnal resize, original idea by Robert Tiess) slipped in my last commit a bit, so might as well finish it.
Accesible with Shift-P (was free), the behavior is much like Shrink/Fatten. Pull mouse toward you to pull toward center, push away to push away. Constraint and PET works with it too, of course.
Diffstat (limited to 'source/blender/src/transform.c')
-rwxr-xr-xsource/blender/src/transform.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c
index 4ba9c8afe58..b7daa7cc49c 100755
--- a/source/blender/src/transform.c
+++ b/source/blender/src/transform.c
@@ -1556,6 +1556,9 @@ void Transform(int mode, int context)
case TFM_TRACKBALL:
initTrackball(&Trans);
break;
+ case TFM_PUSHPULL:
+ initPushPull(&Trans);
+ break;
}
initConstraint(&Trans);
@@ -3091,14 +3094,14 @@ void initPushPull(TransInfo *t)
t->snap[0] = 0.0f;
t->snap[1] = 1.0f;
t->snap[2] = t->snap[1] * 0.1f;
- t->transform = ShrinkFatten;
+ t->transform = PushPull;
}
int PushPull(TransInfo *t, short mval[2])
{
- float vec[3];
+ float vec[3], axis[3];
float distance;
int i;
char str[50];
@@ -3125,6 +3128,9 @@ int PushPull(TransInfo *t, short mval[2])
sprintf(str, "Push/Pull: %.4f%s %s", distance, t->con.text, t->proptext);
}
+ if (t->con.applyRot) {
+ t->con.applyRot(t, NULL, axis);
+ }
for(i = 0 ; i < t->total; i++, td++) {
if (td->flag & TD_NOACTION)
@@ -3132,7 +3138,6 @@ int PushPull(TransInfo *t, short mval[2])
VecSubf(vec, t->center, td->center);
if (t->con.applyRot) {
- float axis[3];
t->con.applyRot(t, td, axis);
Projf(vec, vec, axis);
}