Merging r48862 through r48868 from trunk into soc-2011-tomato
[blender.git] / source / blender / blenloader / intern / readfile.c
index 5f92752d5aa8f74da5134d7f7538cf7f627f2f4d..b7df636f9cb8f0ce6d58114d50ecea904a333805 100644 (file)
@@ -3733,7 +3733,14 @@ static void lib_link_mesh(FileData *fd, Main *main)
                                
                                G.main = gmain;
                        }
-                       
+               }
+       }
+
+       /* convert texface options to material */
+       convert_tface_mt(fd, main);
+
+       for (me = main->mesh.first; me; me = me->id.next) {
+               if (me->id.flag & LIB_NEEDLINK) {
                        /*
                         * Re-tessellate, even if the polys were just created from tessfaces, this
                         * is important because it:
@@ -3749,13 +3756,10 @@ static void lib_link_mesh(FileData *fd, Main *main)
 #else
                        BKE_mesh_tessface_clear(me);
 #endif
-                       
+
                        me->id.flag -= LIB_NEEDLINK;
                }
        }
-       
-       /* convert texface options to material */
-       convert_tface_mt(fd, main);
 }
 
 static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts)