Page MenuHome

Paint: Use float for brush size
AbandonedPublic

Authored by Pablo Dobarro (pablodp606) on Nov 7 2019, 6:03 PM.

Details

Summary

This is the correct fix for T71403
This way, you can use brushes with a diameter of 1px or smaller. This
allows painting only one pixel at the same time while keeping the AA and
mask generation code correct. The AA code supports lines smaller than
one pixel, so you can also draw very thin lines.

I don't know if this has other implications in other areas of Blender.
This patch works in 2D texture paint and Sculpt Mode, but I'm not sure
if doing this is compatible with previously saved brushes or if it is
breaking things in other areas of the code.

Diff Detail

Repository
rB Blender
Branch
float-brush-size (branched from master)
Build Status
Buildable 5610
Build 5610: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Nov 21 2019, 3:10 PM

Blender converts floats/ints as needed on file load, see: cast_elem on dna_genfile.c.

Will this vital fix ever be commited, so that low poly artist can use Blender again?

Can this be commited befor Bcon3 ? because T71403 is not considered a bug.
The behaviour has changed and single pixel drawing is not possible.

Will this vital fix ever be commited, so that low poly artist can use Blender again?

I found that disabling anti-aliasing and setting a custom falloff (perfectly vertical at the 0.5 point) allows me to draw pixels. There are still a few half-filled pixels though.

@Pablo Dobarro (pablodp606)
I see this is still tagged as Blender 2.82.
What are the chances that this is going to make it into 2.83 at least?

dupoxy (dupoxy) awarded a token.

Did a quick test today and the radius seem to change when hovering a menu in paint mode

The grease pencil edit mode radius tool does not work if the radius of the stroke is less then one


The grease pencil sculpt mode thickness tool does not work if the radius of the stroke is less then one

Did this get solved?
Will we be able to paint 1px again?
And why not use "size", like all other standard tools out there instead of diameter?

I made this patch without thinking too much in the implications, but this can break a lot of things in multiple areas of the code for other modules and it is only a hack. This patch should be part of a bigger project involving the following steps:

  • Change the brush radius of all brushes to diameter and implement it as a float property.
  • Implement a "pen" tool in 2D texture paint mode, which selects and paints full pixels without any kind of falloff, textures or antialiasing.

The fact that painting pixels was possible before was because of a bug. When creating a brush with the diameter of 2 the code was initialising the brush tip to a 1x1 pixel size, clipping its falloff.