From 951396a9bdafec0b641196a108198f9fa63e16b8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 8 May 2019 10:40:56 +0200 Subject: Fix T64274: Crash with more than 1 subdivision with the Multiresolution Modifier Update more relevant fields in the sculpt session. Really becoming annoying, but was also annoying in the old code as well. --- source/blender/modifiers/intern/MOD_multires.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 6e5426bbf40..c61ebe0448c 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -195,7 +195,14 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes * Annoying and not so much black-boxed as far as sculpting goes, and * surely there is a better way of solving this. */ if (ctx->object->sculpt != NULL) { - ctx->object->sculpt->subdiv_ccg = result->runtime.subdiv_ccg; + SculptSession *sculpt_session = ctx->object->sculpt; + sculpt_session->subdiv_ccg = result->runtime.subdiv_ccg; + sculpt_session->multires = mmd; + sculpt_session->totvert = mesh->totvert; + sculpt_session->totpoly = mesh->totpoly; + sculpt_session->mvert = NULL; + sculpt_session->mpoly = NULL; + sculpt_session->mloop = NULL; } /* NOTE: CCG becomes an owner of Subdiv descriptor, so can not share * this pointer. Not sure if it's needed, but might have a second look -- cgit v1.2.3