Fix #27539: Sculpt data is lost after editing base mesh
Face's totdisp was set to correct value, but memory hasn't been allocated for disps. Handle this in multires_topology_changed(), so the whole MDISPS layer wouldn't be totally re-allocated when applying displacement.
This commit is contained in:
@@ -1756,7 +1756,7 @@ void multires_topology_changed(Scene *scene, Object *ob)
|
||||
int nvert= me->mface[i].v4 ? 4 : 3;
|
||||
|
||||
/* allocate memory for mdisp, the whole disp layer would be erased otherwise */
|
||||
if(!mdisp->totdisp) {
|
||||
if(!mdisp->totdisp || !mdisp->disps) {
|
||||
if(grid) {
|
||||
mdisp->totdisp= nvert*grid;
|
||||
mdisp->disps= MEM_callocN(mdisp->totdisp*sizeof(float)*3, "mdisp topology");
|
||||
|
||||
Reference in New Issue
Block a user