Multires: Fix CCG->MDISPS conversion happens twice

Was happening when leaving sculpt mode, introducing unnecessary lag
to the operation.
This commit is contained in:
Sergey Sharybin 2020-02-28 12:21:42 +01:00
parent 944da82eaf
commit 1eb73d1596
1 changed files with 12 additions and 0 deletions

View File

@ -417,9 +417,21 @@ void multires_flush_sculpt_updates(Object *object)
return;
}
SubdivCCG *subdiv_ccg = sculpt_session->subdiv_ccg;
if (subdiv_ccg == NULL) {
return;
}
if (!subdiv_ccg->dirty.coords && !subdiv_ccg->dirty.hidden) {
return;
}
Mesh *mesh = object->data;
multiresModifier_reshapeFromCCG(
sculpt_session->multires->totlvl, mesh, sculpt_session->subdiv_ccg);
subdiv_ccg->dirty.coords = false;
subdiv_ccg->dirty.hidden = false;
}
void multires_force_sculpt_rebuild(Object *object)