diff options
author | Jeroen Bakker <jbakker> | 2021-03-02 13:08:04 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-02 13:20:01 +0300 |
commit | 2d4b638a674522507917b5f34ad8b5463ff42eb4 (patch) | |
tree | 0d0a204691aede18a4863e38de267fbfb940bc7d /source/blender/compositor/nodes/COM_ImageNode.cpp | |
parent | 8dec6452f22013ee98246ea6d7631c2201a6de3a (diff) |
Cryptomatte: Read metadata from multilayer OpenEXR.
Currently the compositor reads cryptomatte meta-data from the render
result. When loading a multilayer open exr file the meta-data was ignored.
This patch will also load the cryptomatte meta-data from multilayer open
exr files.
This enabled workflows where the rendering and compositing are done in
separate scenes or for future changes where the cryptomatte node will
use the meta-data for name matching and color picking.
Reviewed By: Sergey Sharybin
Differential Revision: https://developer.blender.org/D10384
Diffstat (limited to 'source/blender/compositor/nodes/COM_ImageNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_ImageNode.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp index 596a448e6a0..69729e018d7 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cpp +++ b/source/blender/compositor/nodes/COM_ImageNode.cpp @@ -34,12 +34,12 @@ ImageNode::ImageNode(bNode *editorNode) : Node(editorNode) /* pass */ } NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, - RenderLayer *rl, + RenderLayer *render_layer, + RenderPass *render_pass, Image *image, ImageUser *user, int framenumber, int outputsocketIndex, - int passindex, int view, DataType datatype) const { @@ -47,19 +47,18 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, MultilayerBaseOperation *operation = nullptr; switch (datatype) { case COM_DT_VALUE: - operation = new MultilayerValueOperation(passindex, view); + operation = new MultilayerValueOperation(render_layer, render_pass, view); break; case COM_DT_VECTOR: - operation = new MultilayerVectorOperation(passindex, view); + operation = new MultilayerVectorOperation(render_layer, render_pass, view); break; case COM_DT_COLOR: - operation = new MultilayerColorOperation(passindex, view); + operation = new MultilayerColorOperation(render_layer, render_pass, view); break; default: break; } operation->setImage(image); - operation->setRenderLayer(rl); operation->setImageUser(user); operation->setFramenumber(framenumber); @@ -128,16 +127,15 @@ void ImageNode::convertToOperations(NodeConverter &converter, } if (rpass) { - int passindex = BLI_findindex(&rl->passes, rpass); switch (rpass->channels) { case 1: operation = doMultilayerCheck(converter, rl, + rpass, image, imageuser, framenumber, index, - passindex, view, COM_DT_VALUE); break; @@ -146,22 +144,22 @@ void ImageNode::convertToOperations(NodeConverter &converter, case 3: operation = doMultilayerCheck(converter, rl, + rpass, image, imageuser, framenumber, index, - passindex, view, COM_DT_VECTOR); break; case 4: operation = doMultilayerCheck(converter, rl, + rpass, image, imageuser, framenumber, index, - passindex, view, COM_DT_COLOR); break; |