From 25f5d2b4d7e83f52807be13d255cfde2ea51d8ee Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 22 May 2015 23:28:41 +0200 Subject: Fix (unreported) broken RNA Image pack handling since multiview merge. Was breaking loading of embedded FBX images (among other things, most likely). --- source/blender/blenkernel/intern/image.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/blenkernel/intern') 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(); -- cgit v1.2.3