Fix T103520: Incorrect selection in paint mode operators

Read the selection attribute on the proper domain using implicit
interpolation rather than just using its oiginal domain that might
not match the domain of the color attribute.
This commit is contained in:
Hans Goudey 2022-12-29 10:58:47 -05:00
parent b6ca942e47
commit 31f2242691
Notes: blender-bot 2023-02-14 00:37:17 +01:00
Referenced by issue #103520, Regression: Using Bright/Contrast option on selected faces (paintmask) in Vertex Paint mode broken
1 changed files with 2 additions and 2 deletions

View File

@ -161,13 +161,13 @@ static IndexMask get_selected_indices(const Mesh &mesh,
if (mesh.editflag & ME_EDIT_PAINT_FACE_SEL) {
const VArray<bool> selection = attributes.lookup_or_default<bool>(
".select_poly", ATTR_DOMAIN_FACE, false);
".select_poly", domain, false);
return index_mask_ops::find_indices_from_virtual_array(
selection.index_range(), selection, 4096, indices);
}
if (mesh.editflag & ME_EDIT_PAINT_VERT_SEL) {
const VArray<bool> selection = attributes.lookup_or_default<bool>(
".select_vert", ATTR_DOMAIN_POINT, false);
".select_vert", domain, false);
return index_mask_ops::find_indices_from_virtual_array(
selection.index_range(), selection, 4096, indices);
}