Fixed bug #22293, v2.49b to v2.5alpha2 incompatibility
* UV data on multires meshes wasn't getting imported properly. Fixed by separately loading in all "first-level" data from the old multires data type into mesh. Note that an "incorrect" data layers might still be loaded and be active on the mesh, but the correct layers should now also show up in the UV layer selector.
This commit is contained in:
@@ -1286,6 +1286,7 @@ void multires_load_old(Object *ob, Mesh *me)
|
||||
ModifierData *md;
|
||||
MultiresModifierData *mmd;
|
||||
DerivedMesh *dm, *orig;
|
||||
CustomDataLayer *l;
|
||||
int i;
|
||||
|
||||
/* Load original level into the mesh */
|
||||
@@ -1331,6 +1332,14 @@ void multires_load_old(Object *ob, Mesh *me)
|
||||
dm->release(dm);
|
||||
orig->release(orig);
|
||||
|
||||
/* Copy the first-level data to the mesh */
|
||||
for(i = 0, l = me->mr->vdata.layers; i < me->mr->vdata.totlayer; ++i, ++l)
|
||||
CustomData_add_layer(&me->vdata, l->type, CD_REFERENCE, l->data, me->totvert);
|
||||
for(i = 0, l = me->mr->fdata.layers; i < me->mr->fdata.totlayer; ++i, ++l)
|
||||
CustomData_add_layer(&me->fdata, l->type, CD_REFERENCE, l->data, me->totface);
|
||||
memset(&me->mr->vdata, 0, sizeof(CustomData));
|
||||
memset(&me->mr->fdata, 0, sizeof(CustomData));
|
||||
|
||||
/* Remove the old multires */
|
||||
multires_free(me->mr);
|
||||
me->mr= NULL;
|
||||
|
||||
Reference in New Issue
Block a user