This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenkernel/intern/packedFile.c

763 lines
17 KiB
C
Raw Normal View History

/*
* ***** BEGIN GPL LICENSE BLOCK *****
2002-10-12 11:37:38 +00:00
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
2002-10-12 11:37:38 +00:00
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
2010-02-12 13:34:04 +00:00
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2002-10-12 11:37:38 +00:00
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
2002-10-12 11:37:38 +00:00
*/
2011-02-27 20:40:57 +00:00
/** \file blender/blenkernel/intern/packedFile.c
* \ingroup bke
*/
2002-10-12 11:37:38 +00:00
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
2018-06-17 17:05:51 +02:00
#ifndef WIN32
2002-10-12 11:37:38 +00:00
#include <unistd.h>
#else
#include <io.h>
#endif
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_image_types.h"
#include "DNA_ID.h"
#include "DNA_packedFile_types.h"
2002-10-12 11:37:38 +00:00
#include "DNA_sound_types.h"
#include "DNA_vfont_types.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
2002-10-12 11:37:38 +00:00
#include "BKE_font.h"
2002-10-12 11:37:38 +00:00
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
2002-10-12 11:37:38 +00:00
#include "BKE_packedFile.h"
#include "BKE_report.h"
#include "BKE_sound.h"
2002-10-12 11:37:38 +00:00
int seekPackedFile(PackedFile *pf, int offset, int whence)
2002-10-12 11:37:38 +00:00
{
int oldseek = -1, seek = 0;
if (pf) {
oldseek = pf->seek;
switch (whence) {
2012-05-06 17:22:54 +00:00
case SEEK_CUR:
seek = oldseek + offset;
break;
case SEEK_END:
seek = pf->size + offset;
break;
case SEEK_SET:
seek = offset;
break;
default:
oldseek = -1;
break;
2002-10-12 11:37:38 +00:00
}
if (seek < 0) {
seek = 0;
}
else if (seek > pf->size) {
2002-10-12 11:37:38 +00:00
seek = pf->size;
}
pf->seek = seek;
}
return(oldseek);
}
2018-06-17 17:05:51 +02:00
void rewindPackedFile(PackedFile *pf)
2002-10-12 11:37:38 +00:00
{
seekPackedFile(pf, 0, SEEK_SET);
}
int readPackedFile(PackedFile *pf, void *data, int size)
2018-06-17 17:05:51 +02:00
{
2002-10-12 11:37:38 +00:00
if ((pf != NULL) && (size >= 0) && (data != NULL)) {
if (size + pf->seek > pf->size) {
size = pf->size - pf->seek;
}
if (size > 0) {
memcpy(data, ((char *) pf->data) + pf->seek, size);
}
else {
2002-10-12 11:37:38 +00:00
size = 0;
}
pf->seek += size;
}
else {
2002-10-12 11:37:38 +00:00
size = -1;
}
return(size);
}
int countPackedFiles(Main *bmain)
2002-10-12 11:37:38 +00:00
{
Image *ima;
VFont *vf;
bSound *sound;
int count = 0;
2018-06-17 17:05:51 +02:00
2012-07-07 22:51:57 +00:00
/* let's check if there are packed files... */
2012-05-06 17:22:54 +00:00
for (ima = bmain->image.first; ima; ima = ima->id.next)
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
if (BKE_image_has_packedfile(ima))
count ++;
2002-10-12 11:37:38 +00:00
2012-05-06 17:22:54 +00:00
for (vf = bmain->vfont.first; vf; vf = vf->id.next)
if (vf->packedfile)
2002-10-12 11:37:38 +00:00
count++;
2012-05-06 17:22:54 +00:00
for (sound = bmain->sound.first; sound; sound = sound->id.next)
if (sound->packedfile)
count++;
2002-10-12 11:37:38 +00:00
return count;
2002-10-12 11:37:38 +00:00
}
void freePackedFile(PackedFile *pf)
2002-10-12 11:37:38 +00:00
{
if (pf) {
2002-10-12 11:37:38 +00:00
MEM_freeN(pf->data);
MEM_freeN(pf);
}
else
printf("freePackedFile: Trying to free a NULL pointer\n");
2002-10-12 11:37:38 +00:00
}
PackedFile *dupPackedFile(const PackedFile *pf_src)
{
PackedFile *pf_dst;
pf_dst = MEM_dupallocN(pf_src);
pf_dst->data = MEM_dupallocN(pf_src->data);
return pf_dst;
}
PackedFile *newPackedFileMemory(void *mem, int memlen)
2002-10-12 11:37:38 +00:00
{
PackedFile *pf = MEM_callocN(sizeof(*pf), "PackedFile");
2002-10-12 11:37:38 +00:00
pf->data = mem;
pf->size = memlen;
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
return pf;
}
PackedFile *newPackedFile(ReportList *reports, const char *filename, const char *basepath)
2002-10-12 11:37:38 +00:00
{
PackedFile *pf = NULL;
2002-10-12 11:37:38 +00:00
int file, filelen;
char name[FILE_MAX];
void *data;
2018-06-17 17:05:51 +02:00
/* render result has no filename and can be ignored
* any other files with no name can be ignored too */
2012-05-06 17:22:54 +00:00
if (filename[0] == '\0')
return NULL;
//XXX waitcursor(1);
2018-06-17 17:05:51 +02:00
2012-07-07 22:51:57 +00:00
/* convert relative filenames to absolute filenames */
BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, basepath);
2012-07-07 22:51:57 +00:00
/* open the file
* and create a PackedFile structure */
2002-10-12 11:37:38 +00:00
2012-05-06 17:22:54 +00:00
file = BLI_open(name, O_BINARY | O_RDONLY, 0);
if (file == -1) {
BKE_reportf(reports, RPT_ERROR, "Unable to pack file, source path '%s' not found", name);
}
else {
filelen = BLI_file_descriptor_size(file);
2002-10-12 11:37:38 +00:00
if (filelen == 0) {
2012-07-07 22:51:57 +00:00
/* MEM_mallocN complains about MEM_mallocN(0, "bla");
* we don't care.... */
2002-10-12 11:37:38 +00:00
data = MEM_mallocN(1, "packFile");
}
else {
2002-10-12 11:37:38 +00:00
data = MEM_mallocN(filelen, "packFile");
}
if (read(file, data, filelen) == filelen) {
pf = newPackedFileMemory(data, filelen);
}
else {
MEM_freeN(data);
}
2002-10-12 11:37:38 +00:00
close(file);
}
//XXX waitcursor(0);
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
return (pf);
}
/* no libraries for now */
void packAll(Main *bmain, ReportList *reports, bool verbose)
2002-10-12 11:37:38 +00:00
{
Image *ima;
VFont *vfont;
bSound *sound;
int tot = 0;
2018-06-17 17:05:51 +02:00
2012-05-06 17:22:54 +00:00
for (ima = bmain->image.first; ima; ima = ima->id.next) {
if (BKE_image_has_packedfile(ima) == false && !ID_IS_LINKED(ima)) {
2012-05-06 17:22:54 +00:00
if (ima->source == IMA_SRC_FILE) {
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
BKE_image_packfiles(reports, ima, ID_BLEND_PATH(bmain, &ima->id));
tot ++;
}
else if (BKE_image_is_animated(ima) && verbose) {
BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported",
ima->id.name + 2);
}
}
}
2002-10-12 11:37:38 +00:00
for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) {
if (vfont->packedfile == NULL && !ID_IS_LINKED(vfont) && BKE_vfont_is_builtin(vfont) == false) {
vfont->packedfile = newPackedFile(reports, vfont->name, BKE_main_blendfile_path(bmain));
tot ++;
}
}
2002-10-12 11:37:38 +00:00
for (sound = bmain->sound.first; sound; sound = sound->id.next) {
if (sound->packedfile == NULL && !ID_IS_LINKED(sound)) {
sound->packedfile = newPackedFile(reports, sound->name, BKE_main_blendfile_path(bmain));
tot++;
}
}
2018-06-17 17:05:51 +02:00
if (tot > 0)
BKE_reportf(reports, RPT_INFO, "Packed %d files", tot);
else if (verbose)
BKE_report(reports, RPT_INFO, "No new files have been packed");
2002-10-12 11:37:38 +00:00
}
#if 0
2002-10-12 11:37:38 +00:00
// attempt to create a function that generates an unique filename
// this will work when all funtions in fileops.c understand relative filenames...
static char *find_new_name(char *name)
2002-10-12 11:37:38 +00:00
{
char tempname[FILE_MAX];
char *newname;
size_t len;
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
if (fop_exists(name)) {
for (number = 1; number <= 999; number++) {
BLI_snprintf(tempname, sizeof(tempname), "%s.%03d", name, number);
2012-05-06 17:22:54 +00:00
if (!fop_exists(tempname)) {
2002-10-12 11:37:38 +00:00
break;
}
}
}
2012-05-06 17:22:54 +00:00
len = strlen(tempname) + 1;
newname = MEM_mallocN(len, "find_new_name");
memcpy(newname, tempname, len * sizeof(char));
return newname;
2002-10-12 11:37:38 +00:00
}
#endif
2002-10-12 11:37:38 +00:00
int writePackedFile(
ReportList *reports, const char *ref_file_name, const char *filename, PackedFile *pf, const bool guimode)
2002-10-12 11:37:38 +00:00
{
int file, number;
2002-10-12 11:37:38 +00:00
int ret_value = RET_OK;
bool remove_tmp = false;
char name[FILE_MAX];
char tempname[FILE_MAX];
2012-05-06 17:22:54 +00:00
/* void *data; */
2018-06-17 17:05:51 +02:00
if (guimode) {} //XXX waitcursor(1);
2018-06-17 17:05:51 +02:00
BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, ref_file_name);
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
if (BLI_exists(name)) {
for (number = 1; number <= 999; number++) {
BLI_snprintf(tempname, sizeof(tempname), "%s.%03d_", name, number);
2012-05-06 17:22:54 +00:00
if (!BLI_exists(tempname)) {
if (BLI_copy(name, tempname) == RET_OK) {
remove_tmp = true;
2002-10-12 11:37:38 +00:00
}
break;
}
}
}
2018-06-17 17:05:51 +02:00
2012-07-07 22:51:57 +00:00
/* make sure the path to the file exists... */
Giant commit! A full detailed description of this will be done later... is several days of work. Here's a summary: Render: - Full cleanup of render code, removing *all* globals and bad level calls all over blender. Render module is now not called abusive anymore - API-fied calls to rendering - Full recode of internal render pipeline. Is now rendering tiles by default, prepared for much smarter 'bucket' render later. - Each thread now can render a full part - Renders were tested with 4 threads, goes fine, apart from some lookup tables in softshadow and AO still - Rendering is prepared to do multiple layers and passes - No single 32 bits trick in render code anymore, all 100% floats now. Writing images/movies - moved writing images to blender kernel (bye bye 'schrijfplaatje'!) - made a new Movie handle system, also in kernel. This will enable much easier use of movies in Blender PreviewRender: - Using new render API, previewrender (in buttons) now uses regular render code to generate images. - new datafile 'preview.blend.c' has the preview scenes in it - previews get rendered in exact displayed size (1 pixel = 1 pixel) 3D Preview render - new; press Pkey in 3d window, for a panel that continuously renders (pkey is for games, i know... but we dont do that in orange now!) - this render works nearly identical to buttons-preview render, so it stops rendering on any event (mouse, keyboard, etc) - on moving/scaling the panel, the render code doesn't recreate all geometry - same for shifting/panning view - all other operations (now) regenerate the full render database still. - this is WIP... but big fun, especially for simple scenes! Compositor - Using same node system as now in use for shaders, you can composit images - works pretty straightforward... needs much more options/tools and integration with rendering still - is not threaded yet, nor is so smart to only recalculate changes... will be done soon! - the "Render Result" node will get all layers/passes as output sockets - The "Output" node renders to a builtin image, which you can view in the Image window. (yes, output nodes to render-result, and to files, is on the list!) The Bad News - "Unified Render" is removed. It might come back in some stage, but this system should be built from scratch. I can't really understand this code... I expect it is not much needed, especially with advanced layer/passes control - Panorama render, Field render, Motion blur, is not coded yet... (I had to recode every single feature in render, so...!) - Lens Flare is also not back... needs total revision, might become composit effect though (using zbuffer for visibility) - Part render is gone! (well, thats obvious, its default now). - The render window is only restored with limited functionality... I am going to check first the option to render to a Image window, so Blender can become a true single-window application. :) For example, the 'Spare render buffer' (jkey) doesnt work. - Render with border, now default creates a smaller image - No zbuffers are written yet... on the todo! - Scons files and MSVC will need work to get compiling again OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
BLI_make_existing_file(name);
2018-06-17 17:05:51 +02:00
file = BLI_open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666);
if (file == -1) {
BKE_reportf(reports, RPT_ERROR, "Error creating file '%s'", name);
ret_value = RET_ERROR;
}
else {
2002-10-12 11:37:38 +00:00
if (write(file, pf->data, pf->size) != pf->size) {
BKE_reportf(reports, RPT_ERROR, "Error writing file '%s'", name);
2002-10-12 11:37:38 +00:00
ret_value = RET_ERROR;
}
else {
BKE_reportf(reports, RPT_INFO, "Saved packed file to: %s", name);
}
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
close(file);
}
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
if (remove_tmp) {
if (ret_value == RET_ERROR) {
if (BLI_rename(tempname, name) != 0) {
BKE_reportf(reports, RPT_ERROR, "Error restoring temp file (check files '%s' '%s')", tempname, name);
2002-10-12 11:37:38 +00:00
}
}
else {
if (BLI_delete(tempname, false, false) != 0) {
BKE_reportf(reports, RPT_ERROR, "Error deleting '%s' (ignored)", tempname);
2002-10-12 11:37:38 +00:00
}
}
}
2018-06-17 17:05:51 +02:00
if (guimode) {} //XXX waitcursor(0);
2002-10-12 11:37:38 +00:00
return (ret_value);
}
/**
* This function compares a packed file to a 'real' file.
* It returns an integer indicating if:
*
* - PF_EQUAL: the packed file and original file are identical
* - PF_DIFFERENT: the packed file and original file differ
* - PF_NOFILE: the original file doens't exist
*/
int checkPackedFile(const char *ref_file_name, const char *filename, PackedFile *pf)
2002-10-12 11:37:38 +00:00
{
BLI_stat_t st;
2002-10-12 11:37:38 +00:00
int ret_val, i, len, file;
char buf[4096];
char name[FILE_MAX];
2018-06-17 17:05:51 +02:00
BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, ref_file_name);
2018-06-17 17:05:51 +02:00
if (BLI_stat(name, &st) == -1) {
2002-10-12 11:37:38 +00:00
ret_val = PF_NOFILE;
}
else if (st.st_size != pf->size) {
2002-10-12 11:37:38 +00:00
ret_val = PF_DIFFERS;
}
else {
2012-07-07 22:51:57 +00:00
/* we'll have to compare the two... */
file = BLI_open(name, O_BINARY | O_RDONLY, 0);
if (file == -1) {
2002-10-12 11:37:38 +00:00
ret_val = PF_NOFILE;
}
else {
2002-10-12 11:37:38 +00:00
ret_val = PF_EQUAL;
2012-07-07 22:51:57 +00:00
2002-10-12 11:37:38 +00:00
for (i = 0; i < pf->size; i += sizeof(buf)) {
len = pf->size - i;
if (len > sizeof(buf)) {
len = sizeof(buf);
}
2012-07-07 22:51:57 +00:00
2002-10-12 11:37:38 +00:00
if (read(file, buf, len) != len) {
2012-07-07 22:51:57 +00:00
/* read error ... */
2002-10-12 11:37:38 +00:00
ret_val = PF_DIFFERS;
break;
}
else {
2002-10-12 11:37:38 +00:00
if (memcmp(buf, ((char *)pf->data) + i, len)) {
ret_val = PF_DIFFERS;
break;
}
}
}
2018-06-17 17:05:51 +02:00
close(file);
2002-10-12 11:37:38 +00:00
}
}
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
return(ret_val);
}
/**
* unpackFile() looks at the existing files (abs_name, local_name) and a packed file.
*
* It returns a char *to the existing file name / new file name or NULL when
* there was an error or when the user decides to cancel the operation.
*
* \warning 'abs_name' may be relative still! (use a "//" prefix) be sure to run #BLI_path_abs on it first.
*/
char *unpackFile(
ReportList *reports, const char *ref_file_name,
const char *abs_name, const char *local_name, PackedFile *pf, int how)
2002-10-12 11:37:38 +00:00
{
char *newname = NULL;
const char *temp = NULL;
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
if (pf != NULL) {
switch (how) {
case -1:
case PF_KEEP:
break;
case PF_REMOVE:
2012-05-06 17:22:54 +00:00
temp = abs_name;
break;
2002-10-12 11:37:38 +00:00
case PF_USE_LOCAL:
{
char temp_abs[FILE_MAX];
BLI_strncpy(temp_abs, local_name, sizeof(temp_abs));
BLI_path_abs(temp_abs, ref_file_name);
2012-07-07 22:51:57 +00:00
/* if file exists use it */
if (BLI_exists(temp_abs)) {
2002-10-12 11:37:38 +00:00
temp = local_name;
break;
}
/* else create it */
ATTR_FALLTHROUGH;
}
2002-10-12 11:37:38 +00:00
case PF_WRITE_LOCAL:
if (writePackedFile(reports, ref_file_name, local_name, pf, 1) == RET_OK) {
2002-10-12 11:37:38 +00:00
temp = local_name;
}
break;
case PF_USE_ORIGINAL:
{
char temp_abs[FILE_MAX];
BLI_strncpy(temp_abs, abs_name, sizeof(temp_abs));
BLI_path_abs(temp_abs, ref_file_name);
2012-07-07 22:51:57 +00:00
/* if file exists use it */
if (BLI_exists(temp_abs)) {
BKE_reportf(reports, RPT_INFO, "Use existing file (instead of packed): %s", abs_name);
2002-10-12 11:37:38 +00:00
temp = abs_name;
break;
}
/* else create it */
ATTR_FALLTHROUGH;
}
2002-10-12 11:37:38 +00:00
case PF_WRITE_ORIGINAL:
if (writePackedFile(reports, ref_file_name, abs_name, pf, 1) == RET_OK) {
2002-10-12 11:37:38 +00:00
temp = abs_name;
}
break;
default:
printf("unpackFile: unknown return_value %d\n", how);
break;
}
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
if (temp) {
2012-05-06 17:22:54 +00:00
newname = BLI_strdup(temp);
2002-10-12 11:37:38 +00:00
}
}
2018-06-17 17:05:51 +02:00
return newname;
2002-10-12 11:37:38 +00:00
}
static void unpack_generate_paths(
const char *name, ID *id, char *r_abspath, char *r_relpath, size_t abspathlen, size_t relpathlen)
{
char tempname[FILE_MAX];
char tempdir[FILE_MAXDIR];
BLI_split_dirfile(name, tempdir, tempname, sizeof(tempdir), sizeof(tempname));
if (tempname[0] == '\0') {
/* Note: we do not have any real way to re-create extension out of data... */
BLI_strncpy(tempname, id->name + 2, sizeof(tempname));
printf("%s\n", tempname);
BLI_filename_make_safe(tempname);
printf("%s\n", tempname);
}
if (tempdir[0] == '\0') {
/* Fallback to relative dir. */
BLI_strncpy(tempdir, "//", sizeof(tempdir));
}
switch (GS(id->name)) {
case ID_VF:
BLI_snprintf(r_relpath, relpathlen, "//fonts/%s", tempname);
break;
case ID_SO:
BLI_snprintf(r_relpath, relpathlen, "//sounds/%s", tempname);
break;
case ID_IM:
BLI_snprintf(r_relpath, relpathlen, "//textures/%s", tempname);
break;
default:
break;
}
{
size_t len = BLI_strncpy_rlen(r_abspath, tempdir, abspathlen);
BLI_strncpy(r_abspath + len, tempname, abspathlen - len);
}
}
2002-10-12 11:37:38 +00:00
int unpackVFont(Main *bmain, ReportList *reports, VFont *vfont, int how)
2002-10-12 11:37:38 +00:00
{
char localname[FILE_MAX], absname[FILE_MAX];
char *newname;
2002-10-12 11:37:38 +00:00
int ret_value = RET_ERROR;
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
if (vfont != NULL) {
unpack_generate_paths(vfont->name, (ID *)vfont, absname, localname, sizeof(absname), sizeof(localname));
newname = unpackFile(reports, BKE_main_blendfile_path(bmain), absname, localname, vfont->packedfile, how);
2002-10-12 11:37:38 +00:00
if (newname != NULL) {
ret_value = RET_OK;
freePackedFile(vfont->packedfile);
vfont->packedfile = NULL;
BLI_strncpy(vfont->name, newname, sizeof(vfont->name));
2002-10-12 11:37:38 +00:00
MEM_freeN(newname);
}
}
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
return (ret_value);
}
int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how)
2002-10-12 11:37:38 +00:00
{
char localname[FILE_MAX], absname[FILE_MAX];
char *newname;
2002-10-12 11:37:38 +00:00
int ret_value = RET_ERROR;
if (sound != NULL) {
unpack_generate_paths(sound->name, (ID *)sound, absname, localname, sizeof(absname), sizeof(localname));
newname = unpackFile(reports, BKE_main_blendfile_path(bmain), absname, localname, sound->packedfile, how);
2002-10-12 11:37:38 +00:00
if (newname != NULL) {
BLI_strncpy(sound->name, newname, sizeof(sound->name));
2002-10-12 11:37:38 +00:00
MEM_freeN(newname);
freePackedFile(sound->packedfile);
sound->packedfile = NULL;
BKE_sound_load(bmain, sound);
2002-10-12 11:37:38 +00:00
ret_value = RET_OK;
}
}
2018-06-17 17:05:51 +02:00
2002-10-12 11:37:38 +00:00
return(ret_value);
}
int unpackImage(Main *bmain, ReportList *reports, Image *ima, int how)
2002-10-12 11:37:38 +00:00
{
int ret_value = RET_ERROR;
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
if (ima != NULL) {
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
while (ima->packedfiles.last) {
char localname[FILE_MAX], absname[FILE_MAX];
char *newname;
ImagePackedFile *imapf = ima->packedfiles.last;
unpack_generate_paths(imapf->filepath, (ID *)ima, absname, localname, sizeof(absname), sizeof(localname));
newname = unpackFile(reports, BKE_main_blendfile_path(bmain), absname, localname, imapf->packedfile, how);
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
if (newname != NULL) {
ImageView *iv;
ret_value = ret_value == RET_ERROR ? RET_ERROR : RET_OK;
freePackedFile(imapf->packedfile);
imapf->packedfile = NULL;
/* update the new corresponding view filepath */
iv = BLI_findstring(&ima->views, imapf->filepath, offsetof(ImageView, filepath));
if (iv) {
BLI_strncpy(iv->filepath, newname, sizeof(imapf->filepath));
}
/* keep the new name in the image for non-pack specific reasons */
if (how != PF_REMOVE) {
BLI_strncpy(ima->name, newname, sizeof(imapf->filepath));
}
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
MEM_freeN(newname);
}
else {
ret_value = RET_ERROR;
}
BLI_remlink(&ima->packedfiles, imapf);
MEM_freeN(imapf);
2002-10-12 11:37:38 +00:00
}
}
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
if (ret_value == RET_OK) {
BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_RELOAD);
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
}
2002-10-12 11:37:38 +00:00
return(ret_value);
}
int unpackLibraries(Main *bmain, ReportList *reports)
{
Library *lib;
char *newname;
int ret_value = RET_ERROR;
2018-06-17 17:05:51 +02:00
for (lib = bmain->library.first; lib; lib = lib->id.next) {
if (lib->packedfile && lib->name[0]) {
2018-06-17 17:05:51 +02:00
newname = unpackFile(reports, BKE_main_blendfile_path(bmain), lib->filepath, lib->filepath, lib->packedfile, PF_WRITE_ORIGINAL);
if (newname != NULL) {
ret_value = RET_OK;
2018-06-17 17:05:51 +02:00
printf("Unpacked .blend library: %s\n", newname);
2018-06-17 17:05:51 +02:00
freePackedFile(lib->packedfile);
lib->packedfile = NULL;
MEM_freeN(newname);
}
}
}
2018-06-17 17:05:51 +02:00
return(ret_value);
}
void packLibraries(Main *bmain, ReportList *reports)
{
Library *lib;
2018-06-17 17:05:51 +02:00
/* test for relativenss */
for (lib = bmain->library.first; lib; lib = lib->id.next)
if (!BLI_path_is_rel(lib->name))
break;
2018-06-17 17:05:51 +02:00
if (lib) {
BKE_reportf(reports, RPT_ERROR, "Cannot pack absolute file: '%s'", lib->name);
return;
}
2018-06-17 17:05:51 +02:00
for (lib = bmain->library.first; lib; lib = lib->id.next)
if (lib->packedfile == NULL)
lib->packedfile = newPackedFile(reports, lib->name, BKE_main_blendfile_path(bmain));
}
void unpackAll(Main *bmain, ReportList *reports, int how)
2002-10-12 11:37:38 +00:00
{
Image *ima;
VFont *vf;
bSound *sound;
2002-10-12 11:37:38 +00:00
2012-05-06 17:22:54 +00:00
for (ima = bmain->image.first; ima; ima = ima->id.next)
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
if (BKE_image_has_packedfile(ima))
unpackImage(bmain, reports, ima, how);
2012-05-06 17:22:54 +00:00
for (vf = bmain->vfont.first; vf; vf = vf->id.next)
if (vf->packedfile)
unpackVFont(bmain, reports, vf, how);
2012-05-06 17:22:54 +00:00
for (sound = bmain->sound.first; sound; sound = sound->id.next)
if (sound->packedfile)
unpackSound(bmain, reports, sound, how);
2002-10-12 11:37:38 +00:00
}
/* ID should be not NULL, return 1 if there's a packed file */
2013-03-09 05:35:49 +00:00
bool BKE_pack_check(ID *id)
{
switch (GS(id->name)) {
case ID_IM:
{
Image *ima = (Image *)id;
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
return BKE_image_has_packedfile(ima);
}
case ID_VF:
{
VFont *vf = (VFont *)id;
return vf->packedfile != NULL;
}
case ID_SO:
{
bSound *snd = (bSound *)id;
return snd->packedfile != NULL;
}
case ID_LI:
{
Library *li = (Library *)id;
return li->packedfile != NULL;
}
default:
break;
}
2013-03-09 05:35:49 +00:00
return false;
}
/* ID should be not NULL */
void BKE_unpack_id(Main *bmain, ID *id, ReportList *reports, int how)
{
switch (GS(id->name)) {
case ID_IM:
{
Image *ima = (Image *)id;
Multi-View and Stereo 3D Official Documentation: http://www.blender.org/manual/render/workflows/multiview.html Implemented Features ==================== Builtin Stereo Camera * Convergence Mode * Interocular Distance * Convergence Distance * Pivot Mode Viewport * Cameras * Plane * Volume Compositor * View Switch Node * Image Node Multi-View OpenEXR support Sequencer * Image/Movie Strips 'Use Multiview' UV/Image Editor * Option to see Multi-View images in Stereo-3D or its individual images * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images I/O * Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images Scene Render Views * Ability to have an arbitrary number of views in the scene Missing Bits ============ First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report. Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report. Everything else is likely small todos, and may wait until we are sure none of the above is happening. Apart from that there are those known issues: * Compositor Image Node poorly working for Multi-View OpenEXR (this was working prefectly before the 'Use Multi-View' functionality) * Selecting camera from Multi-View when looking from camera is problematic * Animation Playback (ctrl+F11) doesn't support stereo formats * Wrong filepath when trying to play back animated scene * Viewport Rendering doesn't support Multi-View * Overscan Rendering * Fullscreen display modes need to warn the user * Object copy should be aware of views suffix Acknowledgments =============== * Francesco Siddi for the help with the original feature specs and design * Brecht Van Lommel for the original review of the code and design early on * Blender Foundation for the Development Fund to support the project wrap up Final patch reviewers: * Antony Riakiotakis (psy-fi) * Campbell Barton (ideasman42) * Julian Eisel (Severin) * Sergey Sharybin (nazgul) * Thomas Dinged (dingto) Code contributors of the original branch in github: * Alexey Akishin * Gabriel Caraballo
2015-04-06 10:40:12 -03:00
if (BKE_image_has_packedfile(ima)) {
unpackImage(bmain, reports, ima, how);
}
break;
}
case ID_VF:
{
VFont *vf = (VFont *)id;
if (vf->packedfile) {
unpackVFont(bmain, reports, vf, how);
}
break;
}
case ID_SO:
{
bSound *snd = (bSound *)id;
if (snd->packedfile) {
unpackSound(bmain, reports, snd, how);
}
break;
}
case ID_LI:
{
Library *li = (Library *)id;
BKE_reportf(reports, RPT_ERROR, "Cannot unpack individual Library file, '%s'", li->name);
break;
}
default:
break;
}
}