Fix: Sculpt: Incorrect undo behavior with modifiers and new brush code
The new brushes don't update `SculptSession::orig_cos` (which is good, it's not necessary since it's just a copy of the active shape key data or the original mesh's vertex positions). To fix the problem with the undo system, access those two arrays directly instead. Once all the uses of the "proxy" system are removed, `orig_cos` can be removed too. Pull Request: https://projects.blender.org/blender/blender/pulls/123922
This commit is contained in:
@@ -1232,9 +1232,13 @@ static void store_coords(const Object &object, Node &unode)
|
||||
unode.vert_indices.as_span(),
|
||||
unode.normal.as_mutable_span());
|
||||
if (ss.deform_modifiers_active) {
|
||||
array_utils::gather(ss.orig_cos.as_span(),
|
||||
unode.vert_indices.as_span(),
|
||||
unode.orig_position.as_mutable_span());
|
||||
const Mesh &mesh = *static_cast<const Mesh *>(object.data);
|
||||
const Span<float3> orig_positions = ss.shapekey_active ? Span(static_cast<const float3 *>(
|
||||
ss.shapekey_active->data),
|
||||
mesh.verts_num) :
|
||||
mesh.vert_positions();
|
||||
array_utils::gather(
|
||||
orig_positions, unode.vert_indices.as_span(), unode.orig_position.as_mutable_span());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user