nukescripts.toolbars

Package nukescripts :: Module toolbars |
[hide private]
[frames] | no frames]

# Source Code for Module nukescripts.toolbars

      1  # Copyright (c) 2009 The Foundry Visionmongers Ltd.  All Rights Reserved.
      2
      3  import nuke
      4  import nukescripts
      5  import os, os.path
      6  import nuke.rotopaint
      7
      8  # Define the tool menus. This file is loaded by menu.py.
      9 -def setup_toolbars():
     10    # This is not currently used but when we support a text-only mode we'll need it.
     11    #size = nuke.numvalue("preferences.toolbarTextSize")
     12
     13    # Get the top-level toolbar
     14    toolbar = nuke.menu("Nodes")
     15
     16    # The "Image" menu
     17    m = toolbar.addMenu("Image", "ToolbarImage.png")
     18    m.addCommand("Read", "nukescripts.create_read()", "r", icon="Read.png")
     19    m.addCommand("Write", "nuke.createNode(\"Write\")", "w", icon="Write.png")
     20    m.addCommand("Constant", "nuke.createNode(\"Constant\")", icon="Constant.png")
     21    m.addCommand("CheckerBoard", "nuke.createNode(\"CheckerBoard2\")", icon="CheckerBoard.png")
     22    m.addCommand("ColorBars", "nuke.createNode(\"ColorBars\")", icon="ColorBars.png")
     23    m.addCommand("ColorWheel", "nuke.createNode(\"ColorWheel\")", icon="ColorWheel.png")
     24    m.addCommand("CurveTool", "nuke.createNode(\"CurveTool\")", icon="CurveTool.png")
     25    m.addCommand("Viewer", "nuke.createNode(\"Viewer\")", icon="Viewer.png")
     26    # m.addCommand("Proxy", "nuke.knob(\"root.proxy\", \"!root.proxy\")", icon="proxyfullres.png")
     27
     28    # The "Draw" menu
     29    m = toolbar.addMenu("Draw", "ToolbarDraw.png")
     30    m.addCommand("Roto", '''nuke.createNode("Roto")''', "o", icon="Roto.png")
     31    m.addCommand("RotoPaint", "nuke.createNode(\"RotoPaint\")", "p", icon="RotoPaint.png")
     32
     33    m.addCommand("@;&RotoBranch", "nuke.createNode(\"Roto\")", "+o")
     34    m.addCommand("@;&RotoPaintBranch", "nuke.createNode(\"RotoPaint\")", "+p")
     35
     36    m.addCommand("Dither", "nuke.createNode(\"Dither\")", icon="Dither.png")
     37    m.addCommand("DustBust", "nuke.createNode(\"DustBust\")", icon="DustBust.png")
     38    m.addCommand("Grain", "nuke.createNode(\"Grain2\")", icon="Grain.png")
     39    m.addCommand("ScannedGrain", "nuke.createNode(\"ScannedGrain\")", icon="ScannedGrain.png")
     40    m.addCommand("Glint", "nuke.createNode(\"Glint\")", icon="Glint.png")
     41    m.addCommand("Grid", "nuke.createNode(\"Grid\")", icon="Grid.png")
     42    m.addCommand("Flare", "nuke.createNode(\"Flare\")", icon="Flare.png")
     43    m.addCommand("LightWrap", "nuke.createNode(\"LightWrap\")", icon="LightWrap.png")
     44    m.addCommand("MarkerRemoval", "nuke.createNode(\"MarkerRemoval\")", icon="MarkerRemoval.png")
     45    m.addCommand("Noise", "nuke.createNode(\"Noise\")", icon="Noise.png")
     46    m.addCommand("Radial", "nuke.createNode(\"Radial\")", icon="Radial.png")
     47    m.addCommand("Ramp", "nuke.createNode(\"Ramp\")", icon="Ramp.png")
     48    m.addCommand("Rectangle", "nuke.createNode(\"Rectangle\")", icon="Rectangle.png")
     49    m.addCommand("Sparkles", "nuke.createNode(\"Sparkles\")", icon="Sparkles.png")
     50    m.addCommand("Text", "nuke.createNode(\"Text\")", icon="Text.png")
     51
     52    m = toolbar.addMenu("Time", "ToolbarTime.png")
     53    m.addCommand("Add 3:2 pulldown", "nuke.createNode(\"add32p\")", icon="Add32.png")
     54    m.addCommand("Remove 3:2 pulldown", "nuke.createNode(\"remove32p\")", icon="Remove32.png")
     55    m.addCommand("AppendClip", "nuke.createNode(\"AppendClip\")", icon="AppendClip.png")
     56    m.addCommand("FrameBlend", "nuke.createNode(\"FrameBlend\")", icon="FrameBlend.png")
     57    m.addCommand("FrameHold", "nuke.createNode(\"FrameHold\")", icon="FrameHold.png")
     58    m.addCommand("FrameRange", "nuke.createNode(\"FrameRange\")", icon="FrameRange.png")
     59    m.addCommand("OFlow", "nuke.createNode(\"OFXuk.co.thefoundry.time.oflow_v100\")", icon="Oflow.png")
     60    m.addCommand("Retime", "nuke.createNode(\"Retime\")", icon="Retime.png")
     61    m.addCommand("TemporalMedian", "nuke.createNode(\"TemporalMedian\")", icon="TemporalMedian.png")
     62    m.addCommand("TimeBlur", "nuke.createNode(\"TimeBlur\")", icon="TimeBlur.png")
     63    m.addCommand("NoTimeBlur", "nuke.createNode(\"NoTimeBlur\")", icon="NoTimeBlur.png")
     64    m.addCommand("TimeEcho", "nuke.createNode(\"TimeEcho\")", icon="TimeEcho.png")
     65    m.addCommand("TimeOffset", "nuke.createNode(\"TimeOffset\")", icon="TimeOffset.png")
     66
     67    m.addCommand("TimeWarp", "nukescripts.create_time_warp()", icon="TimeWarp.png")
     68
     69
     70    # The "Channel" menu
     71    m = toolbar.addMenu("Channel", "ToolbarChannel.png")
     72    m.addCommand("Shuffle", "nuke.createNode(\"Shuffle\")", icon="Shuffle.png")
     73    m.addCommand("ShuffleCopy", "nuke.createNode(\"ShuffleCopy\")", icon="ShuffleCopy.png")
     74    m.addCommand("Copy", "nuke.createNode(\"Copy\")", "k", icon="Copy.png")
     75    m.addCommand("@;&CopyBranch", "nuke.createNode(\"Copy\")", "+k")
     76    m.addCommand("ChannelMerge", "nuke.createNode(\"ChannelMerge\")", icon="ChannelMerge.png")
     77    m.addCommand("Add", "nuke.createNode(\"AddChannels\")", icon="Add.png")
     78    m.addCommand("Remove","nuke.createNode(\"Remove\")", icon="Remove.png")
     79
     80
     81    # The "Color" menu
     82    m = toolbar.addMenu("Color", "ToolbarColor.png")
     83
     84    n = m.addMenu("Math", "ColorMath.png")
     85    n.addCommand("Add", "nuke.createNode(\"Add\")", icon="ColorAdd.png")
     86    n.addCommand("Multiply", "nuke.createNode(\"Multiply\")", icon="ColorMult.png")
     87    n.addCommand("Gamma", "nuke.createNode(\"Gamma\")", icon="ColorGamma.png")
     88    n.addCommand("ClipTest", "nuke.createNode(\"ClipTest\")", icon="ClipTest.png")
     89    n.addCommand("ColorMatrix", "nuke.createNode(\"ColorMatrix\")", icon="ColorMatrix.png")
     90    n.addCommand("Expression", "nuke.createNode(\"Expression\")", icon="Expression.png")
     91
     92    n = m.addMenu("3D LUT", "Toolbar3DLUT.png")
     93    n.addCommand("CMSTestPattern", "nuke.createNode(\"CMSTestPattern\")", icon="CMSTestPattern.png")
     94    n.addCommand("GenerateLUT", "nuke.createNode(\"GenerateLUT\")", icon="GenerateLUT.png")
     95    n.addCommand("Vectorfield (Apply 3D LUT)", "nuke.createNode(\"Vectorfield\")", icon="Vectorfield.png")
     96
     97    m.addCommand("Clamp", "nuke.createNode(\"Clamp\")", icon="Clamp.png")
     98    m.addCommand("ColorLookup", "nuke.createNode(\"ColorLookup\")", icon="ColorLookup.png")
     99    m.addCommand("Colorspace", "nuke.createNode(\"Colorspace\")", icon="ColorSpace.png")
    100    m.addCommand("ColorTransfer", "nuke.createNode(\"ColorTransfer\")", icon="ColorTransfer.png")
    101    m.addCommand("ColorCorrect", "nuke.createNode(\"ColorCorrect\")", "c", icon="ColorCorrect.png")
    102    m.addCommand("@;&ColorCorrectBranch", "nuke.createNode(\"ColorCorrect\")", "+c")
    103    m.addCommand("Crosstalk", "nuke.createNode(\"CCrosstalk\")", icon="Crosstalk.png")
    104    m.addCommand("Exposure", "nuke.createNode(\"EXPTool\")", icon="Exposure.png")
    105    m.addCommand("Grade", "nuke.createNode(\"Grade\")", "g", icon="Grade.png")
    106    m.addCommand("@;&GradeBranch", "nuke.createNode(\"Grade\")", "+g")
    107    m.addCommand("Histogram", "nuke.createNode(\"Histogram\")", icon="Histogram.png")
    108    m.addCommand("HistEQ", "nuke.createNode(\"HistEQ\")", icon="HistEQ.png")
    109    m.addCommand("HueCorrect", "nuke.createNode(\"HueCorrect\")", icon="HueCorrect.png")
    110    m.addCommand("HueShift", "nuke.createNode(\"HueShift\")", icon="HueShift.png")
    111    m.addCommand("HSVTool", "nuke.createNode(\"HSVTool\")", icon="HSVTool.png")
    112    m.addCommand("Invert", "nuke.createNode(\"Invert\")", icon="Invert.png")
    113    m.addCommand("Log2Lin", "nuke.createNode(\"Log2Lin\")", icon="Log2Lin.png")
    114    m.addCommand("PLogLin", "nuke.createNode(\"PLogLin\")", icon="Log2Lin.png")
    115    m.addCommand("MinColor", "nuke.createNode(\"MinColor\")", icon="MinColor.png")
    116    #m.addCommand("OCIOColorSpace", "nuke.createNode(\"OCIOColorSpace\")", icon="ColorSpace.png")
    117    m.addCommand("Posterize", "nuke.createNode(\"Posterize\")", icon="Posterize.png")
    118    m.addCommand("RolloffContrast", "nuke.createNode(\"RolloffContrast\")", icon="RolloffContrast.png")
    119    m.addCommand("Saturation", "nuke.createNode(\"Saturation\")", icon="Saturation.png")
    120    m.addCommand("Sampler", "nuke.createNode(\"Sampler\")", icon="Sampler.png")
    121    m.addCommand("SoftClip", "nuke.createNode(\"SoftClip\")", icon="SoftClip.png")
    122    m.addCommand("Toe", "nuke.createNode(\"Toe2\")" )
    123    m.addCommand("Truelight", "nuke.createNode(\"Truelight3\")", icon="Truelight.png")
    124
    125
    126    # The "Filter" menu
    127    m = toolbar.addMenu("Filter", "ToolbarFilter.png")
    128    m.addCommand("Blur", "nuke.createNode(\"Blur\")", "b", icon="Blur.png")
    129    m.addCommand("@;&BlurBranch", "nuke.createNode(\"Blur\")", "+b")
    130    m.addCommand("Bilateral", "nuke.createNode(\"Bilateral\")", icon="Bilateral.png")
    131    m.addCommand("BumpBoss", "nuke.createNode(\"BumpBoss\")", icon="BumpBoss.png")
    132    m.addCommand("Convolve", "nuke.createNode(\"Convolve\")", icon="Convolve.png")
    133    m.addCommand("Defocus", "nuke.createNode(\"Defocus\")", icon="Defocus.png")
    134    m.addCommand("DegrainBlue", "nuke.createNode(\"DegrainBlue\")", icon="DegrainBlue.png")
    135    m.addCommand("DegrainSimple", "nuke.createNode(\"DegrainSimple\")", icon="DegrainSimple.png")
    136    m.addCommand("Denoise", 'nuke.createNode("OFXuk.co.thefoundry.noisetools.denoise_v100")', icon="denoise.png")
    137    m.addCommand("DirBlur", "nuke.createNode(\"DirBlurWrapper\")", icon="DirBlur.png")
    138    m.addCommand("EdgeBlur", "nuke.createNode(\"EdgeBlur\")", icon="EdgeBlur.png")
    139    m.addCommand("EdgeDetect", "nuke.createNode(\"EdgeDetectWrapper\")", icon="EdgeDetect.png")
    140    m.addCommand("Emboss", "nuke.createNode(\"Emboss\")", icon="Emboss.png")
    141    m.addCommand("Erode (fast)", "nuke.createNode(\"Dilate\")", icon="ErodeFast.png")
    142    m.addCommand("Erode (filter)", "nuke.createNode(\"FilterErode\")", icon="FilterErode.png")
    143    m.addCommand("Erode (blur)", "nuke.createNode(\"Erode\")", icon="ErodeBlur.png")
    144    m.addCommand("Glow", "nuke.createNode(\"Glow\")", icon="Glow.png")
    145    m.addCommand("GodRays", "nuke.createNode(\"GodRays\")", icon="GodRays.png")
    146    m.addCommand("Laplacian", "nuke.createNode(\"Laplacian\")", icon="Laplacian.png")
    147    m.addCommand("LevelSet", "nuke.createNode(\"LevelSet\")", icon="LevelSet.png")
    148
    149    m.addCommand("Matrix...", "nukescripts.create_matrix()", icon="Matrix.png")
    150    m.addCommand("Median", "nuke.createNode(\"Median\")", icon="Median.png")
    151    m.addCommand("MotionBlur2D", "nuke.createNode(\"MotionBlur2D\")", icon="MotionBlur2D.png")
    152    m.addCommand("MotionBlur3D", "nuke.createNode(\"MotionBlur3D\")", icon="MotionBlur3D.png")
    153    m.addCommand("Sharpen", "nuke.createNode(\"Sharpen\")", icon="Sharpen.png")
    154    m.addCommand("Soften", "nuke.createNode(\"Soften\")", icon="Soften.png")
    155    m.addCommand("VectorBlur", "nuke.createNode(\"VectorBlur\")", icon="VectorBlur.png")
    156    m.addCommand("VolumeRays", "nuke.createNode(\"VolumeRays\")", icon="VolumeRays.png")
    157    m.addCommand("ZBlur", "nuke.createNode(\"ZBlur\")", icon="ZBlur.png")
    158    m.addCommand("ZSlice", "nuke.createNode(\"ZSlice\")", icon="ZSlice.png")
    159
    160
    161    # The "Keyer" menu
    162    m = toolbar.addMenu("Keyer", "ToolbarKeyer.png")
    163    m.addCommand("Difference", "nuke.createNode(\"Difference\")", icon="DifferenceKeyer.png")
    164    m.addCommand("HueKeyer", "nuke.createNode(\"HueKeyer\")", icon="HueKeyer.png")
    165    m.addCommand("IBKGizmo", "nuke.tcl(\"IBKGizmoV3\")", icon="IBKGizmo.png")
    166    m.addCommand("IBKColour", "nuke.tcl(\"IBKColourV3\")", icon="IBKColour.png")
    167    m.addCommand("Keyer", "nuke.createNode(\"Keyer\")", icon="Keyer.png")
    168    m.addCommand("Primatte", "nuke.createNode(\"Primatte3\")", icon="Primatte.png")
    169    m.addCommand("Keylight", 'nuke.createNode("OFXuk.co.thefoundry.keylight.keylight_v201")', icon="Keylight.png")
    170    m.addCommand("Ultimatte", "nuke.createNode(\"Ultimatte\")", icon="Ultimatte.png")
    171
    172
    173    # The "Merge" menu
    174    m = toolbar.addMenu("Merge", "ToolbarMerge.png")
    175    m.addCommand("AddMix", "nuke.createNode(\"AddMix\")", "+a", icon="AddMix.png")
    176    m.addCommand("KeyMix", "nuke.createNode(\"Keymix\")", icon="Keymix.png")
    177    m.addCommand("ContactSheet", "nuke.createNode(\"ContactSheet\")", icon="ContactSheet.png")
    178    m.addCommand("CopyBBox", "nuke.createNode(\"CopyBBox\")", icon="CopyBBox.png")
    179    m.addCommand("CopyRectangle", "nuke.createNode(\"CopyRectangle\")", icon="CopyRectangle.png")
    180    m.addCommand("Dissolve", "nuke.createNode(\"Dissolve\")", icon="Dissolve.png")
    181    m.addCommand("LayerContactSheet", "nuke.createNode(\"LayerContactSheet\")", icon="LayerContactSheet.png")
    182    m.addCommand("Merge", "nuke.createNode(\"Merge2\")", "m", icon="Merge.png")
    183    m.addCommand("@;&MergeBranch", "nuke.createNode(\"Merge2\")", "+m")
    184    n = m.addMenu("Merges", "Merge.png")
    185    n.addCommand("Plus", "nuke.createNode(\"Merge2\", \"operation plus name Plus\", False)", icon="MergePlus.png")
    186    n.addCommand("Matte", "nuke.createNode(\"Merge2\", \"operation matte name Matte\", False)", icon="MergeMatte.png")
    187    n.addCommand("Multiply", "nuke.createNode(\"Merge2\", \"operation multiply name Multiply\", False)", icon="MergeMultiply.png")
    188    n.addCommand("In", "nuke.createNode(\"Merge2\", \"operation in name In\", False)", icon="MergeIn.png")
    189    n.addCommand("Out", "nuke.createNode(\"Merge2\", \"operation out name Out\", False)", icon="MergeOut.png")
    190    n.addCommand("Screen", "nuke.createNode(\"Merge2\", \"operation screen name Scrn\", False)", icon="MergeScreen.png")
    191    n.addCommand("Max", "nuke.createNode(\"Merge2\", \"operation max name Max\", False)", icon="MergeMax.png")
    192    n.addCommand("Min", "nuke.createNode(\"Merge2\", \"operation min name Min\", False)", icon="MergeMin.png")
    193    n.addCommand("Absminus", "nuke.createNode(\"Merge2\", \"operation difference name Difference\", False)", icon="MergeDifference.png")
    194    m.addCommand("MergeExpression", "nuke.createNode(\"MergeExpression\")", icon="MergeExpression.png")
    195    m.addCommand("Switch", "nuke.createNode(\"Switch\")", icon="Switch.png")
    196    m.addCommand("TimeDissolve", "nuke.createNode(\"TimeDissolve\")", icon="TimeDissolve.png")
    197    m.addCommand("Premult", "nuke.createNode(\"Premult\")", icon="Premult.png")
    198    m.addCommand("Unpremult", "nuke.createNode(\"Unpremult\")", icon="Unpremult.png")
    199    m.addCommand("Blend", "nuke.createNode(\"Blend\")", icon="Blend.png")
    200    m.addCommand("ZMerge", "nuke.createNode(\"ZMerge\")", icon="ZMerge.png")
    201
    202
    203    # The "Transform" menu
    204    m = toolbar.addMenu("Transform", "ToolbarTransform.png")
    205    m.addCommand("Transform", "nuke.createNode(\"Transform\")", "t", icon="2D.png")
    206    m.addCommand("@;&Transform Branch", "nuke.createNode(\"Transform\")", "+t")
    207    m.addCommand("TransformMasked", "nuke.createNode(\"TransformMasked\")", icon="2DMasked.png")
    208    m.addCommand("Card3D", "nuke.createNode(\"Card3D\")", icon="3D.png")
    209    m.addCommand("AdjustBBox", "nuke.createNode(\"AdjBBox\")", icon="AdjBBox.png")
    210    m.addCommand("BlackOutside", "nuke.createNode(\"BlackOutside\")", icon="BlackOutside.png")
    211    m.addCommand("CameraShake", "nuke.createNode(\"CameraShake2\")", icon="CameraShake.png")
    212    m.addCommand("Crop", "nuke.createNode(\"Crop\")", icon="Crop.png")
    213    m.addCommand("CornerPin", "nuke.createNode(\"CornerPin2D\")", icon="CornerPin.png")
    214    m.addCommand("SphericalTransform", "nuke.createNode(\"SphericalTransform\")", icon="EnvironMaps.png")
    215    m.addCommand("IDistort", "nuke.createNode(\"IDistort\")", icon="IDistort.png")
    216    m.addCommand("LensDistortion", "nuke.createNode(\"LensDistortion1_0\")", icon="LensDistort.png")
    217    m.addCommand("Mirror", "nuke.createNode(\"Mirror\")", icon="Mirror.png")
    218    m.addCommand("Position", "nuke.createNode(\"Position\")", icon="Position.png")
    219    m.addCommand("Reformat", "nuke.createNode(\"Reformat\")", icon="Reformat.png")
    220    m.addCommand("Reconcile3D", "nuke.createNode(\"Reconcile3D\")", icon="Reconcile3D.png")
    221    m.addCommand("PointsTo3D", "nuke.createNode(\"PointsTo3D\")", icon="PointsTo3D.png")
    222    m.addCommand("PlanarTracker", "nukescripts.create_planartracker()", icon="planar_tracker.png")
    223    m.addCommand("Tracker", "nuke.createNode(\"Tracker3\")", icon="Tracker.png")
    224    m.addCommand("TVIScale", "nuke.createNode(\"TVIscale\")", icon="TVIScale.png")
    225    m.addCommand("GridWarp", "nuke.createNode(\"GridWarp3\")", icon="GridWarp.png")
    226    m.addCommand("SplineWarp", "nuke.createNode(\"SplineWarp3\")", icon="SplineWarp.png")
    227    m.addCommand("Stabilize", "nuke.createNode(\"Stabilize2D\")", icon="Stabilize.png")
    228    m.addCommand("STMap", "nuke.createNode(\"STMap\")", icon="STMap.png")
    229    m.addCommand("Tile", "nuke.createNode(\"Tile\")", icon="Tile.png")
    230
    231    #m.addCommand("AutoCrop", "nukescripts.autocrop()", icon="AutoCrop.png")
    232
    233
    234    # The "3D" menu
    235    m = toolbar.addMenu("3D", "Toolbar3D.png")
    236
    237    m.addCommand("Axis", "nuke.createNode(\"Axis2\")", icon="Axis.png")
    238
    239    n = m.addMenu("Geometry", "Geometry.png")
    240    n.addCommand("Card", "nuke.createNode(\"Card2\")", icon="Card.png")
    241    n.addCommand("Cube", "nuke.createNode(\"Cube\")", icon="Cube.png")
    242    n.addCommand("Cylinder", "nuke.createNode(\"Cylinder\")", icon="Cylinder.png")
    243    n.addCommand("Modeler", "nuke.createNode(\"Modeler1_0\")", icon="Modeler.png")
    244    n.addCommand("PointCloudGenerator", "nuke.createNode(\"PointCloudGenerator1_0\")", icon="PointCloudGenerator.png")
    245    n.addCommand("PoissonMesh", "nuke.createNode(\"PoissonMesh\")", icon="PoissonMesh.png")
    246    n.addCommand("Sphere", "nuke.createNode(\"Sphere\")", icon="Sphere.png")
    247    n.addCommand("ReadGeo", "nuke.createNode(\"ReadGeo2\")", icon="ReadGeo.png")
    248    n.addCommand("WriteGeo", "nuke.createNode(\"WriteGeo\")", icon="WriteGeo.png")
    249
    250    n = m.addMenu("Lights", "Toolbar3DLights.png")
    251    n.addCommand("Light", "nuke.createNode(\"Light2\")", icon="PointLight.png")
    252    n.addCommand("Point", "nuke.createNode(\"Light\")", icon="PointLight.png")
    253    n.addCommand("Direct", "nuke.createNode(\"DirectLight\")", icon="DirectLight.png")
    254    n.addCommand("Spot", "nuke.createNode(\"Spotlight\")", icon="SpotLight.png")
    255    n.addCommand("Environment", "nuke.createNode(\"Environment\")", icon="Environment.png")
    256
    257    n = m.addMenu("Modify", "Modify.png")
    258    n.addCommand("TransformGeo", "nuke.createNode(\"TransformGeo\")", icon="Modify.png")
    259    n.addCommand("MergeGeo", "nuke.createNode(\"MergeGeo\")", icon="Modify.png")
    260    n.addCommand("CrosstalkGeo", "nuke.createNode(\"CrosstalkGeo\")", icon="Modify.png")
    261    #n.addCommand("Connect Points", "nuke.createNode(\"ConnectPointsGeo\")", icon="Modify.png")
    262    n.addCommand("DisplaceGeo", "nuke.createNode(\"DisplaceGeo\")", icon="Modify.png")
    263    n.addCommand("GeoSelect", """nuke.createNode("GeoSelect")""", icon="Modify.png")
    264    n.addCommand("LookupGeo", "nuke.createNode(\"LookupGeo\")", icon="Modify.png")
    265    n.addCommand("LogGeo", "nuke.createNode(\"LogGeo\")", icon="Modify.png")
    266    n.addCommand("Normals", "nuke.createNode(\"Normals\")", icon="Modify.png")
    267    n.addCommand("ProceduralNoise", "nuke.createNode(\"ProcGeo\")", icon="Modify.png")
    268    n.addCommand("RadialDistort", "nuke.createNode(\"RadialDistort\")", icon="Modify.png")
    269    n.addCommand("Trilinear", "nuke.createNode(\"Trilinear\")", icon="Modify.png")
    270    n.addCommand("UVProject", "nuke.createNode(\"UVProject\")", icon="Modify.png")
    271    #n.addCommand("VectorfieldGeo", "nuke.createNode(\"VectorfieldGeo\")", icon="Modify.png")
    272    #n.addCommand("Vectorfield Create", "nuke.createNode(\"VectorfieldCreateGeo\")", icon="Modify.png")
    273
    274    n = m.addMenu("Shader", "Shaders.png")
    275    n.addCommand("ApplyMaterial", "nuke.createNode(\"ApplyMaterial\")", icon="Shader.png")
    276    n.addCommand("BasicMaterial", "nuke.createNode(\"BasicMaterial\")", icon="Shader.png")
    277    n.addCommand("FillMat", "nuke.createNode(\"FillMat\")", icon="Shader.png")
    278    n.addCommand("MergeMat", "nuke.createNode(\"MergeMat\")", icon="Shader.png")
    279    n.addCommand("BlendMat", "nuke.createNode(\"BlendMat\")", icon="Shader.png")
    280    n.addCommand("Project3D", "nuke.createNode(\"Project3D\")", icon="Shader.png")
    281    n.addCommand("Diffuse", "nuke.createNode(\"Diffuse\")", icon="Shader.png")
    282    n.addCommand("Emission", "nuke.createNode(\"Emission\")", icon="Shader.png")
    283    n.addCommand("Phong", "nuke.createNode(\"Phong\")", icon="Shader.png")
    284    n.addCommand("Specular", "nuke.createNode(\"Specular\")", icon="Shader.png")
    285    n.addCommand("Displacement", "nuke.createNode(\"Displacement\")", icon="Shader.png")
    286    n = n.addMenu("RenderMan", "Shaders.png")
    287    n.addCommand("Reflection", "nuke.createNode(\"Reflection\")", icon="Shader.png")
    288    n.addCommand("Refraction", "nuke.createNode(\"Refraction\")", icon="Shader.png")
    289
    290    m.addCommand("Camera", "nuke.createNode(\"Camera2\")", icon="Camera.png")
    291    m.addCommand("CameraTracker", "nuke.createNode(\"CameraTracker1_0\")", icon="CameraTracker.png")
    292    m.addCommand("DepthGenerator", "nuke.createNode(\"DepthGenerator1_0\")", icon="DepthGenerator.png")
    293    m.addCommand("ProjectionSolver", "nuke.createNode(\"ProjectionSolver1_0\")", icon="Camera.png")
    294    m.addCommand("Scene", "nuke.createNode(\"Scene\")", icon="Scene.png")
    295    m.addCommand("ScanlineRender", "nuke.createNode(\"ScanlineRender\")", icon="Render.png")
    296
    297    m = m.addMenu("RenderMan", "Toolbar3D.png")
    298    m.addCommand("PrmanRender","nukescripts.createPrmanRender()", icon="Render.png")
    299
    300    # particles menu
    301    m = toolbar.addMenu("Particles", "ToolbarParticles.png")
    302    m.addCommand("ParticleEmitter")
    303
    304    m.addCommand("ParticleBounce")
    305    m.addCommand("ParticleCurve")
    306    m.addCommand("ParticleDirectionalForce")
    307    m.addCommand("ParticleDrag")
    308    m.addCommand("ParticleExpression")
    309    m.addCommand("ParticleMerge")
    310    m.addCommand("ParticleMotionAlign")
    311    m.addCommand("ParticleGravity")
    312    m.addCommand("ParticleLookAt")
    313    m.addCommand("ParticlePointForce")
    314    m.addCommand("ParticleSpeedLimit")
    315    m.addCommand("ParticleSpawn")
    316    m.addCommand("ParticleTurbulence")
    317    m.addCommand("ParticleVortex")
    318    m.addCommand("ParticleWind")
    319
    320    m.addCommand("ParticleSettings", icon="particle_settings.png")
    321
    322    m.addCommand("ParticleToGeo")
    323
    324    # deep menu
    325    m = toolbar.addMenu("Deep", "ToolbarDeep.png")
    326    m.addCommand("DeepColorCorrect")
    327    m.addCommand("DeepCrop")
    328    m.addCommand("DeepExpression")
    329    m.addCommand("DeepFromFrames")
    330    m.addCommand("DeepFromImage")
    331    m.addCommand("DeepHoldout", "nuke.createNode('DeepHoldout2')" )
    332    m.addCommand("DeepMerge")
    333    m.addCommand("DeepRead", '''nukescripts.create_read("DeepRead")''')
    334    m.addCommand("DeepRecolor")
    335    m.addCommand("DeepReformat")
    336    m.addCommand("DeepSample")
    337    m.addCommand("DeepToImage")
    338    m.addCommand("DeepToPoints")
    339    m.addCommand("DeepTransform")
    340
    341    # Views menu
    342    m = toolbar.addMenu("Views", "ToolbarViews.png")
    343    n = m.addMenu("Stereo", "ToolbarStereo.png")
    344    n.addCommand("Anaglyph", "nuke.createNode(\"Anaglyph\")", icon="Anaglyph.png")
    345    n.addCommand("MixViews", "nuke.createNode(\"MixViews\")", icon="MixViews.png")
    346    n.addCommand("SideBySide", "nuke.createNode(\"SideBySide\")", icon="SideBySide.png")
    347    n.addCommand("ReConverge", "nuke.createNode(\"ReConverge\")", icon="ReConverge.png")
    348
    349    m.addCommand("JoinViews", "nuke.createNode(\"JoinViews\")", icon="JoinViews.png")
    350    m.addCommand("OneView", "nuke.createNode(\"OneView\")", icon="OneView.png")
    351    m.addCommand("ShuffleViews", "nuke.createNode(\"ShuffleViews\")", icon="ShuffleViews.png")
    352    m.addCommand("Split and Join", "nukescripts.create_viewsplitjoin()", icon="SplitAndJoin.png")
    353
    354    m = toolbar.addMenu("MetaData", "MetaData.png")
    355    m.addCommand("ViewMetaData", "nuke.createNode(\"ViewMetaData\")", icon="ViewMetaData.png")
    356    m.addCommand("CompareMetaData", "nuke.createNode(\"CompareMetaData\")", icon="CompareMetaData.png")
    357    m.addCommand("ModifyMetaData", "nuke.createNode(\"ModifyMetaData\")", icon="ModifyMetaData.png")
    358    m.addCommand("CopyMetaData", "nuke.createNode(\"CopyMetaData\")", icon="CopyMetaData.png")
    359    m.addCommand("AddTimeCode", "nuke.createNode(\"AddTimeCode\")", icon="AddTimeCode.png")
    360
    361    import nukescripts.toolsets
    362    nukescripts.toolsets.createToolsetsMenu(toolbar)
    363    nukescripts.createNodePresetsMenu()
    364
    365
    366    # The "Other" menu
    367    m = toolbar.addMenu("Other", "ToolbarOther.png")
    368    m.addCommand("AudioRead", "nuke.createNode(\"AudioRead\")", icon="Read.png")
    369    m.addCommand("Assert", "nuke.createNode(\"Assert\")", icon="Assert.png")
    370    m.addCommand("Backdrop", "nukescripts.autoBackdrop()", icon="Backdrop.png")
    371    m.addCommand("DiskCache", "nuke.createNode(\"DiskCache\")", ".", icon="DiskCache.png")
    372    m.addCommand("Dot", "nuke.createNode(\"Dot\", inpanel=False)", ".", icon="Dot.png")
    373    m.addCommand("Input", "nuke.createNode(\"Input\")", icon="Input.png")
    374    m.addCommand("Output", "nuke.createNode(\"Output\")", icon="Output.png")
    375    m.addCommand("NoOp", "nuke.createNode(\"NoOp\")", icon="NoOp.png")
    376    m.addCommand("PostageStamp", "nuke.createNode(\"PostageStamp\")", icon="PostageStamp.png")
    377    m.addCommand("Group", "nuke.collapseToGroup()", icon="Group.png")
    378    m.addCommand("Precomp", "nukescripts.precomp_selected()","^+p", icon="Precomp.png")
    379
    380    m.addCommand("StickyNote", "nukescripts.toolbar_sticky_note()", "#n", icon="StickyNote.png")
    381    n = m.addMenu("All plugins", "AllPlugins.png")
    382    n.addCommand("Update", "nukescripts.update_plugin_menu(\"All plugins\")")
    383
    384    # The OFX plugins menus
    385    nuke.ofxMenu("")
    386
    387    # Have to remove some of the furnace core nodes that get added automatically in nuke.ofxMenu()
    388    m = toolbar.menu("FurnaceCore")
    389    m.removeItem("F_DeGrain")
    390    m.removeItem("F_DeNoise")
    391
    392    m = None
    393    n = None
    394
    395
    396  # Some helper functions that we can call from the toolbar items.
    397
    398 -def create_time_warp():
    399    t = nuke.createNode("TimeWarp")
    400    a = nuke.value(t.name()+".first_frame")
    401    e = nuke.value(t.name()+".last_frame")
    402    if float(e)<=float(a):
    403      a = nuke.value("root.first_frame")
    404      e = nuke.value("root.last_frame")
    405    cmd = "{curve C x"+a+" "+a+" x"+e+" "+e+"}"
    406    t.knob("lookup").fromScript(cmd)
    407
    408
    409 -def create_matrix():
    410    p = nuke.Panel("Enter desired matrix size:")
    411    p.addSingleLineInput("width", 3)
    412    p.addSingleLineInput("height", 3)
    413    ret = p.show()
    414    if ret == 1:
    415      wdt = p.value("width")
    416      hgt = p.value("height")
    417      a = " { "+" 0 "*int(wdt)+" } "
    418      a = "{ " + a*int(hgt) + " }"
    419      nuke.createNode("Matrix", "matrix "+a)
    420
    421
    422 -def toolbar_sticky_note():
    423    sticky = nuke.createNode("StickyNote")
    424    sticky.knob("label").setValue("type note here")
    425    sticky.knob("selected").setValue(False)
    426
    427 -def createPrmanRender():
    428    try:
    429      nuke.createNode( "PrmanRender" )
    430    except:
    431      msg = "Could not create PrmanRender node.\n\nThis is usually because the library search path environment variable is not set correctly so Nuke can't link with the prman libraries.\n"
    432      if not os.environ.has_key('RMANTREE'):
    433        msg = msg + "\nAlso, the RMANTREE environment variable is not set.\n"
    434
    435      if  nuke.env['MACOS']:
    436        msg = msg + "\nIf you are launching Nuke from an icon on Mac OSX you may need to add environment variable settings to your environment plist file (~/.MacOSX/environment.plist).\n"
    437      msg = msg + "\nCheck your Pixar Photorealistic Renderman documentation section \"RenderMan Pro Server > Administration > Installation\" for platform-specific installation instructions."
    438
    439      nuke.message( msg )
    440
    441 -def create_planartracker():
    442
    443    rotoNode = nuke.createNode("Roto", "output {rgba.alpha none none mask_planartrack.a}", False)
    444    rotoLayerId = 1
    445    rotoLayerName = "PlanarTrackLayer"+str(rotoLayerId)
    446
    447    highestId = 0
    448    for p in nuke.allNodes("PlanarTracker1_0"):
    449      rotoTrackLayer = p["rotoTrackLayer"].getText()
    450      rotoTrackLayerSplit = rotoTrackLayer.split('.')
    451      if len(rotoTrackLayerSplit) == 3:
    452        try:
    453          highestId = max(int(rotoTrackLayerSplit[1]), highestId)
    454        except:
    455          pass
    456    rotoLayerId = highestId + 1
    457
    458    rotoTrackLayer = rotoNode.name() + "." + str(rotoLayerId) + "." + rotoLayerName
    459
    460    rotoCurves = rotoNode["curves"]
    461    rotoCurveRoot = rotoCurves.rootLayer
    462    planarLayer = nuke.rotopaint.Layer(rotoCurves)
    463    rotoCurveRoot.append(planarLayer)
    464    atr = planarLayer.getAttributes()
    465    planarLayer.name = rotoLayerName
    466    planarLayer.getAttributes().set(nuke.rotopaint.AnimAttributes.kPlanarTrackLayerAttribute,rotoLayerId)
    467
    468    planarLayer.setFlag(nuke.rotopaint.FlagType.eSelectedFlag, 1)
    469    rotoCurves.changed()
    470    rotoNode.showControlPanel()
    471
    472    planarTrackerNode = nuke.createNode("PlanarTracker1_0", "rotoTrackLayer "+rotoTrackLayer + " ignoreMaskId " + str(rotoLayerId) + " label " + rotoLayerName, False)
    473    planarTrackerNode.setXYpos( rotoNode.xpos() + 120, rotoNode.ypos() )
    474
    475    if rotoNode.inputs() > 0:
    476      aViewer = nuke.activeViewer()
    477      vIndex = None
    478      if aViewer != None:
    479        vIndex = aViewer.activeInput()
    480      if vIndex == None:
    481        vIndex = 0
    482      nuke.connectViewer(vIndex, rotoNode)
    483