Commit: 68aa35ae74226fbed936b1879302fc155d9acfac
Author: Hans Goudey
Date:   Fri Jan 21 16:12:12 2022 -0600
Branches: master
https://developer.blender.org/rB68aa35ae74226fbed936b1879302fc155d9acfac

Fix T94967: Sculpt mode crashes with missing normals

From an error in rBcfa53e0fbeed, the vertex normals in `SculptSession`
seem to be used, but in the case when no "pbvh" is used, the value of
the pointer is never assigned.

Normals were not generally dirty before this "ensure" function with
regular sculpting operations, so this addition shouldn't have any cost.

Differential Revision: https://developer.blender.org/D13854

===================================================================

M       source/blender/blenkernel/intern/paint.c

===================================================================

diff --git a/source/blender/blenkernel/intern/paint.c 
b/source/blender/blenkernel/intern/paint.c
index 72210eea71d..407375c4d22 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1648,6 +1648,7 @@ static void sculpt_update_object(Depsgraph *depsgraph,
     ss->totvert = me->totvert;
     ss->totpoly = me->totpoly;
     ss->totfaces = me->totpoly;
+    ss->vert_normals = BKE_mesh_vertex_normals_ensure(me);
     ss->mvert = me->mvert;
     ss->mpoly = me->mpoly;
     ss->mloop = me->mloop;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to