Advertisement
nistaani

meny.py - May 2019

May 24th, 2019
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.47 KB | None | 0 0
  1. import sys
  2. import nuke
  3. import suptools
  4. import alignNodes
  5. import CloseAllProperties
  6.  
  7.  
  8. print 'Loading DM Tools...'
  9. menubar = nuke.menu("Nuke")
  10.  
  11. toolbar = nuke.toolbar("Nodes")
  12. m = toolbar.addMenu("DM Tools", icon="dm.png")
  13.  
  14.  
  15.  
  16.  
  17. nuke.menu('Nuke').addCommand('Extra/Close All Properties', "CloseAllProperties.CloseAllProperties()", "\\") # two backslashes necessary to write one, as it is an escape character
  18.  
  19. m.addCommand("Distort/X Distort", "nuke.createNode(\"X_Distort\")", icon="X_Distort.png")
  20. m.addCommand("Distort/Wave Distortion", "nuke.createNode(\"WaveDistortion\")", icon="ICON.png")
  21. m.addCommand("Distort/CS_HeatDistortion", "nuke.createNode(\"CS_HeatDistortion\")", icon="ICON.png")
  22. m.addCommand("Distort/lp_noisedistort", "nuke.createNode(\"lp_noisedistort\")", icon="")
  23. m.addCommand("Distort/Invisi Shimmer", "nuke.createNode(\"invisiShimmer\")", icon="ICON.png")
  24. m.addCommand("Deep/M13_DeepPositionMask", "nuke.createNode(\"M13_DeepPositionMask\")", icon="")
  25. m.addCommand("Key/ScreenXchange", "nuke.createNode(\"ScreenXchange\")", icon="ICON.png")
  26. m.addCommand("Key/lp_hairkey", "nuke.createNode(\"lp_hairkey\")", icon="")
  27. m.addCommand("Key/L_AlphaClean_v03", "nuke.createNode(\"L_AlphaClean_v03\")", icon="")
  28. m.addCommand("Key/CrankIt", "nuke.createNode(\"CrankIt\")", icon="ICON.png")
  29. m.addCommand("Key/additiveKeyer", "nuke.createNode(\"additiveKeyer\")", icon="")
  30. m.addCommand("Key/chromaSmear", "nuke.createNode(\"chromaSmear\")", icon="")
  31. m.addCommand("Key/SpillFill", "nuke.createNode(\"SpillFill\")", icon="")
  32. m.addCommand("Key/BM_LumaKeyer", "nuke.createNode(\"BM_LumaKeyer\")", icon="")
  33. m.addCommand("Key/CheckmatteV2", "nuke.createNode(\"CheckmatteV2\")", icon="")
  34. m.addCommand("Render/X_Aton", "nuke.createNode(\"X_Aton\")", icon="X_Aton.png")
  35. m.addCommand("Render/SpotFlare_v01", "nuke.createNode(\"SpotFlare_v01\")", icon="")
  36. m.addCommand("Render/Flow", "nuke.createNode('Flow.gizmo')", icon="Flow.png")
  37. m.addCommand("Render/Flicker2.5", "nuke.createNode(\"Flicker\")", icon="")
  38. m.addCommand("Render/TX_Fog", "nuke.createNode(\"TX_Fog\")", icon="")
  39. m.addCommand("Render/sb_lensReflections", "nuke.createNode(\"sb_lensReflections\")", icon="")
  40. m.addCommand("Render/K_LensEngine", "nuke.createNode(\"K_LensEngine\")", icon="K_LensEngine.png")
  41. m.addCommand("Render/K_BokehBuilder", "nuke.createNode(\"K_BokehBuilder\")", icon="K_BokehBuilder.png")
  42. m.addCommand("Render/AE_MachineGun", "nuke.createNode(\"AE_MachineGun\")", icon="")
  43.  
  44.  
  45. m.addCommand("SB/sb_haze", "nuke.createNode(\"sb_haze\")", icon="ICON.png")
  46. m.addCommand("SB/sb_alphaFromMax", "nuke.createNode(\"sb_alphaFromMax\")", icon="ICON.png")
  47. m.addCommand("SB/sb_Glow", "nuke.createNode(\"sb_Glow\")", icon="ICON.png")
  48. m.addCommand("Edges/EdgeExtend2", "nuke.createNode(\"EdgeExtend2\")", icon="")
  49. m.addCommand("Edges/Vector Extend Edge", "nuke.createNode(\"VectorExtendEdge\")", icon="")
  50. m.addCommand("Edges/KillOutline", "nuke.createNode(\"KillOutline\")", icon="")
  51. m.addCommand("Edges/RoughenEdges", "nuke.createNode(\"RoughenEdges\")", icon="")
  52. m.addCommand('EdgesV_EdgeMatte', 'nuke.createNode("V_EdgeMatte")', icon='V_EdgeMatte.png')
  53. m.addCommand("Utility/CurveFactory", "nuke.createNode(\"CurveFactory\")", icon="CurveFactory.png")
  54. m.addCommand("Utility/Wipe", "nuke.createNode(\"Wipe\")", icon="ICON.png")
  55. m.addCommand("Utility/tracker2Camera", "nuke.createNode(\"tracker2Camera\")", icon="ICON.png")
  56.  
  57. m.addCommand("iblur_hub", "nuke.createNode(\"iblur_hub\")", icon="ICON.png")
  58. m.addCommand("TimeMachine", "nuke.createNode(\"TimeMachine\")", icon="ICON.png")
  59. m.addCommand("ITransform", "nuke.createNode(\"ITransform\")", icon="ICON.png")
  60. m.addCommand("iBlur", "nuke.createNode(\"iBlur\")", icon="ICON.png")
  61. m.addCommand("convolution_matrix", "nuke.createNode(\"convolution_matrix\")", icon="ICON.png")
  62. m.addCommand("Aberration", "nuke.createNode(\"Aberration\")", icon="ICON.png")
  63. m.addCommand("expoglow", "nuke.createNode(\"expoglow\")", icon="ICON.png")
  64. m.addCommand("vHighPass", "nuke.createNode(\"vHighPass\")", icon="ICON.png")
  65. m.addCommand("bm_Lightwrap", "nuke.createNode(\"bm_Lightwrap\")", icon="ICON.png")
  66. m.addCommand("PointPositionMask", "nuke.createNode(\"PointPositionMask\")", icon="ICON.png")
  67. m.addCommand("CocoMatchGrade", "nuke.createNode(\"CocoMatchGrade\")", icon="ICON.png")
  68. m.addCommand("ScolourSample", "nuke.createNode(\"colourSample\")", icon="colourSample.png")
  69. m.addCommand("compare_side", "nuke.createNode(\"compare_side\")", icon="sideby.png")
  70. m.addCommand("compare_vert", "nuke.createNode(\"compare_vert\")", icon="vert.png")
  71. m.addCommand("Alpha2obj", "nuke.createNode(\"Alpha2obj\")", icon="")
  72. m.addCommand("Firefly_Swatter", "nuke.createNode(\"Firefly_Swatter\")", icon="")
  73. m.addCommand("fxT_chromaticAberration", "nuke.createNode(\"fxT_chromaticAberration\")", icon="fxT_menu.png")
  74. m.addCommand("Glitch", "nuke.createNode(\"glitch\")", icon="")
  75. m.addCommand("Mac13_InterferenceFX_v02_01", "nuke.createNode(\"Mac13_InterferenceFX_v02_01\")", icon="")
  76. m.addCommand("pfGlitchy_v1_2_1", "nuke.createNode(\"pfGlitchy_v1_2_1\")", icon="")
  77. m.addCommand("S_Volume", "nuke.createNode(\"S_Volume\")", icon="")
  78. m.addCommand("AA Recovery", "nuke.createNode(\"aa_recovery\")", icon="")
  79.  
  80. m.addCommand("OrganicNoise", "nuke.createNode(\"OrganicNoise\")", icon="")
  81.  
  82.  
  83.  
  84. ##nukeShortcuts
  85. nuke.menu('Nodes').addMenu('Merge/Merges').addCommand('Stencil', 'nuke.createNode("Merge2", "operation stencil bbox B", False)', "alt+o", shortcutContext=2)
  86. nuke.menu('Nodes').addMenu('Merge/Merges').addCommand('Mask', 'nuke.createNode("Merge2", "operation mask bbox A", False)', "alt+i", shortcutContext=2)
  87.  
  88.  
  89. ##alignNodes
  90. menuBar = nuke.menu("Nuke")
  91. menuBar.addCommand('Edit/Node/Align/horizontally', 'alignNodes.alignNodes( nuke.selectedNodes(), direction="x" )', 'alt+y')
  92. menuBar.addCommand('Edit/Node/Align/vertically', 'alignNodes.alignNodes( nuke.selectedNodes(), direction="y" )', 'alt+x')
  93.  
  94.  
  95. #Print Values
  96.  
  97. # Blur
  98. def blurAL():
  99. tn = nuke.thisNode()
  100. name = tn.name()
  101. size = ' (%s)' % tn['size'].value()
  102. label = [name+size]
  103. user_label = tn['label'].value()
  104. if user_label:
  105. label.append(user_label)
  106. return '\n'.join(label)
  107.  
  108. nuke.addAutolabel(blurAL, nodeClass='Blur')
  109.  
  110.  
  111. # Defocus
  112. def defAL():
  113. tn = nuke.thisNode()
  114. name = tn.name()
  115. defocus = ' (%s)' % tn['defocus'].value()
  116. label = [name+defocus]
  117. user_label = tn['label'].value()
  118. if user_label:
  119. label.append(user_label)
  120. return '\n'.join(label)
  121.  
  122. nuke.addAutolabel(defAL, nodeClass='Defocus')
  123.  
  124.  
  125.  
  126. # Custom Label Tracker
  127. nuke.knobDefault('Tracker.label', "Motion: [value transform]\nRef Frame: [value reference_frame]")
  128.  
  129. # Multiply
  130. def defAL():
  131. tn = nuke.thisNode()
  132. name = tn.name()
  133. multiply = ' (%s)' % tn['value'].value()
  134. label = [name+multiply]
  135. user_label = tn['label'].value()
  136. if user_label:
  137. label.append(user_label)
  138. return '\n'.join(label)
  139.  
  140. nuke.addAutolabel(defAL, nodeClass='Multiply')
  141.  
  142.  
  143. # Knob Defaults - motion blur centred
  144. nuke.knobDefault('Tracker.shutteroffset', "centered")
  145. nuke.knobDefault('TimeBlur.shutteroffset', "centered")
  146. nuke.knobDefault('Transform.shutteroffset', "centered")
  147. nuke.knobDefault('CornerPin2D.shutteroffset', "centered")
  148. nuke.knobDefault('MotionBlur2D.shutteroffset', "centered")
  149. nuke.knobDefault('MotionBlur3D.shutteroffset', "centered")
  150.  
  151. # Self-Labeling Dot
  152. def selfLabellingDot(name=None):
  153. dot = nuke.createNode('Dot', inpanel=False)
  154. dot['label'].setValue('[value name]')
  155. if name:
  156. dot.setName(name)
  157. return dot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement