Page MenuHome

Unexpected rotation value when using keyboard shortcuts
Closed, InvalidPublic


System Information
Windows 7, NVidia Quadro K620
The problem does not seem to be system dependent.

Blender Version
Broken: 2.79 5bd8ac9
Also broken: 2.80 Alpha 2 ae87adc73a2 (1.11.2018)

Short description of error
When setting rotation with keyboard shortcuts in specific way, the rotation value is different than expected.
Rotation value of +195 is 195. +196 is -164. +270 is -90. +360 is approximately 0 (e.g. 0.00001).

Even if this is intentional, it seems inconsistent.

Exact steps for others to reproduce the error

It seems to work with all types of rotation, with or without axis constraints, but it is easiest to check by using axis constraints.

  1. Open the N-panel / Sidebar, or Object tab in the Properties editor, so that Transform values are visible.
  1. Select any object, such as a cube.
  1. Rotate it by using the Rotation hotkeys, and set the value by writing the rotation amount as a number. For example: R, X, write "360", Enter.
  1. The problem:

The X rotation property in the Transform will not be 360, but 0.
If the number is "270" instead, the rotation will be -90.

The expected value is 360 for "360", and 270 for "270".

Additional information:
If you start the same command with R, X, and then use the mouse to set the rotation amount to 360, the X rotation value will be 360.
When viewing the Last Operator panel, there will be no visible difference between the two ways to set the rotation amount to 360. If the degree amount was set by writing a number on the keyboard, the result is different that if it was set by mouse movement.

If the object is rotated with the Rotate tool / manipulator, and the amount is set by writing "360", the value will be approximately 0.
If the rotate tool's value is set by using mouse, the value will be 360.

Writing any value 196 or larger, or -196 or smaller, will be affected.
195 will give result of 195.
195.99 will give result of (approximately) 196.
196 will give result of -164.
270 will give result of -90.
N seems to give result of - (360-N), when 196 <= N <= 360
360 will give result of 0.00001 (or other number that is approximately 0)
361 will give result of 1

Every full circle will be negated, e.g. 720 will give result of 0.

-195 will give result of -195
-196 will give result of +164
-361 will give result of -1


The steps can be reproduced with the default scene and the default cube.

PNG image of problem (in 2.79)

GIF demonstration of problem (in 2.8). First, the expected result: when using mouse, rotation of 360 gives a result of 360). Then, the result caused by the bug: when writing the angle by using the keyboard, 360 gives a result of approximately 0.



Event Timeline

Campbell Barton (campbellbarton) closed this task as Invalid.

This isn't a bug (it's been reported before).

Transform just ensures the final result represents the rotation correctly, not that the euler/axis-angle matches the number of turns made.