Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-04-02 04:52:38 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2007-04-02 04:52:38 +0400
commitdca213525a018b688216e785eaede4508332bf1d (patch)
treec6d814e8bc915c2f53ae5d296c05cb6d4eb7d8fd /source/blender/blenloader
parent2d1ef139629c20f010523c23232fff4f2f144a94 (diff)
== Multires ==
Fixed bug #6358, UV face select + Multires level change crashes * Reading in multires files wasn't relinking the MTFace customdata stored for level 1. This was leaving tpage as a bad pointer.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 4f00cf1626d..686606e0a13 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2427,6 +2427,18 @@ static void lib_link_mtface(FileData *fd, Mesh *me, MTFace *mtface, int totface)
}
}
+static void lib_link_customdata_mtface(FileData *fd, Mesh *me, CustomData *fdata, int totface)
+{
+ int i;
+ for(i=0; i<fdata->totlayer; i++) {
+ CustomDataLayer *layer = &fdata->layers[i];
+
+ if(layer->type == CD_MTFACE)
+ lib_link_mtface(fd, me, layer->data, totface);
+ }
+
+}
+
static void lib_link_mesh(FileData *fd, Main *main)
{
Mesh *me;
@@ -2452,12 +2464,11 @@ static void lib_link_mesh(FileData *fd, Main *main)
me->key= newlibadr_us(fd, me->id.lib, me->key);
me->texcomesh= newlibadr_us(fd, me->id.lib, me->texcomesh);
- for(i=0; i<me->fdata.totlayer; i++) {
- CustomDataLayer *layer = &me->fdata.layers[i];
+ lib_link_customdata_mtface(fd, me, &me->fdata, me->totface);
+ if(me->mr && me->mr->levels.first)
+ lib_link_customdata_mtface(fd, me, &me->mr->fdata,
+ ((MultiresLevel*)me->mr->levels.first)->totface);
- if(layer->type == CD_MTFACE)
- lib_link_mtface(fd, me, layer->data, me->totface);
- }
me->id.flag -= LIB_NEEDLINK;
}
me= me->id.next;