This tool generates masks based on the sculpt vertex colors by clicking
on the model, similar to automatic selection tools in image editing
software.
Details
- Reviewers
Sergey Sharybin (sergey) - Commits
- rBc5ec8d91bd12: Sculpt: Mask By Color
Diff Detail
- Repository
- rB Blender
- Branch
- sculpt-mask-by-color (branched from master)
- Build Status
Buildable 8767 Build 8767: arc lint + arc unit
Event Timeline
| source/blender/editors/sculpt_paint/sculpt.c | ||
|---|---|---|
| 8148–8149 | I'm not quite sure where M_SQRT3 and why you divide by threshold rather than comparing to it. This isn't how threshold work. Either its logical error in the code, or the code needs explanation and better naming choice. | |
| 8154–8156 | Don't use else after return. https://clang.llvm.org/extra/clang-tidy/checks/readability-else-after-return.html | |
| 8168–8174 | Same as above. | |
@Sergey Sharybin (sergey) I reworked the threshold function in a way that is more similar to image editing programs with lasso selections. To me it would make more sense to have a function that produces the larger falloff possible across the color instead of a fixed falloff defined by the slope while keeping the same behavior (threshold of 0 selects only the same color, 1 selects the entire image). I was trying something like this, which produces a much bigger falloff when the threshold is 0.5, but I'm not sure how it will work in practice. I can take a look at this again in a later patch.
It's ok to use fall-off function, but you need to put information about reasoning and general idea as a comment in the code.