Fix T95843: Invalid mesh runtime data after sculpt undo
When the geometry of the sculpt mesh was replaced when restoring from a full undo step, the runtime data was not cleared (including any normals, triangulation data, or any other cached derived data). In the report, only the invalid normals were observed. The fix is to simply clear these caches. Later they will be reallocated and recalculated if necessary. Since the whole mesh replaced here anyway, this should be a safe fix. Differential Revision: https://developer.blender.org/D14282
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include "BKE_key.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_mesh_runtime.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_paint.h"
|
||||
@@ -547,6 +548,8 @@ static void sculpt_undo_geometry_restore_data(SculptUndoNodeGeometry *geometry,
|
||||
&geometry->pdata, &mesh->pdata, CD_MASK_MESH.pmask, CD_DUPLICATE, geometry->totpoly);
|
||||
|
||||
BKE_mesh_update_customdata_pointers(mesh, false);
|
||||
|
||||
BKE_mesh_runtime_clear_cache(mesh);
|
||||
}
|
||||
|
||||
static void sculpt_undo_geometry_free_data(SculptUndoNodeGeometry *geometry)
|
||||
|
Reference in New Issue
Block a user