Merging r58475 through r58700 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / blenloader / intern / readfile.c
index 752f66c96a4f48c7e219186155de0b81e98c51fe..e71b3c644599f66c1f4a7e0f736b7e4f9162c713 100644 (file)
@@ -2526,9 +2526,11 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
                                                        link->fromsock = node_group_input_find_socket(input_node, link->fromsock->identifier);
                                                        ++num_inputs;
                                                        
                                                        link->fromsock = node_group_input_find_socket(input_node, link->fromsock->identifier);
                                                        ++num_inputs;
                                                        
-                                                       if (input_locx > link->tonode->locx - offsetx)
-                                                               input_locx = link->tonode->locx - offsetx;
-                                                       input_locy += link->tonode->locy;
+                                                       if (link->tonode) {
+                                                               if (input_locx > link->tonode->locx - offsetx)
+                                                                       input_locx = link->tonode->locx - offsetx;
+                                                               input_locy += link->tonode->locy;
+                                                       }
                                                }
                                                else
                                                        free_link = TRUE;
                                                }
                                                else
                                                        free_link = TRUE;
@@ -2540,9 +2542,11 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
                                                        link->tosock = node_group_output_find_socket(output_node, link->tosock->identifier);
                                                        ++num_outputs;
                                                        
                                                        link->tosock = node_group_output_find_socket(output_node, link->tosock->identifier);
                                                        ++num_outputs;
                                                        
-                                                       if (output_locx < link->fromnode->locx + offsetx)
-                                                               output_locx = link->fromnode->locx + offsetx;
-                                                       output_locy += link->fromnode->locy;
+                                                       if (link->fromnode) {
+                                                               if (output_locx < link->fromnode->locx + offsetx)
+                                                                       output_locx = link->fromnode->locx + offsetx;
+                                                               output_locy += link->fromnode->locy;
+                                                       }
                                                }
                                                else
                                                        free_link = TRUE;
                                                }
                                                else
                                                        free_link = TRUE;
@@ -2579,7 +2583,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
        {
                FOREACH_NODETREE(main, ntree, id) {
                        /* make an update call for the tree */
        {
                FOREACH_NODETREE(main, ntree, id) {
                        /* make an update call for the tree */
-                       ntreeUpdateTree(ntree);
+                       ntreeUpdateTree(main, ntree);
                } FOREACH_NODETREE_END
        }
 }
                } FOREACH_NODETREE_END
        }
 }
@@ -2963,8 +2967,10 @@ static void lib_link_lamp(FileData *fd, Main *main)
                        
                        la->ipo = newlibadr_us(fd, la->id.lib, la->ipo); // XXX deprecated - old animation system
                        
                        
                        la->ipo = newlibadr_us(fd, la->id.lib, la->ipo); // XXX deprecated - old animation system
                        
-                       if (la->nodetree)
+                       if (la->nodetree) {
                                lib_link_ntree(fd, &la->id, la->nodetree);
                                lib_link_ntree(fd, &la->id, la->nodetree);
+                               la->nodetree->id.lib = la->id.lib;
+                       }
                        
                        la->id.flag -= LIB_NEED_LINK;
                }
                        
                        la->id.flag -= LIB_NEED_LINK;
                }
@@ -3109,7 +3115,6 @@ static void direct_link_mball(FileData *fd, MetaBall *mb)
        
        mb->disp.first = mb->disp.last = NULL;
        mb->editelems = NULL;
        
        mb->disp.first = mb->disp.last = NULL;
        mb->editelems = NULL;
-       mb->bb = NULL;
 /*     mb->edit_elems.first= mb->edit_elems.last= NULL;*/
        mb->lastelem = NULL;
 }
 /*     mb->edit_elems.first= mb->edit_elems.last= NULL;*/
        mb->lastelem = NULL;
 }
@@ -3136,8 +3141,10 @@ static void lib_link_world(FileData *fd, Main *main)
                                }
                        }
                        
                                }
                        }
                        
-                       if (wrld->nodetree)
+                       if (wrld->nodetree) {
                                lib_link_ntree(fd, &wrld->id, wrld->nodetree);
                                lib_link_ntree(fd, &wrld->id, wrld->nodetree);
+                               wrld->nodetree->id.lib = wrld->id.lib;
+                       }
                        
                        wrld->id.flag -= LIB_NEED_LINK;
                }
                        
                        wrld->id.flag -= LIB_NEED_LINK;
                }
