Page MenuHome

UI gizmo dial: Draw arc only over one rotation to avoid visual artifacts
AbandonedPublic

Authored by David Friedli (hlorus) on Jan 16 2020, 5:56 PM.

Details

Summary

Currently when using the spin gizmo for a rotation greater than 360 degrees there can be some visual artifacts. This patch avoids this by drawing the arc over the span of one rotation only and adjusting the background color based on the rotation count.

before:

after:

Diff Detail

Repository
rB Blender
Branch
gizmo_dial3d_glitch (branched from master)
Build Status
Buildable 6297
Build 6297: arc lint + arc unit

Event Timeline

Julian Eisel (Severin) requested changes to this revision.EditedJan 16 2020, 7:24 PM

Almost ready! Great find.

I did notice one small issue though, it's pretty weird: When you drag towards the blue (or red or green) circle, as opposed to dragging away from it, there is a flickering after the first full rotation:

If we don't find the cause of this we can probably still accept the patch - it's a minor issue. Would still be nice have fixed though.

Would also be good to add a comment to the code explaining what you are doing, it's not easy to understand just from the code.

This revision now requires changes to proceed.Jan 16 2020, 7:24 PM

-Address mentioned issue
-Add some comments
-Rebase

@Julian Eisel (Severin) Thanks alot for the review!

Almost ready! Great find.

I did notice one small issue though, it's pretty weird: When you drag towards the blue (or red or green) circle, as opposed to dragging away from it, there is a flickering after the first full rotation:

The remaining arc wasn't correctly calculated for the negative range which caused the arcs to overlap, that's why there were some color differences.
Unfortunately the fix doesn't make it simpler either, i hope the comments help enough.

Looks good to me.

Great to hear! Could you also commit for me, i don't yet have commit rights...

Campbell Barton (campbellbarton) abandoned this revision.EditedJan 17 2020, 5:10 PM

Committed rBf417787ee116f25889f853a98319d4e351edb3b5 with minor changes.

  • Assign a variable for PI*2
  • Pass const color (since it's often undesirable for functions to modify the colors args they take).