Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

value.switch (procNode)

One of two values by a Bool: ifTrue when when is true, ifFalse otherwise. Only the branch taken cooks, so a branch that would refuse its inputs is never asked.

Inputs

  • when (Bool, default false): which value is taken.
  • ifTrue (Any, default 1): taken when when is true.
  • ifFalse (Any, default 0): taken when when is false.

Outputs

  • value (Any): the value taken.

Example

local shape = g.value.switch({ when = true, ifTrue = g.sdf.sphere({ radius = 0.5 }), ifFalse = g.sdf.box({}) })