Fix T74686: Loading btx file in multires modifier is not working

Was happening when object does not have CD_MDISPS allocated yet.
Need to make sure totdisp and level is specified on CD_MDISPS data
prior to loading (as the load expects them to be properly set).
This commit is contained in:
2020-03-13 16:13:32 +01:00
parent 67704cb8aa
commit de30fda04e
5 changed files with 52 additions and 10 deletions

View File

@@ -149,8 +149,7 @@ bool multiresModifier_reshapeFromCCG(const int tot_level,
return false;
}
CustomData_external_read(
&coarse_mesh->ldata, &coarse_mesh->id, CD_MASK_MDISPS, coarse_mesh->totloop);
multires_ensure_external_read(coarse_mesh, reshape_context.top.level);
multires_reshape_store_original_grids(&reshape_context);
multires_reshape_ensure_grids(coarse_mesh, reshape_context.top.level);