From 957e292c5864cba3cf62c7c59dc644422660034f Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 12 Jan 2021 16:19:54 +0100 Subject: 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 --- source/blender/compositor/nodes/COM_OutputFileNode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/compositor/nodes') diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cpp b/source/blender/compositor/nodes/COM_OutputFileNode.cpp index 09528e09f1f..e0cff1de276 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.cpp +++ b/source/blender/compositor/nodes/COM_OutputFileNode.cpp @@ -50,7 +50,8 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, OutputOpenExrMultiLayerOperation *outputOperation; if (is_multiview && storage->format.views_format == R_IMF_VIEWS_MULTIVIEW) { - outputOperation = new OutputOpenExrMultiLayerMultiViewOperation(context.getRenderData(), + outputOperation = new OutputOpenExrMultiLayerMultiViewOperation(context.getScene(), + context.getRenderData(), context.getbNodeTree(), storage->base_path, storage->format.exr_codec, @@ -58,7 +59,8 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, context.getViewName()); } else { - outputOperation = new OutputOpenExrMultiLayerOperation(context.getRenderData(), + outputOperation = new OutputOpenExrMultiLayerOperation(context.getScene(), + context.getRenderData(), context.getbNodeTree(), storage->base_path, storage->format.exr_codec, -- cgit v1.2.3