Fix: Assert when undoing sculpt deformation
Pull Request: https://projects.blender.org/blender/blender/pulls/130477
This commit is contained in:
parent
eeeac09241
commit
54c0699413
@ -358,7 +358,8 @@ static void restore_position_mesh(Object &object,
|
|||||||
/* When original positions aren't written separately in the the undo step, there are no
|
/* When original positions aren't written separately in the the undo step, there are no
|
||||||
* deform modifiers. Therefore the original and evaluated deform positions will be the
|
* deform modifiers. Therefore the original and evaluated deform positions will be the
|
||||||
* same, and modifying the positions from the original mesh is enough. */
|
* same, and modifying the positions from the original mesh is enough. */
|
||||||
swap_indexed_data(unode.position.as_mutable_span(), verts, positions);
|
swap_indexed_data(
|
||||||
|
unode.position.as_mutable_span().take_front(unode.unique_verts_num), verts, positions);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* When original positions are stored in the undo step, undo/redo will cause a reevaluation
|
/* When original positions are stored in the undo step, undo/redo will cause a reevaluation
|
||||||
@ -381,11 +382,11 @@ static void restore_position_mesh(Object &object,
|
|||||||
/* The basis key positions and the mesh positions are always kept in sync. */
|
/* The basis key positions and the mesh positions are always kept in sync. */
|
||||||
scatter_data_mesh(undo_positions.as_span(), verts, positions);
|
scatter_data_mesh(undo_positions.as_span(), verts, positions);
|
||||||
}
|
}
|
||||||
swap_indexed_data(undo_positions, verts, active_data);
|
swap_indexed_data(undo_positions.take_front(unode.unique_verts_num), verts, active_data);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* There is a deform modifier, but no shape keys. */
|
/* There is a deform modifier, but no shape keys. */
|
||||||
swap_indexed_data(undo_positions, verts, positions);
|
swap_indexed_data(undo_positions.take_front(unode.unique_verts_num), verts, positions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modified_verts.fill_indices(verts, true);
|
modified_verts.fill_indices(verts, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user