Page MenuHome

Mask editor: add mask spline width slider
Needs ReviewPublic

Authored by Simon Lenz (Amudtogal) on Nov 22 2021, 5:30 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is part of an effort to make the Mask Editor more intuitive (https://developer.blender.org/T93097).
The idea to change line widths emerged from this discussion (https://developer.blender.org/D12776).

Click me, I am a GIF:

  • the line width of mask splines can be controlled using the slider in the overlay menu
  • splines from the active mask layer are 2pxl wider (it is much clearer which splines are being edited)
  • feather splines are not affected by the slider (default to 1pxl width)

I don't think this would be better suited for a theme, as the spline width needs more tweaking during work on masks.
Opening the preferences and adjusting it there everytime seems to be more work than benefit (what do you think?)...

Implementation:

  • adds a width parameter (range 1.-5.) that controls the GPU_line_width when drawing spline lines

TODO:

  • need to assign a default value of 1.f for the property

Diff Detail

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

Event Timeline

Simon Lenz (Amudtogal) requested review of this revision.Nov 22 2021, 5:30 PM
Simon Lenz (Amudtogal) created this revision.
Simon Lenz (Amudtogal) edited the summary of this revision. (Show Details)Nov 22 2021, 5:32 PM
Evan Wilson (EAW) added inline comments.
source/blender/editors/mask/mask_draw.c
451

Blender’s convention is 2.0 not 2.

I won’t go through and comment on each instance, but they all need to be changed. 😊

Adjust floats to Blender standard

@Evan Wilson (EAW) thank you for the review!

The versioning code is needed. Existing files are opened with with of 0.

Also suggest making this option for Color spline drawing only (which is implemented as part of another patch).

source/blender/editors/mask/mask_draw.c
433

Why active is extra thick?

525

No need to reset the value.

Simon Lenz (Amudtogal) marked 2 inline comments as done.

Here is the updated bit for the line width.

Also suggest making this option for Color spline drawing only (which is implemented as part of another patch).

I think this is a good idea, shall we keep the diff here for the moment, and I will merge it with the color outline, once that is accepted?

  • Merge branch 'master'
  • Remove GPU line width reset
  • Add DNA default for linewidth
  • Add default in versioning_300
  • Add default line width for versioning_defaults

Yeah, lets keep things simple and review/commit patches in proper order :)

I am still not really sure why extra 2px are needed for active spline. Seems too subtle if the goal was to make it visually clear what is active.