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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-07-12 11:30:50 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-07-12 11:30:50 +0400
commit92119982cb2073829560c54991179359f1c1fca1 (patch)
treeeef3c63bdab5e33e64cbe3cf400474ffd9a581cb
parent54c5edcfbb3547d88079e4c4fa6bfc8d7610db3c (diff)
Fix #32082: face textures lost when linking scene from another file
Issue was caused by missing expand for MTexPoly-s tpages.
-rw-r--r--source/blender/blenloader/intern/readfile.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 14860509d81..4a5eabc7615 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -8519,7 +8519,6 @@ static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
static void expand_mesh(FileData *fd, Main *mainvar, Mesh *me)
{
CustomDataLayer *layer;
- MTFace *mtf;
TFace *tf;
int a, i;
@@ -8541,14 +8540,34 @@ static void expand_mesh(FileData *fd, Main *mainvar, Mesh *me)
}
}
- for (a = 0; a < me->fdata.totlayer; a++) {
- layer = &me->fdata.layers[a];
-
- if (layer->type == CD_MTFACE) {
- mtf = (MTFace*)layer->data;
- for (i = 0; i < me->totface; i++, mtf++) {
- if (mtf->tpage)
- expand_doit(fd, mainvar, mtf->tpage);
+ if (me->mface && !me->mpoly) {
+ MTFace *mtf;
+
+ for (a = 0; a < me->fdata.totlayer; a++) {
+ layer = &me->fdata.layers[a];
+
+ if (layer->type == CD_MTFACE) {
+ mtf = (MTFace *) layer->data;
+ for (i = 0; i < me->totface; i++, mtf++) {
+ if (mtf->tpage)
+ expand_doit(fd, mainvar, mtf->tpage);
+ }
+ }
+ }
+ }
+ else {
+ MTexPoly *mtp;
+
+ for (a = 0; a < me->pdata.totlayer; a++) {
+ layer = &me->pdata.layers[a];
+
+ if (layer->type == CD_MTEXPOLY) {
+ mtp = (MTexPoly *) layer->data;
+
+ for (i = 0; i < me->totpoly; i++, mtp++) {
+ if (mtp->tpage)
+ expand_doit(fd, mainvar, mtp->tpage);
+ }
}
}
}