if-else-v

gweimer/utils/if-else-v

Return T associated with last COND that is True, or return F if no COND is True.
if-else-v
@/if-else-v
Return T associated with last COND that is True, or return F if no COND is True.
Fgeneric t1
CONDboolean (variadic)
Condition value
Tgeneric t1 (variadic)
if-else-v
F
COND
T
R
Rgeneric t1
To use the node in your project you should have the gweimer/utils library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto cond = getValue<input_COND>(ctx);
    auto trueVal = getValue<input_T>(ctx);
    auto falseVal = getValue<input_F>(ctx);
    emitValue<output_R>(ctx, cond ? trueVal : falseVal);
}