Page MenuHome

Fix for 3D view transform: flipped rotation direction for numeric input
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Feb 4 2021, 2:34 AM.

Details

Summary

The rotation direction was flipped recently.

This meant that rotation on a single axis gave negative results compared
with previous Blender releases.

This partially reverts a9b53daf23ba8b6cb4c930e06154ffd35522b00d.


The test test_undo.view3d_sculpt_dyntopo_simple is currently broken, I bisected the break back to rBa9b53daf23ba: Fix T83092: Direction of rotation with View orientation changed in 2.91 which reverses the rotation direction. I have double checked that T83092 doesn't break after this commit, submitting for review to make sure this isn't exposing some other issue. Although from my tests it's working.

To run the test this fixes:

python ../lib/tests/ui_simulate/run.py --blender='./blender.bin --tests "test_undo.view3d_sculpt_dyntopo_simple"

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Feb 4 2021, 2:34 AM
Campbell Barton (campbellbarton) retitled this revision from Fix test_undo.view3d_sculpt_dyntopo_simple test to Fix flipped rotation direction for numeric input.Feb 4 2021, 2:48 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) retitled this revision from Fix flipped rotation direction for numeric input to Fix for 3D view transform: flipped rotation direction for numeric input.Feb 4 2021, 3:00 AM

The chosen direction of the patch looks good, but this brings a conflict in the Redo Panel of the Rotation operation without constraint.
With this patch, the View Z's rotation axis with constraint has reversed direction compared to without constraint.
And, during Redo, the Z axis is set as constrained (see initTransInfo).
So the angle when redoing makes the movement "negative".
One solution would be to delete the line constraint_axis[t->orient_axis] = true;

Another problem is during the modal with View orientation:
If you switch to constraint Z during this operation, the angle is inverted (and the object is only readjusted after moving the mouse).
(But I suspect that this other problem happened in previous versions too).

I can take a look at this tomorrow.

  • Fix error when changing the values in the redo panel.

The second error mentioned (inverted rotation when setting the Z constraint in the View orientation)
is seen in blender 2.79 too, so it doesn't have that much priority.

If it is to resolve this as well, perhaps the ideal solution is to update test_undo.view3d_sculpt_dyntopo_simple.

This revision is now accepted and ready to land.Feb 4 2021, 1:56 PM