Merged changes in the trunk up to revision 36551.
[blender.git] / source / blender / blenkernel / intern / library.c
index 0b07f40cad66a338c6bf8b5db6430d87f77a985b..cddac4db73944fc16d5ac9c108f77776d56fd128 100644 (file)
 #include "BKE_particle.h"
 #include "BKE_gpencil.h"
 #include "BKE_fcurve.h"
+#include "BKE_linestyle.h"
 
 #ifdef WITH_PYTHON
 #include "BPY_extern.h"
@@ -243,6 +244,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;
@@ -331,6 +334,8 @@ 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:
+                       return 0; /* not implemented */
        }
        
        return 0;
@@ -427,6 +432,8 @@ ListBase *which_libbase(Main *mainlib, short type)
                        return &(mainlib->wm);
                case ID_GD:
                        return &(mainlib->gpencil);
+               case ID_LS:
+                       return &(mainlib->linestyle);
        }
        return NULL;
 }
@@ -507,6 +514,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
        lb[a++]= &(main->scene);
        lb[a++]= &(main->library);
        lb[a++]= &(main->wm);
+       lb[a++]= &(main->linestyle);
        
        lb[a]= NULL;
 
@@ -612,6 +620,9 @@ static ID *alloc_libblock_notest(short type)
                case ID_GD:
                        id = MEM_callocN(sizeof(bGPdata), "Grease Pencil");
                        break;
+               case ID_LS:
+                       id = MEM_callocN(sizeof(FreestyleLineStyle), "Freestyle Line Style");
+                       break;
        }
        return id;
 }
@@ -816,6 +827,9 @@ void free_libblock(ListBase *lb, void *idv)
                case ID_GD:
                        free_gpencil_data((bGPdata *)id);
                        break;
+               case ID_LS:
+                       FRS_free_linestyle((FreestyleLineStyle *)id);
+                       break;
        }
 
        if (id->properties) {