Page MenuHome

Fix T67067: Wrong rotation input values when using shortcuts on keyboard like rx720

Authored by Bastien Montagne (mont29) on Jul 18 2019, 3:40 PM.



This allows to type in numinput 720 and indeed get a rotation of 720°, not 0°...

This patch has been painful to come with... It basically applies 'big rotations' in steps < 180°, such that compatible rotation works as expected. This implies resetting current rotation to initial one first, otherwise we'd end up applying much more turns than expected when that code is called more than once.

It also makes things somewhat slower for big rotations (millions of degrees), maybe we should add a safeguard?

And since that's a case that cannot happen with regular tool/widget-driven rotation, it's only enabled when numinput is used for now.

Diff Detail

rB Blender
arcpatch-D5289 (branched from master)
Build Status
Buildable 4138
Build 4138: arc lint + arc unit

Event Timeline

Bastien Montagne (mont29) added inline comments.

debug print, please ignore :)

It might be good to guard against high values, which could be very slow (or never finish to due rounding errors).

angle = fmodf(angle, 360.0f * 10)
Bastien Montagne (mont29) updated this revision to Diff 16551.
  • Clamp 'large' rotations to about 1000 turns.