@@ -3383,11 +3390,8 @@ static void direct_link_curve(FileData *fd, Curve *cu)
                if (cu->wordspace == 0.0f) cu->wordspace = 1.0f;
        }
 
                if (cu->wordspace == 0.0f) cu->wordspace = 1.0f;
        }
 
-       cu->bev.first = cu->bev.last = NULL;
-       cu->disp.first = cu->disp.last = NULL;
        cu->editnurb = NULL;
        cu->lastsel = NULL;
        cu->editnurb = NULL;
        cu->lastsel = NULL;
-       cu->path = NULL;
        cu->editfont = NULL;
        
        for (nu = cu->nurb.first; nu; nu = nu->next) {
        cu->editfont = NULL;
        
        for (nu = cu->nurb.first; nu; nu = nu->next) {
@@ -3425,8 +3429,10 @@ static void lib_link_texture(FileData *fd, Main *main)
                        if (tex->ot)
                                tex->ot->object = newlibadr(fd, tex->id.lib, tex->ot->object);
                        
                        if (tex->ot)
                                tex->ot->object = newlibadr(fd, tex->id.lib, tex->ot->object);
                        
-                       if (tex->nodetree)
+                       if (tex->nodetree) {
                                lib_link_ntree(fd, &tex->id, tex->nodetree);
                                lib_link_ntree(fd, &tex->id, tex->nodetree);
+                               tex->nodetree->id.lib = tex->id.lib;
+                       }
                        
                        tex->id.flag -= LIB_NEED_LINK;
                }
                        
                        tex->id.flag -= LIB_NEED_LINK;
                }
@@ -3507,8 +3513,10 @@ static void lib_link_material(FileData *fd, Main *main)
                                }
                        }
                        
                                }
                        }
                        
-                       if (ma->nodetree)
+                       if (ma->nodetree) {
                                lib_link_ntree(fd, &ma->id, ma->nodetree);
                                lib_link_ntree(fd, &ma->id, ma->nodetree);
+                               ma->nodetree->id.lib = ma->id.lib;
+                       }
                        
                        ma->id.flag -= LIB_NEED_LINK;
                }
                        
                        ma->id.flag -= LIB_NEED_LINK;
                }
@@ -4136,6 +4144,11 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
        mesh->bb = NULL;
        mesh->edit_btmesh = NULL;
        
        mesh->bb = NULL;
        mesh->edit_btmesh = NULL;
        
+       /* happens with old files */
+       if (mesh->mselect == NULL) {
+               mesh->totselect = 0;
+       }
+
        /* Multires data */
        mesh->mr= newdataadr(fd, mesh->mr);
        if (mesh->mr) {
        /* Multires data */
        mesh->mr= newdataadr(fd, mesh->mr);
        if (mesh->mr) {
@@ -4804,8 +4817,6 @@ static void direct_link_object(FileData *fd, Object *ob)
                ob->mode &= ~(OB_MODE_EDIT | OB_MODE_PARTICLE_EDIT);
        }
        
                ob->mode &= ~(OB_MODE_EDIT | OB_MODE_PARTICLE_EDIT);
        }
        
-       ob->disp.first = ob->disp.last = NULL;
-       
        ob->adt = newdataadr(fd, ob->adt);
        direct_link_animdata(fd, ob->adt);
        
        ob->adt = newdataadr(fd, ob->adt);
        direct_link_animdata(fd, ob->adt);
        
@@ -5000,6 +5011,9 @@ static void direct_link_object(FileData *fd, Object *ob)
        ob->gpulamp.first= ob->gpulamp.last = NULL;
        link_list(fd, &ob->pc_ids);
 
        ob->gpulamp.first= ob->gpulamp.last = NULL;
        link_list(fd, &ob->pc_ids);
 
+       /* Runtime curve data  */
+       ob->curve_cache = NULL;
+
        /* in case this value changes in future, clamp else we get undefined behavior */
        CLAMP(ob->rotmode, ROT_MODE_MIN, ROT_MODE_MAX);
 
        /* in case this value changes in future, clamp else we get undefined behavior */
        CLAMP(ob->rotmode, ROT_MODE_MIN, ROT_MODE_MAX);
 
@@ -5156,6 +5170,7 @@ static void lib_link_scene(FileData *fd, Main *main)
                        
                        if (sce->nodetree) {
                                lib_link_ntree(fd, &sce->id, sce->nodetree);
                        
                        if (sce->nodetree) {
                                lib_link_ntree(fd, &sce->id, sce->nodetree);
+                               sce->nodetree->id.lib = sce->id.lib;
                                composite_patch(sce->nodetree, sce);
                        }
                        
                                composite_patch(sce->nodetree, sce);
                        }
                        
