diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-01-14 15:35:45 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-01-14 15:35:45 +0300 |
commit | b7ccb830d23156100749e27f35f1ee210d474d3b (patch) | |
tree | cabf038711169e1452539a1096862f01866a5012 /source/blender/blenloader | |
parent | bd0f9a59f08889c1e79c5adeb7b9cbcac5ba4436 (diff) |
Fix for bug #5689:
Loss of UV coordinates reading from 2.42 .blend files, if there were
both vertex colors and tfaces (these contained colors also). It should
have been impossible to create them both in 2.42, but even if invalid
we should read them correct.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 267a3c95561..4f1edb6d102 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4247,10 +4247,10 @@ static void customdata_version_242(Mesh *me) if (!me->fdata.totlayer) { CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, me->mface, me->totface); - if (me->mcol) { - me->mcol= CustomData_add_layer(&me->fdata, CD_MCOL, CD_ASSIGN, me->mcol, me->totface); - } - else if (me->tface) { + if (me->tface) { + if (me->mcol) + MEM_freeN(me->mcol); + me->mcol= CustomData_add_layer(&me->fdata, CD_MCOL, CD_CALLOC, NULL, me->totface); me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_CALLOC, NULL, me->totface); @@ -4273,6 +4273,9 @@ static void customdata_version_242(Mesh *me) MEM_freeN(me->tface); me->tface= NULL; } + else if (me->mcol) { + me->mcol= CustomData_add_layer(&me->fdata, CD_MCOL, CD_ASSIGN, me->mcol, me->totface); + } } if (me->tface) { |