diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-23 00:28:41 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-23 00:28:41 +0300 |
commit | 25f5d2b4d7e83f52807be13d255cfde2ea51d8ee (patch) | |
tree | 553c9239046f62cc91b8ad7f8731c484647ebaab /source/blender/blenkernel/intern/image.c | |
parent | e529882be0752cdfd4fcf2f6b6bc06bcb44947af (diff) |
Fix (unreported) broken RNA Image pack handling since multiview merge.
Was breaking loading of embedded FBX images (among other things, most likely).
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f6513a3e016..c6d302ee15e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -75,6 +75,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_packedFile.h" +#include "BKE_report.h" #include "BKE_scene.h" #include "BKE_node.h" #include "BKE_sequencer.h" /* seq_foreground_frame_get() */ @@ -1030,6 +1031,21 @@ void BKE_image_packfiles(ReportList *reports, Image *ima, const char *basepath) } } +void BKE_image_packfiles_from_mem(ReportList *reports, Image *ima, char *data, const size_t data_len) +{ + const size_t totfiles = image_num_files(ima); + + if (totfiles != 1) { + BKE_report(reports, RPT_ERROR, "Cannot pack multiview images from raw data currently..."); + } + else { + ImagePackedFile *imapf = MEM_mallocN(sizeof(ImagePackedFile), __func__); + BLI_addtail(&ima->packedfiles, imapf); + imapf->packedfile = newPackedFileMemory(data, data_len); + BLI_strncpy(imapf->filepath, ima->name, sizeof(imapf->filepath)); + } +} + void BKE_image_tag_time(Image *ima) { ima->lastused = PIL_check_seconds_timer_i(); |