Page MenuHome

T40167
ActivePublic

Authored by Bastien Montagne (mont29) on May 13 2014, 4:46 PM.
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index b88c388..be9c3cc 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -3881,10 +3881,7 @@ static void applyRotation(TransInfo *t, const int UNUSED(mval[2]))
applySnapping(t, &final);
- if (applyNumInput(&t->num, &final)) {
- /* Clamp between -PI and PI */
- final = angle_wrap_rad(final);
- }
+ applyNumInput(&t->num, &final);
if (hasNumInput(&t->num)) {
char c[NUM_STR_REP_LEN];
@@ -3902,10 +3899,23 @@ static void applyRotation(TransInfo *t, const int UNUSED(mval[2]))
ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size);
}
- t->values[0] = final;
-
- applyRotationValue(t, final, t->axis);
-
+ /* We have to split rotation in ~170° steps, bigger steps won't work well.
+ * This is not an issue with dragged-rotation, since it is called usually with much smaller steps.
+ * But when using numinput, without that user cannot get rotations > (-180, 180).
+ * See T40167.
+ */
+ {
+ const float sign = (final < 0) ? -1.0f : 1.0f;
+ const float step = DEG2RADF(170.0f) * sign;
+ float virtual_final;
+ for (virtual_final = t->values[0] + step; (final - virtual_final) * sign > 0.0f; virtual_final += step) {
+ t->values[0] = virtual_final;
+ applyRotationValue(t, virtual_final, t->axis);
+ }
+ t->values[0] = final;
+ applyRotationValue(t, final, t->axis);
+ }
+
recalcData(t);
ED_area_headerprint(t->sa, str);

Event Timeline

Bastien Montagne (mont29) changed the title of this paste from untitled to T40167.
Bastien Montagne (mont29) updated the paste's language from autodetect to diff.