diff options
Diffstat (limited to 'source/blender/compositor')
3 files changed, 16 insertions, 15 deletions
diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp index 572e63a2ced..facd422c217 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cpp +++ b/source/blender/compositor/nodes/COM_ImageNode.cpp @@ -40,19 +40,19 @@ ImageNode::ImageNode(bNode *editorNode) : Node(editorNode) } NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, RenderLayer *rl, Image *image, ImageUser *user, - int framenumber, int outputsocketIndex, int passtype, int view, DataType datatype) const + int framenumber, int outputsocketIndex, int passindex, int view, DataType datatype) const { NodeOutput *outputSocket = this->getOutputSocket(outputsocketIndex); MultilayerBaseOperation *operation = NULL; switch (datatype) { case COM_DT_VALUE: - operation = new MultilayerValueOperation(passtype, view); + operation = new MultilayerValueOperation(passindex, view); break; case COM_DT_VECTOR: - operation = new MultilayerVectorOperation(passtype, view); + operation = new MultilayerVectorOperation(passindex, view); break; case COM_DT_COLOR: - operation = new MultilayerColorOperation(passtype, view); + operation = new MultilayerColorOperation(passindex, view); break; default: break; @@ -124,20 +124,21 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo } if (rpass) { + int passindex = BLI_findindex(&rl->passes, rpass); switch (rpass->channels) { case 1: operation = doMultilayerCheck(converter, rl, image, imageuser, framenumber, index, - rpass->passtype, view, COM_DT_VALUE); + passindex, view, COM_DT_VALUE); break; /* using image operations for both 3 and 4 channels (RGB and RGBA respectively) */ /* XXX any way to detect actual vector images? */ case 3: operation = doMultilayerCheck(converter, rl, image, imageuser, framenumber, index, - rpass->passtype, view, COM_DT_VECTOR); + passindex, view, COM_DT_VECTOR); break; case 4: operation = doMultilayerCheck(converter, rl, image, imageuser, framenumber, index, - rpass->passtype, view, COM_DT_COLOR); + passindex, view, COM_DT_COLOR); break; default: /* dummy operation is added below */ diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp index 00be3b1cdde..b57dd4e32c3 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp @@ -27,9 +27,9 @@ extern "C" { # include "IMB_imbuf_types.h" } -MultilayerBaseOperation::MultilayerBaseOperation(int passtype, int view) : BaseImageOperation() +MultilayerBaseOperation::MultilayerBaseOperation(int passindex, int view) : BaseImageOperation() { - this->m_passtype = passtype; + this->m_passId = passindex; this->m_view = view; } @@ -39,7 +39,7 @@ ImBuf *MultilayerBaseOperation::getImBuf() int view = this->m_imageUser->view; this->m_imageUser->view = this->m_view; - this->m_imageUser->passtype = this->m_passtype; + this->m_imageUser->pass = this->m_passId; if (BKE_image_multilayer_index(this->m_image->rr, this->m_imageUser)) { ImBuf *ibuf = BaseImageOperation::getImBuf(); diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.h b/source/blender/compositor/operations/COM_MultilayerImageOperation.h index 2e140577d74..46a9319c373 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.h +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.h @@ -29,7 +29,7 @@ class MultilayerBaseOperation : public BaseImageOperation { private: - int m_passtype; + int m_passId; int m_view; RenderLayer *m_renderlayer; protected: @@ -38,13 +38,13 @@ public: /** * Constructor */ - MultilayerBaseOperation(int passtype, int view); + MultilayerBaseOperation(int passindex, int view); void setRenderLayer(RenderLayer *renderlayer) { this->m_renderlayer = renderlayer; } }; class MultilayerColorOperation : public MultilayerBaseOperation { public: - MultilayerColorOperation(int passtype, int view) : MultilayerBaseOperation(passtype, view) { + MultilayerColorOperation(int passindex, int view) : MultilayerBaseOperation(passindex, view) { this->addOutputSocket(COM_DT_COLOR); } void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); @@ -52,7 +52,7 @@ public: class MultilayerValueOperation : public MultilayerBaseOperation { public: - MultilayerValueOperation(int passtype, int view) : MultilayerBaseOperation(passtype, view) { + MultilayerValueOperation(int passindex, int view) : MultilayerBaseOperation(passindex, view) { this->addOutputSocket(COM_DT_VALUE); } void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); @@ -60,7 +60,7 @@ public: class MultilayerVectorOperation : public MultilayerBaseOperation { public: - MultilayerVectorOperation(int passtype, int view) : MultilayerBaseOperation(passtype, view) { + MultilayerVectorOperation(int passindex, int view) : MultilayerBaseOperation(passindex, view) { this->addOutputSocket(COM_DT_VECTOR); } void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); |