diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-02-19 13:01:49 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-02-20 16:36:51 +0300 |
commit | 90ce1a3e8f35243544c3947cf7b80bae450b0c81 (patch) | |
tree | 863b3baf927f9bd7fb9272e3543d7e2d01e4feba /source/blender/blenkernel/intern/library.c | |
parent | a7747a3e0caef860500d3216bee6d4553d7b9076 (diff) |
New ID datablock 'CacheLibrary', for managing physical cache archives
and files.
At it's core this is just a file path, but many different cache users
may refer to this, so having a dedicated ID block helps. It can be
compared to Image datablocks, which also primarily are used for data
on storage, but can be packed with the blend file, and carry some
additional information that would be cumbersome to keep sync'ed
otherwise.
The name 'CacheLibrary' deliberately resembles the 'Library' datablock:
just as a Library stores ID blocks in a physical file, a CacheLibrary
stores cached data (in Alembic HDF5/Ogawa or other formats).
Conflicts:
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/intern/pointcache.c
source/blender/makesdna/DNA_pointcache_types.h
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index fa4f9c6ed52..192139bc3cc 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -45,6 +45,7 @@ #include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_brush_types.h" +#include "DNA_cache_library_types.h" #include "DNA_camera_types.h" #include "DNA_group_types.h" #include "DNA_gpencil_types.h" @@ -79,6 +80,7 @@ #include "BKE_armature.h" #include "BKE_bpath.h" #include "BKE_brush.h" +#include "BKE_cache_library.h" #include "BKE_camera.h" #include "BKE_context.h" #include "BKE_curve.h" @@ -107,6 +109,7 @@ #include "BKE_paint.h" #include "BKE_particle.h" #include "BKE_packedFile.h" +#include "BKE_pointcache.h" #include "BKE_speaker.h" #include "BKE_sound.h" #include "BKE_screen.h" @@ -521,6 +524,8 @@ ListBase *which_libbase(Main *mainlib, short type) return &(mainlib->palettes); case ID_PC: return &(mainlib->paintcurves); + case ID_CL: + return &(mainlib->cache_library); } return NULL; } @@ -615,6 +620,7 @@ int set_listbasepointers(Main *main, ListBase **lb) lb[a++] = &(main->linestyle); /* referenced by scenes */ lb[a++] = &(main->scene); lb[a++] = &(main->library); + lb[a++] = &(main->cache_library); lb[a++] = &(main->wm); lb[a++] = &(main->movieclip); lb[a++] = &(main->mask); @@ -747,6 +753,9 @@ static ID *alloc_libblock_notest(short type) case ID_PC: id = MEM_callocN(sizeof(PaintCurve), "Paint Curve"); break; + case ID_CL: + id = MEM_callocN(sizeof(CacheLibrary), "Cache Library"); + break; } return id; } @@ -1029,6 +1038,9 @@ void BKE_libblock_free_ex(Main *bmain, void *idv, bool do_id_user) case ID_PC: BKE_paint_curve_free((PaintCurve *)id); break; + case ID_CL: + BKE_cache_library_free((CacheLibrary *)id); + break; } /* avoid notifying on removed data */ |