Page MenuHome

GPencil: New operator to Normalize strokes
ClosedPublic

Authored by Antonio Vazquez (antoniov) on Jun 1 2021, 8:21 PM.

Details

Summary

Sometimes is required to reset the thickness or the opacity of the strokes. Actually this was done using a modifier, but this operators solves this.

Diff Detail

Repository
rB Blender
Branch
temp-gpencil-normalize (branched from master)
Build Status
Buildable 14899
Build 14899: arc lint + arc unit

Event Timeline

Antonio Vazquez (antoniov) requested review of this revision.Jun 1 2021, 8:21 PM
Antonio Vazquez (antoniov) created this revision.
  • GPencil: Update Bezier mode
This revision is now accepted and ready to land.Jun 1 2021, 9:02 PM
Falk David (filedescriptor) requested changes to this revision.Jun 2 2021, 4:11 PM

Just a few comments for code readability and clarity

source/blender/editors/gpencil/gpencil_edit.c
5392

Because we are checking against the value of an enum here, I would rather use the explicit else if (mode == GP_NORMALIZE_OPACITY) or use a switch statement. Just so that we know what mode is used when the current else part is run. Makes the code more readable :)

5434

Would rather use and early continue here so that the rest is not indented.

5491

Maybe it's just me, but I would be a bit more explicit with the tooltips. I don't know what "Normalize Thickness" or "Normalize Opacity" means.

This revision now requires changes to proceed.Jun 2 2021, 4:11 PM
  • Update code after first review
source/blender/editors/gpencil/gpencil_edit.c
5495–5503

I'd suggest for the tooltip:

"Normalizes the stroke thickness by making all points use the same thickness value"

"Normalizes the stroke opacity by making all points use the same opacity value"

Small English grammar nitpicks, otherwise LGTM 👍

source/blender/editors/gpencil/gpencil_edit.c
5498
5503
This revision is now accepted and ready to land.Jun 2 2021, 4:37 PM
Antonio Vazquez (antoniov) marked 5 inline comments as done.Jun 2 2021, 4:38 PM
This revision was automatically updated to reflect the committed changes.
Antonio Vazquez (antoniov) marked an inline comment as done.