Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-03-08 21:16:20 +0300
committerHans Goudey <h.goudey@me.com>2022-03-08 21:16:42 +0300
commitc77597cd0e15f9d7b6f963593b545cc94950eb8d (patch)
treeab28a00f7eb39f35c71be2711f8321207f5723a5
parent7add8163e4b628767c546dae687333225c78c8c0 (diff)
Fix T95843: Invalid mesh runtime data after sculpt undov3.1.0
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
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 8819496c168..f740f38fdc6 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -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)