[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45368] trunk/blender/source/blender/imbuf /intern/openexr/openexr_api.cpp: Make sure Multilayer EXR from other apps are read in as multilayer.
Nathan Letwory
nathan at letworyinteractive.com
Tue Apr 3 13:53:48 CEST 2012
Revision: 45368
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45368
Author: jesterking
Date: 2012-04-03 11:53:38 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Make sure Multilayer EXR from other apps are read in as multilayer.
Modified Paths:
--------------
trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
Modified: trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
===================================================================
--- trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp 2012-04-03 11:19:58 UTC (rev 45367)
+++ trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp 2012-04-03 11:53:38 UTC (rev 45368)
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stddef.h>
#include <string>
+#include <set>
#include <openexr_api.h>
@@ -945,12 +946,17 @@
return !(file->header().channels().findChannel("Z") == NULL);
}
-static int exr_is_renderresult(InputFile *file)
+static int exr_is_multilayer(InputFile *file)
{
const StringAttribute *comments= file->header().findTypedAttribute<StringAttribute>("BlenderMultiChannel");
- if (comments)
-// if (comments->value() == "Blender MultiChannel")
+ const ChannelList &channels = file->header().channels();
+ std::set <std::string> layerNames;
+
+ channels.layers(layerNames);
+
+ if (comments || layerNames.size()>1)
return 1;
+
return 0;
}
@@ -977,7 +983,7 @@
if (0) // debug
exr_print_filecontents(file);
- is_multi= exr_is_renderresult(file);
+ is_multi= exr_is_multilayer(file);
/* do not make an ibuf when */
if (is_multi && !(flags & IB_test) && !(flags & IB_multilayer))
More information about the Bf-blender-cvs
mailing list