Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-01-12 18:19:54 +0300
committerJeroen Bakker <jeroen@blender.org>2021-01-12 18:24:26 +0300
commit957e292c5864cba3cf62c7c59dc644422660034f (patch)
treeb182f75cf4d61dd3401f4dbe59d3ab3df1642897 /source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
parentc3b68fa7b1cafa6c4e4b73830597582606082b6d (diff)
Fix T64953: Add cryptomatte meta data to file output node.
This change will try to add meta data when using a multilayered open exr file output node in the compositor. It adds the current scene meta data and converts existing cryptomatte keys so it follows the naming that is configured in the file output node. This change supports the basic use-case where the compositor is used to output cryptomatte layers with a different naming scheme to support external compositors. In this case the Multilayered OpenEXR files are used and the meta data is read from the render result. Meta data is found when render layer node is connected with the file output node without any other nodes in between. Redirects and empty node groups are allowed. The patch has been verified to work with external compositors. See https://devtalk.blender.org/t/making-sense-of-cryptomatte-usage-in-third-party-programs/16576/17 See patch for example files. Reviewed By: Sergey Sharybin Differential Revision: https://developer.blender.org/D10016
Diffstat (limited to 'source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
index 21d9177ddd5..0b732357c92 100644
--- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
@@ -143,13 +143,14 @@ void OutputOpenExrSingleLayerMultiViewOperation::deinitExecution()
/************************************ OpenEXR Multilayer Multiview *******************************/
OutputOpenExrMultiLayerMultiViewOperation::OutputOpenExrMultiLayerMultiViewOperation(
+ const Scene *scene,
const RenderData *rd,
const bNodeTree *tree,
const char *path,
char exr_codec,
bool exr_half_float,
const char *viewName)
- : OutputOpenExrMultiLayerOperation(rd, tree, path, exr_codec, exr_half_float, viewName)
+ : OutputOpenExrMultiLayerOperation(scene, rd, tree, path, exr_codec, exr_half_float, viewName)
{
}
@@ -195,12 +196,16 @@ void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename
BLI_make_existing_file(filename);
/* prepare the file with all the channels for the header */
- if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_exr_codec, nullptr) == 0) {
+ StampData *stamp_data = createStampData();
+ if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_exr_codec, stamp_data) ==
+ 0) {
printf("Error Writing Multilayer Multiview Openexr\n");
IMB_exr_close(exrhandle);
+ BKE_stamp_data_free(stamp_data);
}
else {
IMB_exr_clear_channels(exrhandle);
+ BKE_stamp_data_free(stamp_data);
return exrhandle;
}
}