Advertisement
Guest User

Untitled

a guest
May 4th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. set cut_paste_input [stack 0]
  2. version 9.0 v8
  3. BackdropNode {
  4. inputs 0
  5. name BackdropNode7
  6. tile_color 0x79b0b0ff
  7. label "effet optic\n"
  8. note_font_size 42
  9. selected true
  10. xpos 276
  11. ypos -851
  12. bdwidth 808
  13. bdheight 691
  14. }
  15. Group {
  16. inputs 0
  17. name ExpressionWaveGenerator
  18. help "Allows the easy creation of a variety of Waveform Expressions for use in manipulating knob values."
  19. selected true
  20. xpos 615
  21. ypos -450
  22. addUserKnob {20 main l Main}
  23. addUserKnob {26 unnamed_1 l "" +STARTLINE T " "}
  24. 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 "" "" "" "" ""}}
  25. type Sine
  26. addUserKnob {7 minVal l "Min Value" t "Minimum value you want the wave to reach." R 0 10}
  27. minVal -3
  28. addUserKnob {7 maxVal l "Max Value" t "Maximum value you want the wave to reach." -STARTLINE R 0 10}
  29. maxVal 3
  30. 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}
  31. waveLength 12
  32. addUserKnob {7 offset l Offset t "Offsets the frame value to allow control of values at a certain frame" R 0 10}
  33. offset -3
  34. addUserKnob {26 unnamed l "" +STARTLINE T " "}
  35. 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}
  36. addUserKnob {26 ""}
  37. 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."}
  38. expResult {{"(sin(2*pi*(frame+offset)/waveLength)+1)/2 * (maxVal-minVal) + minVal"}}
  39. addUserKnob {26 unnamed_2 l "" +STARTLINE T " "}
  40. addUserKnob {1 expText l Expression t "The wave in expression form. For copying to another knobs expression value."}
  41. expText "(sin(2*pi*(frame+-3.0)/12.0)+1)/2 * (3.0--3.0) + -3.0"
  42. addUserKnob {26 unnamed_3 l "" +STARTLINE T " "}
  43. addUserKnob {1 formula l Formula t "The formula that generates the wave."}
  44. formula "(sin(2*pi*(frame+offset)/waveLength)+1)/2 * (maxVal-minVal) + minVal"
  45. }
  46. end_group
  47. CheckerBoard2 {
  48. inputs 0
  49. boxsize {{parent.CheckerBoard4.boxsize x1 3.6 x49 2}}
  50. color0 0
  51. color1 0
  52. color2 1
  53. color3 1
  54. centerlinewidth 0
  55. name CheckerBoard1
  56. selected true
  57. xpos 283
  58. ypos -405
  59. }
  60. push $cut_paste_input
  61. Shuffle {
  62. alpha black
  63. name Shuffle2
  64. selected true
  65. xpos 676
  66. ypos -818
  67. disable true
  68. }
  69. Dot {
  70. name Dot11
  71. selected true
  72. xpos 710
  73. ypos -773
  74. }
  75. set N5d28e380 [stack 0]
  76. Transform {
  77. translate {0 2}
  78. center {1024 576}
  79. name Transform5
  80. selected true
  81. xpos 422
  82. ypos -633
  83. }
  84. push $N5d28e380
  85. ShuffleCopy {
  86. inputs 2
  87. blue blue
  88. name ShuffleCopy3
  89. selected true
  90. xpos 551
  91. ypos -633
  92. }
  93. Merge2 {
  94. inputs 2
  95. operation soft-light
  96. name Merge9
  97. selected true
  98. xpos 551
  99. ypos -382
  100. }
  101. Transform {
  102. translate {0 {parent.ExpressionWaveGenerator.expResult}}
  103. center {1024 853}
  104. name Transform4
  105. selected true
  106. xpos 712
  107. ypos -382
  108. }
  109. CheckerBoard2 {
  110. inputs 0
  111. boxsize 2
  112. color0 1
  113. color1 1
  114. color2 0
  115. color3 0
  116. centerlinewidth 0
  117. name CheckerBoard4
  118. selected true
  119. xpos 282
  120. ypos -535
  121. }
  122. Transform {
  123. translate {0 {parent.ExpressionWaveGenerator.expResult}}
  124. center {1024 853}
  125. name Transform3
  126. selected true
  127. xpos 701
  128. ypos -512
  129. }
  130. push $N5d28e380
  131. Transform {
  132. translate {0 2}
  133. center {1024 576}
  134. name Transform12
  135. selected true
  136. xpos 766
  137. ypos -628
  138. }
  139. push $N5d28e380
  140. ShuffleCopy {
  141. inputs 2
  142. red red
  143. name ShuffleCopy4
  144. selected true
  145. xpos 876
  146. ypos -628
  147. }
  148. Merge2 {
  149. inputs 2
  150. operation soft-light
  151. name Merge14
  152. selected true
  153. xpos 876
  154. ypos -512
  155. }
  156. Merge2 {
  157. inputs 2
  158. operation soft-light
  159. name Merge15
  160. selected true
  161. xpos 876
  162. ypos -382
  163. }
  164. ColorCorrect {
  165. contrast 0.43
  166. gain 1.3
  167. name ColorCorrect2
  168. selected true
  169. xpos 876
  170. ypos -274
  171. }
  172. push $N5d28e380
  173. Dot {
  174. name Dot12
  175. selected true
  176. xpos 1014
  177. ypos -773
  178. }
  179. Merge2 {
  180. inputs 2
  181. operation overlay
  182. mix 0.25
  183. name Merge16
  184. selected true
  185. xpos 980
  186. ypos -274
  187. }
  188. ColorCorrect {
  189. gain 1.5
  190. name ColorCorrect3
  191. selected true
  192. xpos 980
  193. ypos -196
  194. disable true
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement