From ea50e5f5873f471c5f35b4a45330b3a2995e8891 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 9 Feb 2011 15:38:49 +0000 Subject: Update mesh normals when undoing sculpt stroke to prevent shading artifacts in some cases (enter edit mode/disabling modifiers after undo) --- source/blender/editors/sculpt_paint/sculpt_undo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to '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 d136fdaf6e0..d88d7a5ac49 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -49,6 +49,7 @@ #include "BKE_multires.h" #include "BKE_paint.h" #include "BKE_key.h" +#include "BKE_mesh.h" #include "WM_api.h" #include "WM_types.h" @@ -184,6 +185,9 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) tag_update= ((Mesh*)ob->data)->id.us > 1; if(ss->modifiers_active) { + Mesh *me= ob->data; + mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); + sculpt_free_deformMats(ss); tag_update|= 1; } -- cgit v1.2.3