Page MenuHome

GPencil: Add initial bezier smoothing option
Changes PlannedPublic

Authored by Falk David (filedescriptor) on Nov 14 2020, 3:56 PM.

Details

Reviewers
None
Group Reviewers
Grease Pencil
Summary

This patch adds initial support for bezier smoothing. This is a work in progress.

We basically just fit the drawn stroke to a curve in the post processing step. The fitting threshold can be adjusted using the smooth factor.

Diff Detail

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

Event Timeline

Falk David (filedescriptor) requested review of this revision.Nov 14 2020, 3:56 PM
Antonio Vazquez (antoniov) added inline comments.
source/blender/editors/gpencil/gpencil_paint.c
1207

Maybe is better move both elements of the if/else to two static functions to keep more clear.

if Bezier
  do bezier_func
else
 do_other_func
source/blender/makesrna/intern/rna_brush.c
1858

Always use Uppercase: Bezier Smoothing. Not sure we need "Use"

@Matias Mendiola (mendio) Maybe it is better use an Enum with the smooth types instead to put a checkbox. Something like "Stroke and Bezier"

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/makesrna/intern/rna_brush.c
1858

Currently the . is added automatically to the end of the description, so don't bother with that.

Also, here is a different wording that I'd suggest (just a bit more actively phrased):
"Uses bezier curve fitting as a smoothing step." -> "Fit the stroke to a bezier curve as a smoothing step"

I would like to drop the "Bezier" in the UI altogether (really, it should be "Bézier"). I think for the user "Curve Smoothing" would be better. What do you think? Also I like the idea of choosing the option from a drop down (though I would not be sure on how to call the default smoothing? maybe just "Default Smoothing"?). This way we can also expose different options for the two methods (the curve smoothing needs some other options that are hardcoded now).

I have tried it and it works very well, only two things to improve it IMO:

  1. Using a dropdown is right, but I wouldn't use "Default" because it is not descriptive, rather I would use something like "Smooth type: Simple / Bezier"
  2. The smooth value needed to get a similar final line result differ a lot between both methods. The bezier method needs very small values (0.05 vs 0.50). I would try to get similar final line precision with similar values in both methods.
Falk David (filedescriptor) planned changes to this revision.Apr 16 2021, 4:17 PM

Planning changes, because this will most likely be implemented differently with the new stroke type (T85754).