diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-09-13 12:57:57 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-09-13 13:46:19 +0300 |
commit | 17a117c7a002511b814be118c6f47d531b56ea68 (patch) | |
tree | 6ed7321e95ca990cf0294ae15615bf867a7ec0d2 | |
parent | 4fde0910d5236a83845c1f6428a57af723df42d9 (diff) |
Compositor: Cleanup, de-duplicate some code
-rw-r--r-- | source/blender/compositor/nodes/COM_RenderLayersNode.cpp | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp index a3b804e4559..b9ad083a863 100644 --- a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp +++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp @@ -77,42 +77,36 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter, if (rpass == NULL) { continue; } + RenderLayersProg *operation; + bool is_preview; if (STREQ(rpass->name, RE_PASSNAME_COMBINED) && STREQ(output->getbNodeSocket()->name, "Alpha")) { - testSocketLink(converter, - context, - output, - new RenderLayersAlphaProg(rpass->name, - COM_DT_VALUE, - rpass->channels), - scene, - layerId, - false); + operation = new RenderLayersAlphaProg(rpass->name, + COM_DT_VALUE, + rpass->channels); + is_preview = false; } else if (STREQ(rpass->name, RE_PASSNAME_Z)) { - testSocketLink(converter, - context, - output, - new RenderLayersDepthProg(rpass->name, - COM_DT_VALUE, - rpass->channels), - scene, - layerId, - false); + operation = new RenderLayersDepthProg(rpass->name, + COM_DT_VALUE, + rpass->channels); + is_preview = false; } else { DataType type = ((rpass->channels == 4)? COM_DT_COLOR : ((rpass->channels == 3)? COM_DT_VECTOR : COM_DT_VALUE)); - testSocketLink(converter, - context, - output, - new RenderLayersProg(rpass->name, - type, - rpass->channels), - scene, - layerId, - STREQ(output->getbNodeSocket()->name, "Image")); + operation = new RenderLayersProg(rpass->name, + type, + rpass->channels); + is_preview = STREQ(output->getbNodeSocket()->name, "Image"); } + testSocketLink(converter, + context, + output, + operation, + scene, + layerId, + is_preview); } } |