Normalize and Blend expressions

Another personal reminder note so that I can actually remember how to do this without having to spend a few dozen minutes googling it…

Normalizing values between 2 bounds

Normalize between 0 and 1

$${x' = \frac{x - \min{x}}{\max{x} - \min{x}}}$$

Normalize between -1 and 1

$${x'' = 2\frac{x - \min{x}}{\max{x} - \min{x}}-1}$$

Normalise between a and b

$${x''' = (b-a)\frac{x - \min{x}}{\max{x} - \min{x}} + a}$$

Nuke node

NoOp { name NormaliseValues selected true xpos -5265 ypos 718 addUserKnob {20 User} addUserKnob {7 val} val 1 addUserKnob {7 minval} minval 0 addUserKnob {7 maxval} maxval 10 addUserKnob {26 "" +STARTLINE} addUserKnob {7 upperbound} upperbound 1 addUserKnob {7 lowerbound} addUserKnob {26 "" +STARTLINE} addUserKnob {7 result} result {{"(upperbound-lowerbound) * ((val - minval) / (maxval - minval)) + lowerbound"}} }

Blend 2 values

With w : [0;1] $$x=Aw + B(1-w)$$

Nuke node

NoOp { name BlendValues selected true xpos -5080 ypos 784 addUserKnob {20 User} addUserKnob {7 val1 R -10 10} addUserKnob {7 val2 R -10 10} val2 1 addUserKnob {7 blender} blender 1 addUserKnob {26 "" +STARTLINE} addUserKnob {7 result R -10 10} result {{"val2 * blender + val1 * (1-blender)"}} }