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
Normalize between -1 and 1
Normalise between a and b
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
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)"}} }