Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set cut_paste_input [stack 0]
- version 9.0 v8
- BackdropNode {
- inputs 0
- name BackdropNode7
- tile_color 0x79b0b0ff
- label "effet optic\n"
- note_font_size 42
- selected true
- xpos 276
- ypos -851
- bdwidth 808
- bdheight 691
- }
- Group {
- inputs 0
- name ExpressionWaveGenerator
- help "Allows the easy creation of a variety of Waveform Expressions for use in manipulating knob values."
- selected true
- xpos 615
- ypos -450
- addUserKnob {20 main l Main}
- addUserKnob {26 unnamed_1 l "" +STARTLINE T " "}
- addUserKnob {68 type l "Wave Type" t "Controls what type of wave to generate." M {Random Noise Sine Triangle Square Sawtooth/Sawtooth "Sawtooth/Sawtooth (Parabolic)" "Sawtooth/Sawtooth (Parabolic reversed)" "Sawtooth/Sawtooth (Exponential)" Bounce "" "" "" "" ""}}
- type Sine
- addUserKnob {7 minVal l "Min Value" t "Minimum value you want the wave to reach." R 0 10}
- minVal -3
- addUserKnob {7 maxVal l "Max Value" t "Maximum value you want the wave to reach." -STARTLINE R 0 10}
- maxVal 3
- addUserKnob {7 waveLength l WaveLength t "Controls the frequency or cycle length of the wave. The number of frames before the pattern repeats." R 0 50}
- waveLength 12
- addUserKnob {7 offset l Offset t "Offsets the frame value to allow control of values at a certain frame" R 0 10}
- offset -3
- addUserKnob {26 unnamed l "" +STARTLINE T " "}
- addUserKnob {22 expButton l "Generate Expression" T "node = nuke.thisNode()\ntype = node.knob('type').getValue()\nexpText = node.knob('expText')\nexpFormula = node.knob('formula')\nexpResult = node.knob('expResult')\ndef setExp():\n if type == 0: #Random\n exp = 'random((frame+%s)/%s) * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 1: #Noise\n exp = '(noise((frame+%s)/%s)+1)/2 * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 2: #Sine\n exp = '(sin(2*pi*(frame+%s)/%s)+1)/2 * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 3: #Triangle\n exp = '(asin(sin(2*pi*(frame+%s)/%s))/pi+0.5) * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 4: #Square\n exp = 'int(sin(2*pi*(frame+%s)/%s)+1) * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 5: #Sawtooth\n exp = '((frame+%s) %% %s)/%s * (%s-%s) + %s' %(offset,waveLength,waveLength,maxVal,minVal,minVal)\n if type == 6: #Sawtooth(Parabolic)\n exp = 'sin((4.93480220054468*(frame+%s)/(pi*%s)) %% (pi/2)) * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 7: #Sawtooth(Parabolic Reversed)\n exp = 'cos((4.93480220054468*(frame+%s)/(pi*%s)) %% (pi/2)) * (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n if type == 8: #Sawtooth (Exponential)\n exp = '(exp(2*pi*((frame+%s) %% %s)/%s)-1)/exp(2*pi) * (%s-%s) + %s' %(offset,waveLength,waveLength,maxVal,minVal,minVal)\n if type == 9: #Bounce\n exp = 'abs(sin(pi*(frame + %s)/%s))* (%s-%s) + %s' %(offset,waveLength,maxVal,minVal,minVal)\n return exp\n\nwaveLength = 'waveLength'\noffset = 'offset'\nmaxVal = 'maxVal'\nminVal = 'minVal'\nexpResult.setExpression(setExp())\nexpFormula.setValue(setExp())\n\nwaveLength = node.knob('waveLength').getValue()\noffset = node.knob('offset').getValue()\nmaxVal = node.knob('maxVal').getValue()\nminVal = node.knob('minVal').getValue()\nexpText.setValue(setExp())" +STARTLINE}
- addUserKnob {26 ""}
- addUserKnob {7 expResult l Result t "The calculated result of the wave at the given frame. Link to this value if you want to control the expression from this node."}
- expResult {{"(sin(2*pi*(frame+offset)/waveLength)+1)/2 * (maxVal-minVal) + minVal"}}
- addUserKnob {26 unnamed_2 l "" +STARTLINE T " "}
- addUserKnob {1 expText l Expression t "The wave in expression form. For copying to another knobs expression value."}
- expText "(sin(2*pi*(frame+-3.0)/12.0)+1)/2 * (3.0--3.0) + -3.0"
- addUserKnob {26 unnamed_3 l "" +STARTLINE T " "}
- addUserKnob {1 formula l Formula t "The formula that generates the wave."}
- formula "(sin(2*pi*(frame+offset)/waveLength)+1)/2 * (maxVal-minVal) + minVal"
- }
- end_group
- CheckerBoard2 {
- inputs 0
- boxsize {{parent.CheckerBoard4.boxsize x1 3.6 x49 2}}
- color0 0
- color1 0
- color2 1
- color3 1
- centerlinewidth 0
- name CheckerBoard1
- selected true
- xpos 283
- ypos -405
- }
- push $cut_paste_input
- Shuffle {
- alpha black
- name Shuffle2
- selected true
- xpos 676
- ypos -818
- disable true
- }
- Dot {
- name Dot11
- selected true
- xpos 710
- ypos -773
- }
- set N5d28e380 [stack 0]
- Transform {
- translate {0 2}
- center {1024 576}
- name Transform5
- selected true
- xpos 422
- ypos -633
- }
- push $N5d28e380
- ShuffleCopy {
- inputs 2
- blue blue
- name ShuffleCopy3
- selected true
- xpos 551
- ypos -633
- }
- Merge2 {
- inputs 2
- operation soft-light
- name Merge9
- selected true
- xpos 551
- ypos -382
- }
- Transform {
- translate {0 {parent.ExpressionWaveGenerator.expResult}}
- center {1024 853}
- name Transform4
- selected true
- xpos 712
- ypos -382
- }
- CheckerBoard2 {
- inputs 0
- boxsize 2
- color0 1
- color1 1
- color2 0
- color3 0
- centerlinewidth 0
- name CheckerBoard4
- selected true
- xpos 282
- ypos -535
- }
- Transform {
- translate {0 {parent.ExpressionWaveGenerator.expResult}}
- center {1024 853}
- name Transform3
- selected true
- xpos 701
- ypos -512
- }
- push $N5d28e380
- Transform {
- translate {0 2}
- center {1024 576}
- name Transform12
- selected true
- xpos 766
- ypos -628
- }
- push $N5d28e380
- ShuffleCopy {
- inputs 2
- red red
- name ShuffleCopy4
- selected true
- xpos 876
- ypos -628
- }
- Merge2 {
- inputs 2
- operation soft-light
- name Merge14
- selected true
- xpos 876
- ypos -512
- }
- Merge2 {
- inputs 2
- operation soft-light
- name Merge15
- selected true
- xpos 876
- ypos -382
- }
- ColorCorrect {
- contrast 0.43
- gain 1.3
- name ColorCorrect2
- selected true
- xpos 876
- ypos -274
- }
- push $N5d28e380
- Dot {
- name Dot12
- selected true
- xpos 1014
- ypos -773
- }
- Merge2 {
- inputs 2
- operation overlay
- mix 0.25
- name Merge16
- selected true
- xpos 980
- ypos -274
- }
- ColorCorrect {
- gain 1.5
- name ColorCorrect3
- selected true
- xpos 980
- ypos -196
- disable true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement