Page MenuHome

UI: Add node roundness parameter to the theme
Needs ReviewPublic

Authored by Alessio Monti di Sopra (a.monti) on Thu, Oct 3, 1:20 PM.

Details

Summary

The patch adds a new parameter in the node editor section of the theme to control the amount of roundness used in drawing the nodes rects.

I have noticed a problem in the corners drawing when the roundness is next to 0 though, it's almost invisible with a dark background, but it's more noticeable with a bright one:

I found out that it is caused in the function the draws the shadows, by this (I guess antialiasing) function:


Is this expected or it's a problem with my gpu driver?
And if it is expected would it be ok to"solve" it by disabling the AA if the roundness is equal to zero?

Diff Detail

Event Timeline

Is there a specific reason this setting is needed? I'd rather not add customization for every detail just because we can.

Is there a specific reason this setting is needed? I'd rather not add customization for every detail just because we can.

Purely aesthetic to be honest; the nodes are one the very few interface elements of which one can't modify the roundness at the moment, but they are used a lot in Blender, and they will be used even more in the future.
It simply feels wrong to have, for example, a theme with almost square nodes but with everything else completely round, even the elements inside the node itself.

Compare these two for example:


In my opinion it would allow the themes to be a lot more consistent.

It certainly looks nice, I'm a bit of a fan of the 1.0 roundness - would be great in the XSI themes.

About those funny corners when radius is near zero. To make the rounded corners look nice, roundedbox_aa() draws the shape 8 times with a jitter, each time at 1/8 of the target opacity. These passes never add up to full opacity and will show some odd overlapping at the corners. Best to just change to regular rectangle drawing at that point. You don’t need aa since corners are sharp, so drawn in one pass. The shape will be fully opaque, so the color will exactly match what you specify. And the horizontal and vertical parts should always be crisp. In short, only use roundbox_aa if the box is rounded.

Brecht Van Lommel (brecht) requested changes to this revision.Fri, Oct 4, 5:04 PM

Ok, this is fine if the issues with sharp corners is fixed.

This revision now requires changes to proceed.Fri, Oct 4, 5:04 PM

After some tries, the best way I found to remove the overlapping at the corners was to make the outline fully opaque instead of semi-transparent, exposing the color in the theme.

Diff changes:

  • made the outer outline opaque
  • added a node_outline parameter in theme, setted both for Blender Dark and Blender Light
  • slightly adjusted the frame background color of Blender Dark, for better contrast

Another solution I did try was to disable anti-aliasing under a certain roundness value, but there were still cases in which the overlapping persisted, and the change in draw method was noticeable while changing the values with bright themes.

  • Updated userdef_default_theme.c using the proper python script
  • Reverted frames color to the previous one