Page MenuHome

Sculpt: Option to mask front faces only using Lasso and Box Mask
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Aug 2 2020, 11:44 PM.
Tags
None
Tokens
"Like" token, awarded by jorsh."Love" token, awarded by lopoIsaac."Love" token, awarded by 14AUDDIN."Love" token, awarded by julperado."Love" token, awarded by brilliant_ape."Love" token, awarded by andruxa696."Love" token, awarded by ckohl_art."100" token, awarded by Frozen_Death_Knight.

Details

Summary

This adds a property that checks the normals of each vertex against the
view direction to decide if they should be masked (similar to the
"Front Faces Only" option works for brushes.

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Aug 2 2020, 11:44 PM
Pablo Dobarro (pablodp606) created this revision.

It should probably be refactored into its own operator in a later patch as it is not really a selection

Why not to do it now, before the selection operator became this uber "select-or-fancy-mask-depending-on-settings" chimera?

Ok, I created a separate operator for box mask in D8456, then this can be implemented the same way for both.

Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)
  • Add support for box mask
Pablo Dobarro (pablodp606) retitled this revision from Sculpt: Option to mask front faces only using Lasso Mask to Sculpt: Option to mask front faces only using Lasso and Box Mask.Aug 5 2020, 12:00 AM
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)

Ok, this is now implemented for both box and lasso mask in the same way. The code of lasso and box mask is basically identical, so this Friday I can rewrite this operators to make them share the same code.

This is not what quality fridays are for. They are for solving existing technical debt, or to explore more ways of how we can help ourselves with technical solutions. They are not for solving technical debt of recently introduced code. Thew new code we add must be acceptable at a level of what we see a good outcome of code quality day.

I'm talking about the code duplication and cleanup of what is already in paint_mask.c, which is what I was planning to do. If this is added now, it can be part of the refactor, otherwise I can do another patch with the same functionality after the refactor.

Well, solving duplication and improving existing code when working on a new features in the surrounding areas is the natural course of development.
Anyway, point is: such refactors and general house keeping shall not be limited to the quality day.

From moving forward, is indeed easier to apply this patch and do required house keeping right after this.

source/blender/editors/sculpt_paint/paint_mask.c
279

Swap the terms, helps with lazy evaluation.

source/blender/editors/sculpt_paint/paint_mask.c
279

short-circuit evaluation, not lazy evaluation.

Pablo Dobarro (pablodp606) marked 2 inline comments as done.
Pablo Dobarro (pablodp606) edited the summary of this revision. (Show Details)
  • Review update
This revision is now accepted and ready to land.Aug 10 2020, 5:13 PM