Saturation {
name WaveSaturation
label "Saturation: \[format \"%.2f\" \[value saturation]]"
selected true
xpos -1140
ypos -136
addUserKnob {20 User}
addUserKnob {22 random_wave l "Add Random Wave" T "# Add Random Wave\nwaveMul = nuke.thisNode()\nknob = nuke.thisKnob()\n\nif knob.label() == \"Add Random Wave\":\n knob1 = waveMul\['random_wave']\n knob1.setLabel(\"Random Wave Added\")\n\n knob2 = waveMul\['sine_wave']\n knob2.setLabel(\"Add Sine Wave\")\n\n knob3 = waveMul\['triangle_wave']\n knob3.setLabel(\"Add Triangle Wave\")\n\n knob4 = waveMul\['square_wave']\n knob4.setLabel(\"Add Square Wave\")\n\n knob5 = waveMul\['sawtooth_wave']\n knob5.setLabel(\"Add Sawtooth Wave\")\n\n knob6 = waveMul\['bounce_wave']\n knob6.setLabel(\"Add Bounce Wave\")\n\n waveMul\['saturation'].clearAnimated()\n waveMul\['saturation'].setExpression(\"random((frame+offset)/waveLength) * (maxVal-minVal) + minVal\")\n\nelse:\n nuke.message(\"\"\"
Random Wave is already added!\"\"\")" +STARTLINE}
addUserKnob {22 sine_wave l "Add Sine Wave" -STARTLINE T "# Add Sine Wave\nwaveMul = nuke.thisNode()\nknob = nuke.thisKnob()\n\nif knob.label() == \"Add Sine Wave\":\n knob1 = waveMul\['random_wave']\n knob1.setLabel(\"Add Random Wave\")\n\n knob2 = waveMul\['sine_wave']\n knob2.setLabel(\"Sine Wave Added\")\n\n knob3 = waveMul\['triangle_wave']\n knob3.setLabel(\"Add Triangle Wave\")\n\n knob4 = waveMul\['square_wave']\n knob4.setLabel(\"Add Square Wave\")\n\n knob5 = waveMul\['sawtooth_wave']\n knob5.setLabel(\"Add Sawtooth Wave\")\n\n knob6 = waveMul\['bounce_wave']\n knob6.setLabel(\"Add Bounce Wave\")\n\n waveMul\['saturation'].clearAnimated()\n waveMul\['saturation'].setExpression(\"(sin(2*pi*(frame+offset)/waveLength)+1)/2 * (maxVal-minVal) + minVal\")\n\nelse:\n nuke.message(\"\"\"Sine Wave is already added!\"\"\")"}
addUserKnob {22 triangle_wave l "Add Triangle Wave" -STARTLINE T "# Add Triangle Wave\nwaveMul = nuke.thisNode()\nknob = nuke.thisKnob()\n\nif knob.label() == \"Add Triangle Wave\":\n knob1 = waveMul\['random_wave']\n knob1.setLabel(\"Add Random Wave\")\n\n knob2 = waveMul\['sine_wave']\n knob2.setLabel(\"Add Sine Wave\")\n\n knob3 = waveMul\['triangle_wave']\n knob3.setLabel(\"Triangle Wave Added\")\n\n knob4 = waveMul\['square_wave']\n knob4.setLabel(\"Add Square Wave\")\n\n knob5 = waveMul\['sawtooth_wave']\n knob5.setLabel(\"Add Sawtooth Wave\")\n\n knob6 = waveMul\['bounce_wave']\n knob6.setLabel(\"Add Bounce Wave\")\n\n waveMul\['saturation'].clearAnimated()\n waveMul\['saturation'].setExpression(\"(asin(sin(2*pi*(frame+offset)/waveLength))/pi+0.5) * (maxVal-minVal) + minVal\")\n\nelse:\n nuke.message(\"\"\"Triangle Wave is already added!\"\"\")"}
addUserKnob {22 square_wave l "Add Square Wave" T "# Add Square Wave\nwaveMul = nuke.thisNode()\nknob = nuke.thisKnob()\n\nif knob.label() == \"Add Square Wave\":\n knob1 = waveMul\['random_wave']\n knob1.setLabel(\"Add Random Wave\")\n\n knob2 = waveMul\['sine_wave']\n knob2.setLabel(\"Add Sine Wave\")\n\n knob3 = waveMul\['triangle_wave']\n knob3.setLabel(\"Add Triangle Wave\")\n\n knob4 = waveMul\['square_wave']\n knob4.setLabel(\"Square Wave Added\")\n\n knob5 = waveMul\['sawtooth_wave']\n knob5.setLabel(\"Add Sawtooth Wave\")\n\n knob6 = waveMul\['bounce_wave']\n knob6.setLabel(\"Add Bounce Wave\")\n\n waveMul\['saturation'].clearAnimated()\n waveMul\['saturation'].setExpression(\"int(sin(2*pi*(frame+offset)/waveLength)+1) * (maxVal-minVal) + minVal\")\n\nelse:\n nuke.message(\"\"\"Square Wave is already added!\"\"\")" +STARTLINE}
addUserKnob {22 sawtooth_wave l "Add Sawtooth Wave" -STARTLINE T "# Add Sawtooth Wave\nwaveMul = nuke.thisNode()\nknob = nuke.thisKnob()\n\nif knob.label() == \"Add Sawtooth Wave\":\n knob1 = waveMul\['random_wave']\n knob1.setLabel(\"Add Random Wave\")\n\n knob2 = waveMul\['sine_wave']\n knob2.setLabel(\"Add Sine Wave\")\n\n knob3 = waveMul\['triangle_wave']\n knob3.setLabel(\"Add Triangle Wave\")\n\n knob4 = waveMul\['square_wave']\n knob4.setLabel(\"Add Square Wave\")\n\n knob5 = waveMul\['sawtooth_wave']\n knob5.setLabel(\"Sawtooth Wave Added\")\n\n knob6 = waveMul\['bounce_wave']\n knob6.setLabel(\"Add Bounce Wave\")\n\n waveMul\['saturation'].clearAnimated()\n waveMul\['saturation'].setExpression(\"((frame+offset) % waveLength)/waveLength * (maxVal-minVal) + minVal\")\n\nelse:\n nuke.message(\"\"\"Sawtooth Wave is already added!\"\"\")"}
addUserKnob {22 bounce_wave l "Add Bounce Wave" -STARTLINE T "# Add Bounce Wave\nwaveMul = nuke.thisNode()\nknob = nuke.thisKnob()\n\nif knob.label() == \"Add Bounce Wave\":\n knob1 = waveMul\['random_wave']\n knob1.setLabel(\"Add Random Wave\")\n\n knob2 = waveMul\['sine_wave']\n knob2.setLabel(\"Add Sine Wave\")\n\n knob3 = waveMul\['triangle_wave']\n knob3.setLabel(\"Add Triangle Wave\")\n\n knob4 = waveMul\['square_wave']\n knob4.setLabel(\"Add Square Wave\")\n\n knob5 = waveMul\['sawtooth_wave']\n knob5.setLabel(\"Add Sawtooth Wave\")\n\n knob6 = waveMul\['bounce_wave']\n knob6.setLabel(\"Bounce Wave Added\")\n\n waveMul\['saturation'].clearAnimated()\n waveMul\['saturation'].setExpression(\"abs(sin(pi*(frame + offset)/waveLength))* (maxVal-minVal) + minVal\")\n\nelse:\n nuke.message(\"\"\"Bounce Wave is already added!\"\"\")"}
addUserKnob {26 ""}
addUserKnob {7 waveLength R 0 100}
waveLength 20
addUserKnob {7 maxVal R 0 5}
maxVal 1
addUserKnob {7 minVal R 0 5}
addUserKnob {7 offset R 0 100}
addUserKnob {26 ""}
addUserKnob {22 set_to l "Set to 1" T "# Set to 1\nwaveMul = nuke.thisNode()\nknob1 = waveMul\['random_wave']\nknob1.setLabel(\"Add Random Wave\")\n\nknob2 = waveMul\['sine_wave']\nknob2.setLabel(\"Add Sine Wave\")\n\nknob3 = waveMul\['triangle_wave']\nknob3.setLabel(\"Add Triangle Wave\")\n\nknob4 = waveMul\['square_wave']\nknob4.setLabel(\"Add Square Wave\")\n\nknob5 = waveMul\['sawtooth_wave']\nknob5.setLabel(\"Add Sawtooth Wave\")\n\nknob6 = waveMul\['bounce_wave']\nknob6.setLabel(\"Add Bounce Wave\")\n\nwaveMul\['saturation'].clearAnimated()\nwaveMul\['saturation'].setValue(1)" +STARTLINE}
addUserKnob {26 ""}
addUserKnob {26 info l "" +STARTLINE T "modified by Attila Gasparetz | v1.01 | 2020 | "}
addUserKnob {26 link l "" -STARTLINE T "For more info"}
}