Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import nuke
- import suptools
- import alignNodes
- import CloseAllProperties
- print 'Loading DM Tools...'
- menubar = nuke.menu("Nuke")
- toolbar = nuke.toolbar("Nodes")
- m = toolbar.addMenu("DM Tools", icon="dm.png")
- nuke.menu('Nuke').addCommand('Extra/Close All Properties', "CloseAllProperties.CloseAllProperties()", "\\") # two backslashes necessary to write one, as it is an escape character
- m.addCommand("Distort/X Distort", "nuke.createNode(\"X_Distort\")", icon="X_Distort.png")
- m.addCommand("Distort/Wave Distortion", "nuke.createNode(\"WaveDistortion\")", icon="ICON.png")
- m.addCommand("Distort/CS_HeatDistortion", "nuke.createNode(\"CS_HeatDistortion\")", icon="ICON.png")
- m.addCommand("Distort/lp_noisedistort", "nuke.createNode(\"lp_noisedistort\")", icon="")
- m.addCommand("Distort/Invisi Shimmer", "nuke.createNode(\"invisiShimmer\")", icon="ICON.png")
- m.addCommand("Deep/M13_DeepPositionMask", "nuke.createNode(\"M13_DeepPositionMask\")", icon="")
- m.addCommand("Key/ScreenXchange", "nuke.createNode(\"ScreenXchange\")", icon="ICON.png")
- m.addCommand("Key/lp_hairkey", "nuke.createNode(\"lp_hairkey\")", icon="")
- m.addCommand("Key/L_AlphaClean_v03", "nuke.createNode(\"L_AlphaClean_v03\")", icon="")
- m.addCommand("Key/CrankIt", "nuke.createNode(\"CrankIt\")", icon="ICON.png")
- m.addCommand("Key/additiveKeyer", "nuke.createNode(\"additiveKeyer\")", icon="")
- m.addCommand("Key/chromaSmear", "nuke.createNode(\"chromaSmear\")", icon="")
- m.addCommand("Key/SpillFill", "nuke.createNode(\"SpillFill\")", icon="")
- m.addCommand("Key/BM_LumaKeyer", "nuke.createNode(\"BM_LumaKeyer\")", icon="")
- m.addCommand("Key/CheckmatteV2", "nuke.createNode(\"CheckmatteV2\")", icon="")
- m.addCommand("Render/X_Aton", "nuke.createNode(\"X_Aton\")", icon="X_Aton.png")
- m.addCommand("Render/SpotFlare_v01", "nuke.createNode(\"SpotFlare_v01\")", icon="")
- m.addCommand("Render/Flow", "nuke.createNode('Flow.gizmo')", icon="Flow.png")
- m.addCommand("Render/Flicker2.5", "nuke.createNode(\"Flicker\")", icon="")
- m.addCommand("Render/TX_Fog", "nuke.createNode(\"TX_Fog\")", icon="")
- m.addCommand("Render/sb_lensReflections", "nuke.createNode(\"sb_lensReflections\")", icon="")
- m.addCommand("Render/K_LensEngine", "nuke.createNode(\"K_LensEngine\")", icon="K_LensEngine.png")
- m.addCommand("Render/K_BokehBuilder", "nuke.createNode(\"K_BokehBuilder\")", icon="K_BokehBuilder.png")
- m.addCommand("Render/AE_MachineGun", "nuke.createNode(\"AE_MachineGun\")", icon="")
- m.addCommand("SB/sb_haze", "nuke.createNode(\"sb_haze\")", icon="ICON.png")
- m.addCommand("SB/sb_alphaFromMax", "nuke.createNode(\"sb_alphaFromMax\")", icon="ICON.png")
- m.addCommand("SB/sb_Glow", "nuke.createNode(\"sb_Glow\")", icon="ICON.png")
- m.addCommand("Edges/EdgeExtend2", "nuke.createNode(\"EdgeExtend2\")", icon="")
- m.addCommand("Edges/Vector Extend Edge", "nuke.createNode(\"VectorExtendEdge\")", icon="")
- m.addCommand("Edges/KillOutline", "nuke.createNode(\"KillOutline\")", icon="")
- m.addCommand("Edges/RoughenEdges", "nuke.createNode(\"RoughenEdges\")", icon="")
- m.addCommand('EdgesV_EdgeMatte', 'nuke.createNode("V_EdgeMatte")', icon='V_EdgeMatte.png')
- m.addCommand("Utility/CurveFactory", "nuke.createNode(\"CurveFactory\")", icon="CurveFactory.png")
- m.addCommand("Utility/Wipe", "nuke.createNode(\"Wipe\")", icon="ICON.png")
- m.addCommand("Utility/tracker2Camera", "nuke.createNode(\"tracker2Camera\")", icon="ICON.png")
- m.addCommand("iblur_hub", "nuke.createNode(\"iblur_hub\")", icon="ICON.png")
- m.addCommand("TimeMachine", "nuke.createNode(\"TimeMachine\")", icon="ICON.png")
- m.addCommand("ITransform", "nuke.createNode(\"ITransform\")", icon="ICON.png")
- m.addCommand("iBlur", "nuke.createNode(\"iBlur\")", icon="ICON.png")
- m.addCommand("convolution_matrix", "nuke.createNode(\"convolution_matrix\")", icon="ICON.png")
- m.addCommand("Aberration", "nuke.createNode(\"Aberration\")", icon="ICON.png")
- m.addCommand("expoglow", "nuke.createNode(\"expoglow\")", icon="ICON.png")
- m.addCommand("vHighPass", "nuke.createNode(\"vHighPass\")", icon="ICON.png")
- m.addCommand("bm_Lightwrap", "nuke.createNode(\"bm_Lightwrap\")", icon="ICON.png")
- m.addCommand("PointPositionMask", "nuke.createNode(\"PointPositionMask\")", icon="ICON.png")
- m.addCommand("CocoMatchGrade", "nuke.createNode(\"CocoMatchGrade\")", icon="ICON.png")
- m.addCommand("ScolourSample", "nuke.createNode(\"colourSample\")", icon="colourSample.png")
- m.addCommand("compare_side", "nuke.createNode(\"compare_side\")", icon="sideby.png")
- m.addCommand("compare_vert", "nuke.createNode(\"compare_vert\")", icon="vert.png")
- m.addCommand("Alpha2obj", "nuke.createNode(\"Alpha2obj\")", icon="")
- m.addCommand("Firefly_Swatter", "nuke.createNode(\"Firefly_Swatter\")", icon="")
- m.addCommand("fxT_chromaticAberration", "nuke.createNode(\"fxT_chromaticAberration\")", icon="fxT_menu.png")
- m.addCommand("Glitch", "nuke.createNode(\"glitch\")", icon="")
- m.addCommand("Mac13_InterferenceFX_v02_01", "nuke.createNode(\"Mac13_InterferenceFX_v02_01\")", icon="")
- m.addCommand("pfGlitchy_v1_2_1", "nuke.createNode(\"pfGlitchy_v1_2_1\")", icon="")
- m.addCommand("S_Volume", "nuke.createNode(\"S_Volume\")", icon="")
- m.addCommand("AA Recovery", "nuke.createNode(\"aa_recovery\")", icon="")
- m.addCommand("OrganicNoise", "nuke.createNode(\"OrganicNoise\")", icon="")
- ##nukeShortcuts
- nuke.menu('Nodes').addMenu('Merge/Merges').addCommand('Stencil', 'nuke.createNode("Merge2", "operation stencil bbox B", False)', "alt+o", shortcutContext=2)
- nuke.menu('Nodes').addMenu('Merge/Merges').addCommand('Mask', 'nuke.createNode("Merge2", "operation mask bbox A", False)', "alt+i", shortcutContext=2)
- ##alignNodes
- menuBar = nuke.menu("Nuke")
- menuBar.addCommand('Edit/Node/Align/horizontally', 'alignNodes.alignNodes( nuke.selectedNodes(), direction="x" )', 'alt+y')
- menuBar.addCommand('Edit/Node/Align/vertically', 'alignNodes.alignNodes( nuke.selectedNodes(), direction="y" )', 'alt+x')
- #Print Values
- # Blur
- def blurAL():
- tn = nuke.thisNode()
- name = tn.name()
- size = ' (%s)' % tn['size'].value()
- label = [name+size]
- user_label = tn['label'].value()
- if user_label:
- label.append(user_label)
- return '\n'.join(label)
- nuke.addAutolabel(blurAL, nodeClass='Blur')
- # Defocus
- def defAL():
- tn = nuke.thisNode()
- name = tn.name()
- defocus = ' (%s)' % tn['defocus'].value()
- label = [name+defocus]
- user_label = tn['label'].value()
- if user_label:
- label.append(user_label)
- return '\n'.join(label)
- nuke.addAutolabel(defAL, nodeClass='Defocus')
- # Custom Label Tracker
- nuke.knobDefault('Tracker.label', "Motion: [value transform]\nRef Frame: [value reference_frame]")
- # Multiply
- def defAL():
- tn = nuke.thisNode()
- name = tn.name()
- multiply = ' (%s)' % tn['value'].value()
- label = [name+multiply]
- user_label = tn['label'].value()
- if user_label:
- label.append(user_label)
- return '\n'.join(label)
- nuke.addAutolabel(defAL, nodeClass='Multiply')
- # Knob Defaults - motion blur centred
- nuke.knobDefault('Tracker.shutteroffset', "centered")
- nuke.knobDefault('TimeBlur.shutteroffset', "centered")
- nuke.knobDefault('Transform.shutteroffset', "centered")
- nuke.knobDefault('CornerPin2D.shutteroffset', "centered")
- nuke.knobDefault('MotionBlur2D.shutteroffset', "centered")
- nuke.knobDefault('MotionBlur3D.shutteroffset', "centered")
- # Self-Labeling Dot
- def selfLabellingDot(name=None):
- dot = nuke.createNode('Dot', inpanel=False)
- dot['label'].setValue('[value name]')
- if name:
- dot.setName(name)
- return dot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement