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>2008-06-23 00:40:13 +0400
committerMartin Poirier <theeth@yahoo.com>2008-06-23 00:40:13 +0400
commitdac3434b03976b101435572559ebba7a6d1fc862 (patch)
tree0ebba53854eb0d3d4ed4b75b48372f80fe8dad64 /source/blender/src
parentabda1a9ec17d830396c72d1dccd799509cebaa80 (diff)
[#14398] In Object- and EditMode, global rotate manual input is different than mouse
The sign of the rotation angle was sometimes different between num input and mouse input.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/transform.c8
-rw-r--r--source/blender/src/transform_constraints.c19
-rw-r--r--source/blender/src/transform_snap.c2
3 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c
index 4270ce6a069..705a5f868e7 100644
--- a/source/blender/src/transform.c
+++ b/source/blender/src/transform.c
@@ -2621,7 +2621,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3])
continue;
if (t->con.applyRot) {
- t->con.applyRot(t, td, axis);
+ t->con.applyRot(t, td, axis, NULL);
VecRotToMat3(axis, angle * td->factor, mat);
}
else if (t->flag & T_PROP_EDIT) {
@@ -2654,7 +2654,7 @@ int Rotation(TransInfo *t, short mval[2])
snapGrid(t, &final);
if (t->con.applyRot) {
- t->con.applyRot(t, NULL, axis);
+ t->con.applyRot(t, NULL, axis, &final);
}
applySnapping(t, &final);
@@ -3314,7 +3314,7 @@ int PushPull(TransInfo *t, short mval[2])
}
if (t->con.applyRot && t->con.mode & CON_APPLY) {
- t->con.applyRot(t, NULL, axis);
+ t->con.applyRot(t, NULL, axis, NULL);
}
for(i = 0 ; i < t->total; i++, td++) {
@@ -3326,7 +3326,7 @@ int PushPull(TransInfo *t, short mval[2])
VecSubf(vec, t->center, td->center);
if (t->con.applyRot && t->con.mode & CON_APPLY) {
- t->con.applyRot(t, td, axis);
+ t->con.applyRot(t, td, axis, NULL);
if (isLockConstraint(t)) {
float dvec[3];
Projf(dvec, vec, axis);
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c
index 2d01c2303fc..796b013cb88 100644
--- a/source/blender/src/transform_constraints.c
+++ b/source/blender/src/transform_constraints.c
@@ -393,7 +393,7 @@ static void applyObjectConstraintSize(TransInfo *t, TransData *td, float smat[3]
* (ie: not doing counterclockwise rotations when the mouse moves clockwise).
*/
-static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3])
+static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3], float *angle)
{
if (!td && t->con.mode & CON_APPLY) {
int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
@@ -413,9 +413,9 @@ static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3])
break;
}
/* don't flip axis if asked to or if num input */
- if (!(mode & CON_NOFLIP) && hasNumInput(&t->num) == 0) {
+ if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) {
if (Inpf(vec, t->viewinv[2]) > 0.0f) {
- VecMulf(vec, -1.0f);
+ *angle = -(*angle);
}
}
}
@@ -435,10 +435,15 @@ static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3])
* (ie: not doing counterclockwise rotations when the mouse moves clockwise).
*/
-static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3])
+static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3], float *angle)
{
- if (td && t->con.mode & CON_APPLY) {
+ if (t->con.mode & CON_APPLY) {
int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
+
+ /* on setup call, use first object */
+ if (td == NULL) {
+ td= t->data;
+ }
switch(mode) {
case CON_AXIS0:
@@ -454,9 +459,9 @@ static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3])
VECCOPY(vec, td->axismtx[2]);
break;
}
- if (!(mode & CON_NOFLIP)) {
+ if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) {
if (Inpf(vec, t->viewinv[2]) > 0.0f) {
- VecMulf(vec, -1.0f);
+ *angle = -(*angle);
}
}
}
diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c
index 295cfa4574c..04ca5b08755 100644
--- a/source/blender/src/transform_snap.c
+++ b/source/blender/src/transform_snap.c
@@ -412,7 +412,7 @@ float RotationBetween(TransInfo *t, float p1[3], float p2[3])
if (t->con.applyRot != NULL && (t->con.mode & CON_APPLY)) {
float axis[3], tmp[3];
- t->con.applyRot(t, NULL, axis);
+ t->con.applyRot(t, NULL, axis, NULL);
Projf(tmp, end, axis);
VecSubf(end, end, tmp);