Compositor: Cleanup, get rid of nested ternary operators
Having single switch statement is much more readable.
This commit is contained in:
parent
17a117c7a0
commit
f472aea922
Notes:
blender-bot
2023-02-14 06:17:18 +01:00
Referenced by issue #53683, 2.79a release
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue