Page MenuHome

Cleanup: Use a separate function for mask smoothing
Needs ReviewPublic

Authored by Pablo Dobarro (pablodp606) on Aug 7 2020, 11:09 PM.

Details

Summary

Mesh and mask smoothing were combined into a single funciton and task
with a smooth_mask variable to control the data that functions should
modify. This comes from before 2.81, when the smooth brush had the
implementation of neighbor connecteivity for mesh, bmesh and multires,
in order to share all that code.

With the Sculpt API now is trivial to implement a smooth function, so it
makes sense to have separate functions to affect different data which can
be tweaked individually to create more advanced brushes.

Diff Detail

Repository
rB Blender
Branch
sculpt-smooth-mask-function (branched from master)
Build Status
Buildable 9452
Build 9452: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Aug 7 2020, 11:09 PM
Pablo Dobarro (pablodp606) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Aug 10 2020, 4:53 PM
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/sculpt_paint/sculpt_smooth.c
245–246
const float bstrength = clamp_f(ss->cache->bstrength, 0.0f, 1.0f);

Can apply this all places of sculpting.

And not only for bstrength, but in other usages of CLAMP as well.

248

https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Variable_Scope

Also unclear why to have explicit cast to int.

This revision now requires changes to proceed.Aug 10 2020, 4:53 PM
Pablo Dobarro (pablodp606) marked 2 inline comments as done.
  • Review update

Please go through the changed lines and replace remaining CLAMPz macro, and add const qualifier where applicable.