@@ -5501,6 +5516,7 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
        wm->winactive = NULL;
        wm->initialized = 0;
        wm->op_undo_depth = 0;
        wm->winactive = NULL;
        wm->initialized = 0;
        wm->op_undo_depth = 0;
+       wm->is_interface_locked = 0;
 }
 
 static void lib_link_windowmanager(FileData *fd, Main *main)
 }
 
 static void lib_link_windowmanager(FileData *fd, Main *main)
@@ -5690,8 +5706,9 @@ static void lib_link_screen(FileData *fd, Main *main)
                                                ntree = nodetree_from_id(snode->id);
                                                if (ntree)
                                                        snode->nodetree = ntree;
                                                ntree = nodetree_from_id(snode->id);
                                                if (ntree)
                                                        snode->nodetree = ntree;
-                                               else
-                                                       snode->nodetree = newlibadr(fd, sc->id.lib, snode->nodetree);
+                                               else {
+                                                       snode->nodetree = newlibadr_us(fd, sc->id.lib, snode->nodetree);
+                                               }
                                                
                                                for (path = snode->treepath.first; path; path = path->next) {
                                                        if (path == snode->treepath.first) {
                                                
                                                for (path = snode->treepath.first; path; path = path->next) {
                                                        if (path == snode->treepath.first) {
@@ -5699,7 +5716,7 @@ static void lib_link_screen(FileData *fd, Main *main)
                                                                path->nodetree = snode->nodetree;
                                                        }
                                                        else
                                                                path->nodetree = snode->nodetree;
                                                        }
                                                        else
-                                                               path->nodetree = newlibadr(fd, sc->id.lib, path->nodetree);
+                                                               path->nodetree = newlibadr_us(fd, sc->id.lib, path->nodetree);
                                                        
                                                        if (!path->nodetree)
                                                                break;
                                                        
                                                        if (!path->nodetree)
                                                                break;
@@ -5784,21 +5801,23 @@ static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
        return NULL;
 }
 
        return NULL;
 }
 
+static void lib_link_seq_clipboard_pt_restore(ID *id, Main *newmain)
+{
+       if (id) {
+               /* clipboard must ensure this */
+               BLI_assert(id->newid != NULL);
+               id->newid = restore_pointer_by_name(newmain, (ID *)id->newid, 1);
+       }
+}
 static int lib_link_seq_clipboard_cb(Sequence *seq, void *arg_pt)
 {
        Main *newmain = (Main *)arg_pt;
 static int lib_link_seq_clipboard_cb(Sequence *seq, void *arg_pt)
 {
        Main *newmain = (Main *)arg_pt;
-       
-       if (seq->sound) {
-               seq->sound = restore_pointer_by_name(newmain, (ID *)seq->sound, 0);
-               seq->sound->id.us++;
-       }
-       
-       if (seq->scene)
-               seq->scene = restore_pointer_by_name(newmain, (ID *)seq->scene, 1);
-       
-       if (seq->scene_camera)
-               seq->scene_camera = restore_pointer_by_name(newmain, (ID *)seq->scene_camera, 1);
-       
+
+       lib_link_seq_clipboard_pt_restore((ID *)seq->scene, newmain);
+       lib_link_seq_clipboard_pt_restore((ID *)seq->scene_camera, newmain);
+       lib_link_seq_clipboard_pt_restore((ID *)seq->clip, newmain);
+       lib_link_seq_clipboard_pt_restore((ID *)seq->mask, newmain);
+       lib_link_seq_clipboard_pt_restore((ID *)seq->sound, newmain);
        return 1;
 }
 
        return 1;
 }
 
@@ -6028,7 +6047,7 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
                                                        path->nodetree = snode->nodetree;
                                                }
                                                else
                                                        path->nodetree = snode->nodetree;
                                                }
                                                else
-                                                       path->nodetree= restore_pointer_by_name(newmain, (ID*)path->nodetree, 0);
+                                                       path->nodetree= restore_pointer_by_name(newmain, (ID*)path->nodetree, 2);
                                                
                                                if (!path->nodetree)
                                                        break;
                                                
                                                if (!path->nodetree)
                                                        break;
@@ -6176,6 +6195,7 @@ static bool direct_link_screen(FileData *fd, bScreen *sc)
                
                if (se->v1 == NULL) {
                        printf("Error reading Screen %s... removing it.\n", sc->id.name+2);
                
                if (se->v1 == NULL) {
                        printf("Error reading Screen %s... removing it.\n", sc->id.name+2);
+                       BLI_remlink(&sc->edgebase, se);
                        wrong_id = true;
                }
        }
                        wrong_id = true;
                }
        }
@@ -6632,7 +6652,6 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
        clip->tracking.stats = NULL;
 
        clip->tracking.stabilization.ok = 0;
        clip->tracking.stats = NULL;
 
        clip->tracking.stabilization.ok = 0;
-       clip->tracking.stabilization.scaleibuf = NULL;
        clip->tracking.stabilization.rot_track = newdataadr(fd, clip->tracking.stabilization.rot_track);
 
        clip->tracking.dopesheet.ok = 0;
        clip->tracking.stabilization.rot_track = newdataadr(fd, clip->tracking.stabilization.rot_track);
 
        clip->tracking.dopesheet.ok = 0;
@@ -7670,31 +7689,38 @@ static const char *node_get_static_idname(int type, int treetype)
 static const char *node_socket_get_static_idname(bNodeSocket *sock)
 {
        switch (sock->type) {
 static const char *node_socket_get_static_idname(bNodeSocket *sock)
 {
        switch (sock->type) {
-       case SOCK_FLOAT: {
-               bNodeSocketValueFloat *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
-       }
-       case SOCK_INT: {
-               bNodeSocketValueInt *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_INT, dval->subtype);
-       }
-       case SOCK_BOOLEAN: {
-               return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
-       }
-       case SOCK_VECTOR: {
-               bNodeSocketValueVector *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
-       }
-       case SOCK_RGBA: {
-               return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
-       }
-       case SOCK_STRING: {
-               bNodeSocketValueString *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_STRING, dval->subtype);
-       }
-       case SOCK_SHADER: {
-               return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
-       }
+               case SOCK_FLOAT:
+               {
+                       bNodeSocketValueFloat *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
+               }
+               case SOCK_INT:
+               {
+                       bNodeSocketValueInt *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_INT, dval->subtype);
+               }
+               case SOCK_BOOLEAN:
+               {
+                       return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
+               }
+               case SOCK_VECTOR:
+               {
+                       bNodeSocketValueVector *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
+               }
+               case SOCK_RGBA:
+               {
+                       return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
+               }
+               case SOCK_STRING:
+               {
+                       bNodeSocketValueString *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_STRING, dval->subtype);
+               }
+               case SOCK_SHADER:
+               {
+                       return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
+               }
        }
        return "";
 }
        }
        return "";
 }
@@ -7766,20 +7792,20 @@ static void do_versions_nodetree_customnodes(bNodeTree *ntree, int UNUSED(is_gro
                for (node=ntree->nodes.first; node; node=node->next) {
                        for (sock = node->inputs.first; sock; sock = sock->next) {
                                BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
                for (node=ntree->nodes.first; node; node=node->next) {
                        for (sock = node->inputs.first; sock; sock = sock->next) {
                                BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
-                               BLI_uniquename(&node->inputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+                               BLI_uniquename(&node->inputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
                        }
                        for (sock = node->outputs.first; sock; sock = sock->next) {
                                BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
                        }
                        for (sock = node->outputs.first; sock; sock = sock->next) {
                                BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
-                               BLI_uniquename(&node->outputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+                               BLI_uniquename(&node->outputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
                        }
                }
                for (sock = ntree->inputs.first; sock; sock = sock->next) {
                        BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
                        }
                }
                for (sock = ntree->inputs.first; sock; sock = sock->next) {
                        BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
-                       BLI_uniquename(&ntree->inputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+                       BLI_uniquename(&ntree->inputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
                }
                for (sock = ntree->outputs.first; sock; sock = sock->next) {
                        BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
                }
                for (sock = ntree->outputs.first; sock; sock = sock->next) {
                        BLI_strncpy(sock->identifier, sock->name, sizeof(sock->identifier));
-                       BLI_uniquename(&ntree->outputs, sock, sock->identifier, '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
+                       BLI_uniquename(&ntree->outputs, sock, "socket", '.', offsetof(bNodeSocket, identifier), sizeof(sock->identifier));
                }
        }
 }
                }
        }
 }
@@ -9318,7 +9344,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        }
 
        if (main->versionfile < 267) {
        }
 
        if (main->versionfile < 267) {
-               //if(!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) {
+               //if (!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) {
                Brush *brush;
 
                for (brush = main->brush.first; brush; brush = brush->id.next) {
                Brush *brush;
 
                for (brush = main->brush.first; brush; brush = brush->id.next) {
@@ -9337,16 +9363,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
 
                /* TIP: to initialize new variables added, use the new function
                }
 
                /* TIP: to initialize new variables added, use the new function
-                  DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname")
-                  example: 
-                               if (!DNA_struct_elem_find(fd->filesdna, "UserDef", "short", "image_gpubuffer_limit"))
-                                       user->image_gpubuffer_limit = 10;
+                * DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname")
+                * example:
+                * if (!DNA_struct_elem_find(fd->filesdna, "UserDef", "short", "image_gpubuffer_limit"))
+                *     user->image_gpubuffer_limit = 10;
                 */
                
        }
        
        /* default values in Freestyle settings */
                 */
                
        }
        
        /* default values in Freestyle settings */
-       {
+       if (main->versionfile < 267) {
                Scene *sce;
                SceneRenderLayer *srl;
                FreestyleLineStyle *linestyle;
                Scene *sce;
                SceneRenderLayer *srl;
                FreestyleLineStyle *linestyle;
@@ -9404,7 +9430,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
 
                }
        }
 
-       {
+       if (main->versionfile < 267) {
                /* Initialize the active_viewer_key for compositing */
                bScreen *screen;
                Scene *scene;
                /* Initialize the active_viewer_key for compositing */
                bScreen *screen;
                Scene *scene;
@@ -9439,6 +9465,74 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
 
                }
        }
 
+       if (MAIN_VERSION_OLDER(main, 267, 1))
+       {
+               Object *ob;
+
+               for (ob = main->object.first; ob; ob = ob->id.next) {
+                       ModifierData *md;
+                       for (md = ob->modifiers.first; md; md = md->next) {
+                               if (md->type == eModifierType_Smoke) {
+                                       SmokeModifierData *smd = (SmokeModifierData *)md;
+                                       if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
+                                               if (smd->domain->flags & MOD_SMOKE_HIGH_SMOOTH) {
+                                                       smd->domain->highres_sampling = SM_HRES_LINEAR;
+                                               }
+                                               else {
+                                                       smd->domain->highres_sampling = SM_HRES_NEAREST;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       if (!MAIN_VERSION_ATLEAST(main, 268, 1)) {
+               Brush *brush;
+               for (brush = main->brush.first; brush; brush = brush->id.next) {
+                       brush->spacing = MAX2(1, brush->spacing);
+               }
+       }
+       
+       {
+               bScreen *sc;
+               Object *ob;
+
+               for (ob = main->object.first; ob; ob = ob->id.next) {
+                       ModifierData *md;
+                       for (md = ob->modifiers.first; md; md = md->next) {
+                               if (md->type == eModifierType_Smoke) {
+                                       SmokeModifierData *smd = (SmokeModifierData *)md;
+                                       if ((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow) {
+                                               if (!smd->flow->particle_size) {
+                                                       smd->flow->particle_size = 1.0f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               /*
+                * FIX some files have a zoom level of 0, and was checked during the drawing of the node space
+                *
+                * We moved this check to the do versions to be sure the value makes any sense.
+                */
+               for (sc = main->screen.first; sc; sc = sc->id.next) {
+                       ScrArea *sa;
+                       for (sa = sc->areabase.first; sa; sa = sa->next) {
+                               SpaceLink *sl;
+                               for (sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_NODE) {
+                                               SpaceNode *snode = (SpaceNode *)sl;
+                                               if (snode->zoom < 0.02f) {
+                                                       snode->zoom = 1.0;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init see do_versions_userdef() above! */
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init see do_versions_userdef() above! */
 
@@ -9530,6 +9624,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
        link_list(fd, &user->themes);
        link_list(fd, &user->user_keymaps);
        link_list(fd, &user->addons);
        link_list(fd, &user->themes);
        link_list(fd, &user->user_keymaps);
        link_list(fd, &user->addons);
+       link_list(fd, &user->autoexec_paths);
        
        for (keymap=user->user_keymaps.first; keymap; keymap=keymap->next) {
                keymap->modal_items= NULL;
        
        for (keymap=user->user_keymaps.first; keymap; keymap=keymap->next) {
                keymap->modal_items= NULL;