Merged changes in the trunk up to revision 42425.
[blender.git] / source / blender / blenkernel / intern / library.c
index cb1c7dbec5c20fa4ffc7998eaaa251e86af08148..a79f4a2628ba3c0bcaf0f49df4e9839311609155 100644 (file)
 #include "BKE_speaker.h"
 #include "BKE_utildefines.h"
 #include "BKE_movieclip.h"
+#include "BKE_linestyle.h"
 
 #include "RNA_access.h"
 
@@ -269,6 +270,8 @@ int id_make_local(ID *id, int test)
                        return 0; /* can't be linked */
                case ID_GD:
                        return 0; /* not implemented */
+               case ID_LS:
+                       return 0; /* not implemented */
        }
 
        return 0;
@@ -360,6 +363,9 @@ int id_copy(ID *id, ID **newid, int test)
                        return 0; /* can't be copied from here */
                case ID_GD:
                        return 0; /* not implemented */
+               case ID_LS:
+                       if(!test) *newid= (ID*)FRS_copy_linestyle((FreestyleLineStyle*)id);
+                       return 1;
        }
        
        return 0;
@@ -488,6 +494,8 @@ ListBase *which_libbase(Main *mainlib, short type)
                        return &(mainlib->gpencil);
                case ID_MC:
                        return &(mainlib->movieclip);
+               case ID_LS:
+                       return &(mainlib->linestyle);
        }
        return NULL;
 }
@@ -570,6 +578,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
        lb[a++]= &(main->library);
        lb[a++]= &(main->wm);
        lb[a++]= &(main->movieclip);
+       lb[a++]= &(main->linestyle);
        
        lb[a]= NULL;
 
@@ -681,6 +690,9 @@ static ID *alloc_libblock_notest(short type)
                case ID_MC:
                        id = MEM_callocN(sizeof(MovieClip), "Movie Clip");
                        break;
+               case ID_LS:
+                       id = MEM_callocN(sizeof(FreestyleLineStyle), "Freestyle Line Style");
+                       break;
        }
        return id;
 }
@@ -889,6 +901,9 @@ void free_libblock(ListBase *lb, void *idv)
                case ID_MC:
                        free_movieclip((MovieClip *)id);
                        break;
+               case ID_LS:
+                       FRS_free_linestyle((FreestyleLineStyle *)id);
+                       break;
        }
 
        if (id->properties) {