Merged changes in the trunk up to revision 30397.
[blender-staging.git] / source / blender / blenloader / intern / readfile.c
index 536f133c91b848fd7c56476e14ae05ea1b607373..516515ba0141f5ad24dfb80afac0fa0f973173bd 100644 (file)
@@ -4133,6 +4133,7 @@ static void lib_link_scene(FileData *fd, Main *main)
        Base *base, *next;
        Sequence *seq;
        SceneRenderLayer *srl;
+       FreestyleLineSet *fls;
        TimeMarker *marker;
        
        sce= main->scene.first;
@@ -4214,6 +4215,9 @@ static void lib_link_scene(FileData *fd, Main *main)
                        for(srl= sce->r.layers.first; srl; srl= srl->next) {
                                srl->mat_override= newlibadr_us(fd, sce->id.lib, srl->mat_override);
                                srl->light_override= newlibadr_us(fd, sce->id.lib, srl->light_override);
+                               for(fls=srl->freestyleConfig.linesets.first; fls; fls= fls->next) {
+                                       fls->linestyle= newlibadr_us(fd, sce->id.lib, fls->linestyle);
+                               }
                        }
                        /*Game Settings: Dome Warp Text*/
                        sce->gm.dome.warptext= newlibadr(fd, sce->id.lib, sce->gm.dome.warptext);
@@ -4253,6 +4257,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
        Editing *ed;
        Sequence *seq;
        MetaStack *ms;
+       SceneRenderLayer *srl;
 
        sce->theDag = NULL;
        sce->dagisvalid = 0;
@@ -4430,6 +4435,13 @@ static void direct_link_scene(FileData *fd, Scene *sce)
        link_list(fd, &(sce->transform_spaces));
        link_list(fd, &(sce->r.layers));
 
+       for(srl= sce->r.layers.first; srl; srl= srl->next) {
+               link_list(fd, &(srl->freestyleConfig.modules));
+       }
+       for(srl= sce->r.layers.first; srl; srl= srl->next) {
+               link_list(fd, &(srl->freestyleConfig.linesets));
+       }
+       
        sce->nodetree= newdataadr(fd, sce->nodetree);
        if(sce->nodetree)
                direct_link_nodetree(fd, sce->nodetree);
@@ -5363,6 +5375,14 @@ static void lib_link_group(FileData *fd, Main *main)
        }
 }
 
+/* ************ READ LINE STYLE ***************** */
+
+static void direct_link_linestyle(FileData *fd, FreestyleLineStyle *linestyle)
+{
+
+}
+
+
 /* ************** GENERAL & MAIN ******************** */
 
 
@@ -5396,6 +5416,7 @@ static char *dataname(short id_code)
                case ID_BR: return "Data from BR";
                case ID_PA: return "Data from PA";
                case ID_GD: return "Data from GD";
+               case ID_LS: return "Data from LS";
        }
        return "Data from Lib Block";
        
@@ -5562,6 +5583,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
                case ID_GD:
                        direct_link_gpencil(fd, (bGPdata *)id);
                        break;
+               case ID_LS:
+                       direct_link_linestyle(fd, (FreestyleLineStyle *)id);
+                       break;
        }
        
        /*link direct data of ID properties*/
@@ -12007,6 +12031,11 @@ static void expand_sound(FileData *fd, Main *mainvar, bSound *snd)
        expand_doit(fd, mainvar, snd->ipo); // XXX depreceated - old animation system
 }
 
+static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *linestyle)
+{
+
+}
+
 
 static void expand_main(FileData *fd, Main *mainvar)
 {
@@ -12087,6 +12116,10 @@ static void expand_main(FileData *fd, Main *mainvar)
                                                break;
                                        case ID_PA:
                                                expand_particlesettings(fd, mainvar, (ParticleSettings *)id);
+                                               break;
+                                       case ID_LS:
+                                               expand_linestyle(fd, mainvar, (FreestyleLineStyle *)id);
+                                               break;
                                        }
 
                                        doit= 1;