mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #156993: Mask from Cavity creates inverted mask
When calculating the mask values, calculate the relative `factor` of the automask for a given vertex and apply that as the value of the .sculpt_mask. This is incorrect, as the `factor` is inversely related to the mask value (i.e. a mask value of 1.0 corresponds to a factor value of 0.0). This was already fixed for creating a mask from boundary elements, to extend the fix, simply remove the ability to specify whether the mask should be based on the inverted factor or not in `apply_mask_from_settings`, and always assume that it should be. Pull Request: https://projects.blender.org/blender/blender/pulls/157021
This commit is contained in:
parent
c0b9d89101
commit
be36644bfe
2 changed files with 14 additions and 34 deletions
|
|
@ -221,11 +221,11 @@ class MaskFromCavityTest(unittest.TestCase):
|
|||
if position_data[i][2] < 0.0:
|
||||
self.assertEqual(
|
||||
mask_data[i],
|
||||
1.0,
|
||||
f"Vertex {i} should be fully masked ({position_data[i]}) -> {mask_data[i]}")
|
||||
0.0,
|
||||
f"Vertex {i} should not be masked ({position_data[i]}) -> {mask_data[i]}")
|
||||
else:
|
||||
self.assertNotEqual(mask_data[i], 1.0,
|
||||
f"Vertex {i} should not be fully masked ({position_data[i]}) -> {mask_data[i]}")
|
||||
self.assertNotEqual(mask_data[i], 0.0,
|
||||
f"Vertex {i} should be masked ({position_data[i]}) -> {mask_data[i]}")
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue