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:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 38454547f48..a5484d218d2 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -238,6 +238,7 @@ typedef struct OldNewMap {
/* local prototypes */
static void *read_struct(FileData *fd, BHead *bh, const char *blockname);
static void direct_link_modifiers(FileData *fd, ListBase *lb);
+static void convert_tface_mt(FileData *fd, Main *main);
static OldNewMap *oldnewmap_new(void)
{
@@ -3478,6 +3479,9 @@ static void lib_link_mesh(FileData *fd, Main *main)
}
me= me->id.next;
}
+
+ /* convert texface options to material */
+ convert_tface_mt(fd, main);
}
static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts)
@@ -7038,6 +7042,27 @@ static void do_versions_nodetree_dynamic_sockets(bNodeTree *ntree)
sock->flag |= SOCK_DYNAMIC;
}
+void convert_tface_mt(FileData *fd, Main *main)
+{
+ Main *gmain;
+
+ /* this is a delayed do_version (so it can create new materials) */
+ if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 3)) {
+
+ //XXX hack, material.c uses G.main all over the place, instead of main
+ // temporarily set G.main to the current main
+ gmain = G.main;
+ G.main = main;
+
+ if(!(do_version_tface(main, 1))) {
+ BKE_report(fd->reports, RPT_ERROR, "Texface conversion problem. Error in console");
+ }
+
+ //XXX hack, material.c uses G.main allover the place, instead of main
+ G.main = gmain;
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */