diff options
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r-- | source/blender/compositor/nodes/COM_RenderLayersNode.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp index b9ad083a863..83049c21b0a 100644 --- a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp +++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp @@ -94,7 +94,16 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter, is_preview = false; } else { - DataType type = ((rpass->channels == 4)? COM_DT_COLOR : ((rpass->channels == 3)? COM_DT_VECTOR : COM_DT_VALUE)); + DataType type; + switch (rpass->channels) { + case 4: type = COM_DT_COLOR; break; + case 3: type = COM_DT_VECTOR; break; + case 1: type = COM_DT_VALUE; break; + default: + BLI_assert(!"Unexpected number of channels for pass"); + type = COM_DT_VALUE; + break; + } operation = new RenderLayersProg(rpass->name, type, rpass->channels); |