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.
This commit is contained in:
Sergey Sharybin 2019-05-08 10:40:56 +02:00
parent 8287f31876
commit 951396a9bd
1 changed files with 8 additions and 1 deletions

View File

@ -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