[Bf-blender-cvs] [86a16e7381a] blender-v2.83-release: Fix T76512: Sculpt mode: crash when applying base
Sergey Sharybin
noreply at git.blender.org
Mon May 11 15:32:36 CEST 2020
Commit: 86a16e7381aed89a466244ced5c7ae697977cd4b
Author: Sergey Sharybin
Date: Fri May 8 11:20:30 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB86a16e7381aed89a466244ced5c7ae697977cd4b
Fix T76512: Sculpt mode: crash when applying base
Differential Revision: https://developer.blender.org/D7663
===================================================================
M source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index ef25c23d7d3..1cb9b57e81d 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -1565,6 +1565,17 @@ static bool sculpt_undo_use_multires_mesh(bContext *C)
static void sculpt_undo_push_all_grids(Object *object)
{
SculptSession *ss = object->sculpt;
+
+ /* It is possible that undo push is done from an object state where there is no PBVH. This
+ * happens, for example, when an operation which tagged for geometry update was performed prior
+ * to the current operation without making any stroke inbetween.
+ *
+ * Skip pushing nodes based on the following logic: on redo SCULPT_UNDO_COORDS will ensure
+ * PBVH for the new base geometry, which will have same coordinates as if we create PBVH here. */
+ if (ss->pbvh == NULL) {
+ return;
+ }
+
PBVHNode **nodes;
int totnodes;
More information about the Bf-blender-cvs
mailing list