Source code for nukescripts.toolbars

# Copyright (c) 2009 The Foundry Visionmongers Ltd.  All Rights Reserved.

import nuke_internal as nuke
import nukescripts
import os, os.path
import enum
from enum import IntEnum

# Define the tool menus. This file is loaded by menu.py.
[docs]def setup_toolbars(): # This is not currently used but when we support a text-only mode we'll need it. #size = nuke.numvalue("preferences.toolbarTextSize") # Use the following options to set the shortcut context in the call to menu addCommand. # Setting the shortcut context to a widget will mean the shortcut will only be triggered # if that widget (or it's children) has focus. If no shortcut context is specified the # default context is window context i.e. it can be triggered from anywhere in the window. # The enum is defined in nk_menu_python_add_item in PythonObject.cpp windowContext = 0 applicationContext = 1 dagContext = 2 # Enumerate possible menu item tags. It defaults to MenuItemTag.NoTag, if not specified. @enum.unique class MenuItemTag(IntEnum): NoTag = 0 Beta = 1 Classic = 2 # Enumerate possible menu item tag targets - widgets where the tag should be present. # It defaults to MenuItemTagTargetFlag.All, if not specified. @enum.unique class MenuItemTagTargetFlag(IntEnum): Unknown = 0 ToolbarMenu = 1 TabMenu = 2 ContextMenu = 4 All = 7 # Get the top-level toolbar toolbar = nuke.menu("Nodes") assist = nuke.env['assist'] # The "Image" menu m = toolbar.addMenu("Image", "ToolbarImage.png") m.addCommand("Read", "nukescripts.create_read()", "r", icon="Read.png", shortcutContext=dagContext) m.addCommand("Write", "nuke.createNode(\"Write\")", "w", icon="Write.png", shortcutContext=dagContext) m.addCommand("Profile", "nuke.createNode(\"Profile\")", icon="Write.png", shortcutContext=dagContext) if not assist: m.addCommand("UDIM import", "nukescripts.udim_import()", "u", icon="Read.png", shortcutContext=dagContext) m.addCommand("UnrealReader", "nuke.createNode(\"UnrealReader\")", icon="Read.png") m.addCommand("Constant", "nuke.createNode(\"Constant\")", icon="Constant.png") m.addCommand("CheckerBoard", "nuke.createNode(\"CheckerBoard2\")", icon="CheckerBoard.png") m.addCommand("ColorBars", "nuke.createNode(\"ColorBars\")", icon="ColorBars.png") m.addCommand("ColorWheel", "nuke.createNode(\"ColorWheel\")", icon="ColorWheel.png") if not assist: m.addCommand("CurveTool", "nukescripts.createCurveTool()", icon="CurveTool.png") m.addCommand("Viewer", "nuke.createNode(\"Viewer\")", icon="Viewer.png") # m.addCommand("Proxy", "nuke.knob(\"root.proxy\", \"!root.proxy\")", icon="proxyfullres.png") # The "Draw" menu m = toolbar.addMenu("Draw", "ToolbarDraw.png") m.addCommand("Roto", '''nuke.createNode("Roto")''', "o", icon="Roto.png", shortcutContext=dagContext) m.addCommand("RotoPaint", "nuke.createNode(\"RotoPaint\")", "p", icon="RotoPaint.png", shortcutContext=dagContext) m.addCommand("@;RotoBranch", "nuke.createNode(\"Roto\")", "+o", shortcutContext=dagContext) m.addCommand("@;RotoPaintBranch", "nuke.createNode(\"RotoPaint\")", "+p", shortcutContext=dagContext) m.addCommand("Dither", "nuke.createNode(\"Dither\")", icon="Dither.png") m.addCommand("DustBust", "nuke.createNode(\"DustBust\")", icon="DustBust.png") m.addCommand("Grain", "nuke.createNode(\"Grain2\")", icon="Grain.png") m.addCommand("ScannedGrain", "nuke.createNode(\"ScannedGrain\")", icon="ScannedGrain.png") m.addCommand("Glint", "nuke.createNode(\"Glint\")", icon="Glint.png") m.addCommand("Grid", "nuke.createNode(\"Grid\")", icon="Grid.png") m.addCommand("Flare", "nuke.createNode(\"Flare\")", icon="Flare.png") m.addCommand("LightWrap", "nuke.createNode(\"LightWrap\")", icon="LightWrap.png") m.addCommand("MarkerRemoval", "nuke.createNode(\"MarkerRemoval\")", icon="MarkerRemoval.png") m.addCommand("Noise", "nuke.createNode(\"Noise\")", icon="Noise.png") m.addCommand("Radial", "nuke.createNode(\"Radial\")", icon="Radial.png") m.addCommand("Ramp", "nuke.createNode(\"Ramp\")", icon="Ramp.png") m.addCommand("Rectangle", "nuke.createNode(\"Rectangle\")", icon="Rectangle.png") m.addCommand("Sparkles", "nuke.createNode(\"Sparkles\")", icon="Sparkles.png") m.addCommand("Text", "nuke.createNode(\"Text2\")", icon="Text.png") m = toolbar.addMenu("Time", "ToolbarTime.png") m.addCommand("Add 3:2 pulldown", "nuke.createNode(\"add32p\")", icon="Add32.png") m.addCommand("Remove 3:2 pulldown", "nuke.createNode(\"remove32p\")", icon="Remove32.png") m.addCommand("AppendClip", "nuke.createNode(\"AppendClip\")", icon="AppendClip.png") m.addCommand("FrameBlend", "nuke.createNode(\"FrameBlend\")", icon="FrameBlend.png") m.addCommand("FrameHold", "nuke.createNode(\"FrameHold\")", icon="FrameHold.png") m.addCommand("FrameRange", "nuke.createNode(\"FrameRange\")", icon="FrameRange.png") if not assist: m.addCommand("Kronos", "nukescripts.createKronos()", icon="Oflow.png") m.addCommand("OFlow", "nukescripts.createOFlow()", icon="Oflow.png") m.addCommand("Retime", "nuke.createNode(\"Retime\")", icon="Retime.png") m.addCommand("TemporalMedian", "nuke.createNode(\"TemporalMedian\")", icon="TemporalMedian.png") m.addCommand("TimeBlur", "nuke.createNode(\"TimeBlur\")", icon="TimeBlur.png") m.addCommand("NoTimeBlur", "nuke.createNode(\"NoTimeBlur\")", icon="NoTimeBlur.png") m.addCommand("TimeEcho", "nuke.createNode(\"TimeEcho\")", icon="TimeEcho.png") m.addCommand("TimeOffset", "nuke.createNode(\"TimeOffset\")", icon="TimeOffset.png") if not assist: m.addCommand("TimeWarp", "nukescripts.create_time_warp()", icon="TimeWarp.png") m.addCommand("TimeClip") m.addCommand("SmartVector", "nuke.createNode(\"SmartVector\")", icon="SmartVector.png") m.addCommand("VectorToMotion", "nuke.createNode(\"VectorToMotion\")", icon="VectorToMotion.png") m.addCommand("VectorGenerator", "nuke.createNode(\"VectorGenerator\")") # The "Channel" menu m = toolbar.addMenu("Channel", "ToolbarChannel.png") m.addCommand("Shuffle", "nuke.createNode(\"Shuffle2\")", icon="Shuffle.png") m.addCommand("Copy", "nuke.createNode(\"Copy\")", "k", icon="CopyNode.png", shortcutContext=dagContext) m.addCommand("@;CopyBranch", "nuke.createNode(\"Copy\")", "+k", shortcutContext=dagContext) m.addCommand("ChannelMerge", "nuke.createNode(\"ChannelMerge\")", icon="ChannelMerge.png") m.addCommand("Add", "nuke.createNode(\"AddChannels\")", icon="Add.png") m.addCommand("Remove","nuke.createNode(\"Remove\")", icon="Remove.png") # The "Color" menu m = toolbar.addMenu("Color", "ToolbarColor.png") n = m.addMenu("Math", "ColorMath.png") n.addCommand("Add", "nuke.createNode(\"Add\")", icon="ColorAdd.png") n.addCommand("Multiply", "nuke.createNode(\"Multiply\")", icon="ColorMult.png") n.addCommand("Gamma", "nuke.createNode(\"Gamma\")", icon="ColorGamma.png") n.addCommand("ClipTest", "nuke.createNode(\"ClipTest\")", icon="ClipTest.png") n.addCommand("ColorMatrix", "nuke.createNode(\"ColorMatrix\")", icon="ColorMatrix.png") n.addCommand("Expression", "nuke.createNode(\"Expression\")", icon="Expression.png") n = m.addMenu("OCIO", "OCIO.png") n.addCommand("OCIO CDLTransform", "nuke.createNode(\"OCIOCDLTransform\")", icon="OCIO.png") n.addCommand("OCIO ColorSpace", "nuke.createNode(\"OCIOColorSpace\")", icon="OCIO.png") n.addCommand("OCIO Display", "nuke.createNode(\"OCIODisplay\")", icon="OCIO.png") n.addCommand("OCIO FileTransform", "nuke.createNode(\"OCIOFileTransform\")", icon="OCIO.png") n.addCommand("OCIO LogConvert", "nuke.createNode(\"OCIOLogConvert\")", icon="OCIO.png") n.addCommand("OCIO LookTransform", "nuke.createNode(\"OCIOLookTransform\")", icon="OCIO.png") n.addCommand("OCIO NamedTransform", "nuke.createNode(\"OCIONamedTransform\")", icon="OCIO.png", tag=MenuItemTag.Beta, nodeClass="OCIONamedTransform") n = m.addMenu("3D LUT", "Toolbar3DLUT.png") n.addCommand("CMSTestPattern", "nuke.createNode(\"CMSTestPattern\")", icon="CMSTestPattern.png") n.addCommand("GenerateLUT", "nuke.createNode(\"GenerateLUT\")", icon="GenerateLUT.png") n.addCommand("Vectorfield (Apply 3D LUT)", "nuke.createNode(\"Vectorfield\")", icon="Vectorfield.png") m.addCommand("Clamp", "nuke.createNode(\"Clamp\")", icon="Clamp.png") m.addCommand("ColorLookup", "nuke.createNode(\"ColorLookup\")", icon="ColorLookup.png") m.addCommand("Colorspace", "nuke.createNode(\"Colorspace\")", icon="ColorSpace.png") m.addCommand("ColorTransfer", "nuke.createNode(\"ColorTransfer\")", icon="ColorTransfer.png") m.addCommand("ColorCorrect", "nuke.createNode(\"ColorCorrect\")", "c", icon="ColorCorrect.png", shortcutContext=dagContext) m.addCommand("@;ColorCorrectBranch", "nuke.createNode(\"ColorCorrect\")", "+c") m.addCommand("Crosstalk", "nuke.createNode(\"CCrosstalk\")", icon="Crosstalk.png") m.addCommand("Exposure", "nuke.createNode(\"EXPTool\")", icon="Exposure.png") m.addCommand("Grade", "nuke.createNode(\"Grade\")", "g", icon="Grade.png", shortcutContext=dagContext) m.addCommand("@;GradeBranch", "nuke.createNode(\"Grade\")", "+g", shortcutContext=dagContext) m.addCommand("Histogram", "nuke.createNode(\"Histogram\")", icon="Histogram.png") m.addCommand("HistEQ", "nuke.createNode(\"HistEQ\")", icon="HistEQ.png") m.addCommand("HueCorrect", "nuke.createNode(\"HueCorrect\")", icon="HueCorrect.png") m.addCommand("HueShift", "nuke.createNode(\"HueShift\")", icon="HueShift.png") m.addCommand("HSVTool", "nuke.createNode(\"HSVTool\")", icon="HSVTool.png") m.addCommand("Invert", "nuke.createNode(\"Invert\")", icon="Invert.png") m.addCommand("Log2Lin", "nuke.createNode(\"Log2Lin\")", icon="Log2Lin.png") m.addCommand("PLogLin", "nuke.createNode(\"PLogLin\")", icon="Log2Lin.png") m.addCommand("MatchGrade", "nuke.createNode(\"MatchGrade\")", icon="MatchGrade.png") m.addCommand("MinColor", "nuke.createNode(\"MinColor\")", icon="MinColor.png") m.addCommand("Posterize", "nuke.createNode(\"Posterize\")", icon="Posterize.png") m.addCommand("RolloffContrast", "nuke.createNode(\"RolloffContrast\")", icon="RolloffContrast.png") m.addCommand("Saturation", "nuke.createNode(\"Saturation\")", icon="Saturation.png") m.addCommand("Sampler", "nuke.createNode(\"Sampler\")", icon="Sampler.png") m.addCommand("SoftClip", "nuke.createNode(\"SoftClip\")", icon="SoftClip.png") m.addCommand("Toe", "nuke.createNode(\"Toe2\")", icon="Toe.png" ) # The "Filter" menu m = toolbar.addMenu("Filter", "ToolbarFilter.png") m.addCommand("Blur", "nuke.createNode(\"Blur\")", "b", icon="Blur.png", shortcutContext=dagContext) m.addCommand("@;BlurBranch", "nuke.createNode(\"Blur\")", "+b", shortcutContext=dagContext) m.addCommand("Bilateral", "nuke.createNode(\"Bilateral2\")", icon="Bilateral.png") m.addCommand("Bokeh", "nuke.createNode(\"Bokeh\")", icon="pgBokeh.png") m.addCommand("BumpBoss", "nuke.createNode(\"BumpBoss\")", icon="BumpBoss.png") m.addCommand("Convolve", "nuke.createNode(\"Convolve2\")", icon="Convolve.png") m.addCommand("Defocus", "nuke.createNode(\"Defocus\")", icon="Defocus.png") m.addCommand("DegrainBlue", "nuke.createNode(\"DegrainBlue\")", icon="DegrainBlue.png") m.addCommand("DegrainSimple", "nuke.createNode(\"DegrainSimple\")", icon="DegrainSimple.png") m.addCommand("Denoise", "nuke.createNode(\"Denoise2\")", icon="denoise.png") m.addCommand("DirBlur", "nuke.createNode(\"DirBlurWrapper\")", icon="DirBlur.png") m.addCommand("DropShadow", "nuke.createNode(\"DropShadow\")", icon="DropShadow.png") m.addCommand("EdgeBlur", "nuke.createNode(\"EdgeBlur\")", icon="EdgeBlur.png") m.addCommand("EdgeDetect", "nuke.createNode(\"EdgeDetectWrapper\")", icon="EdgeDetect.png") m.addCommand("EdgeExtend", "nuke.createNode(\"EdgeExtend\")", icon="EdgeExtend.png") m.addCommand("Emboss", "nuke.createNode(\"Emboss\")", icon="Emboss.png") m.addCommand("Erode (fast)", "nuke.createNode(\"Dilate\")", icon="ErodeFast.png") m.addCommand("Erode (filter)", "nuke.createNode(\"FilterErode\")", icon="FilterErode.png") m.addCommand("Erode (blur)", "nuke.createNode(\"Erode\")", icon="ErodeBlur.png") m.addCommand("Glow", "nuke.createNode(\"Glow2\")", icon="Glow.png") m.addCommand("GodRays", "nuke.createNode(\"GodRays\")", icon="GodRays.png") m.addCommand("Inpaint", "nuke.createNode(\"Inpaint2\")", icon="Inpaint.png") m.addCommand("Laplacian", "nuke.createNode(\"Laplacian\")", icon="Laplacian.png") m.addCommand("LevelSet", "nuke.createNode(\"LevelSet\")", icon="LevelSet.png") if not assist: m.addCommand("Matrix...", "nukescripts.create_matrix()", icon="Matrix.png") m.addCommand("Median", "nuke.createNode(\"Median\")", icon="Median.png") m.addCommand("MotionBlur", "nuke.createNode(\"MotionBlur\")", icon="MotionBlur2D.png") m.addCommand("MotionBlur2D", "nuke.createNode(\"MotionBlur2D\")", icon="MotionBlur2D.png") m.addCommand("MotionBlur3D", "nuke.createNode(\"MotionBlur3D\")", icon="MotionBlur3D.png") m.addCommand("Sharpen", "nuke.createNode(\"Sharpen\")", icon="Sharpen.png") m.addCommand("Soften", "nuke.createNode(\"Soften\")", icon="Soften.png") m.addCommand("VectorBlur", "nuke.createNode(\"VectorBlur2\")", icon="VectorBlur.png") m.addCommand("VolumeRays", "nuke.createNode(\"VolumeRays\")", icon="VolumeRays.png") m.addCommand("ZDefocus", "nuke.createNode(\"ZDefocus2\")", icon="ZBlur.png") m.addCommand("ZSlice", "nuke.createNode(\"ZSlice\")", icon="ZSlice.png") # The "Keyer" menu m = toolbar.addMenu("Keyer", "ToolbarKeyer.png") m.addCommand("ChromaKeyer", "nuke.createNode(\"ChromaKeyer\")", icon="ChromaKeyer.png") m.addCommand("Cryptomatte", "nuke.createNode(\"Cryptomatte\")", icon="Cryptomatte.png") m.addCommand("Encryptomatte", "nuke.createNode(\"Encryptomatte\")", icon="Encryptomatte.png") m.addCommand("Difference", "nuke.createNode(\"Difference\")", icon="DifferenceKeyer.png") m.addCommand("HueKeyer", "nuke.createNode(\"HueKeyer\")", icon="HueKeyer.png") if not assist: m.addCommand("IBKColour", "nuke.tcl(\"IBKColourV3\")", icon="IBKColour.png") m.addCommand("IBKGizmo", "nuke.tcl(\"IBKGizmoV3\")", icon="IBKGizmo.png") m.addCommand("Keyer", "nuke.createNode(\"Keyer\")", icon="Keyer.png") m.addCommand("Keylight", 'nuke.createNode("OFXuk.co.thefoundry.keylight.keylight_v201")', icon="Keylight.png") m.addCommand("Primatte", "nuke.createNode(\"Primatte3\")", icon="Primatte.png") m.addCommand("Ultimatte", "nuke.createNode(\"Ultimatte\")", icon="Ultimatte.png") # The "Merge" menu m = toolbar.addMenu("Merge", "ToolbarMerge.png") m.addCommand("AddMix", "nuke.createNode(\"AddMix\")", "+a", icon="AddMix.png", shortcutContext=dagContext) m.addCommand("KeyMix", "nuke.createNode(\"Keymix\")", icon="Keymix.png") m.addCommand("ContactSheet", "nuke.createNode(\"ContactSheet\")", icon="ContactSheet.png") m.addCommand("CopyBBox", "nuke.createNode(\"CopyBBox\")", icon="CopyBBox.png") m.addCommand("CopyRectangle", "nuke.createNode(\"CopyRectangle\")", icon="CopyRectangle.png") m.addCommand("Dissolve", "nuke.createNode(\"Dissolve\")", icon="Dissolve.png") m.addCommand("LayerContactSheet", "nuke.createNode(\"LayerContactSheet\")", icon="LayerContactSheet.png") m.addCommand("Merge", "nuke.createNode(\"Merge2\")", "m", icon="Merge.png", shortcutContext=dagContext) m.addCommand("@;MergeBranch", "nuke.createNode(\"Merge2\")", "+m", shortcutContext=dagContext) n = m.addMenu("Merges", "Merge.png") if not assist: n.addCommand("Plus", "nuke.createNode(\"Merge2\", \"operation plus name Plus\", False)", icon="MergePlus.png") n.addCommand("Matte", "nuke.createNode(\"Merge2\", \"operation matte name Matte\", False)", icon="MergeMatte.png") n.addCommand("Multiply", "nuke.createNode(\"Merge2\", \"operation multiply name Multiply\", False)", icon="MergeMultiply.png") n.addCommand("In", "nuke.createNode(\"Merge2\", \"operation in name In\", False)", icon="MergeIn.png") n.addCommand("Out", "nuke.createNode(\"Merge2\", \"operation out name Out\", False)", icon="MergeOut.png") n.addCommand("Screen", "nuke.createNode(\"Merge2\", \"operation screen name Scrn\", False)", icon="MergeScreen.png") n.addCommand("Max", "nuke.createNode(\"Merge2\", \"operation max name Max\", False)", icon="MergeMax.png") n.addCommand("Min", "nuke.createNode(\"Merge2\", \"operation min name Min\", False)", icon="MergeMin.png") n.addCommand("Absminus", "nuke.createNode(\"Merge2\", \"operation difference name Difference\", False)", icon="MergeDifference.png") m.addCommand("MergeExpression", "nuke.createNode(\"MergeExpression\")", icon="MergeExpression.png") m.addCommand("Switch", "nuke.createNode(\"Switch\")", icon="Switch.png") if not assist: m.addCommand("TimeDissolve", "nuke.createNode(\"TimeDissolve\")", icon="TimeDissolve.png") m.addCommand("Premult", "nuke.createNode(\"Premult\")", icon="Premult.png") m.addCommand("Unpremult", "nuke.createNode(\"Unpremult\")", icon="Unpremult.png") if not assist: m.addCommand("Blend", "nuke.createNode(\"Blend\")", icon="Blend.png") m.addCommand("ZMerge", "nuke.createNode(\"ZMerge\")", icon="ZMerge.png") # The "Transform" menu m = toolbar.addMenu("Transform", "ToolbarTransform.png") m.addCommand("Transform", "nuke.createNode(\"Transform\")", "t", icon="2D.png", shortcutContext=dagContext) m.addCommand("@;Transform Branch", "nuke.createNode(\"Transform\")", "+t", shortcutContext=dagContext) m.addCommand("TransformMasked", "nuke.createNode(\"TransformMasked\")", icon="2DMasked.png") m.addCommand("Card3D", "nuke.createNode(\"Card3D\")", icon="3D.png") m.addCommand("AdjustBBox", "nuke.createNode(\"AdjBBox\")", icon="AdjBBox.png") m.addCommand("BlackOutside", "nuke.createNode(\"BlackOutside\")", icon="BlackOutside.png") m.addCommand("CameraShake", "nuke.createNode(\"CameraShake3\")", icon="CameraShake.png") m.addCommand("Crop", "nuke.createNode(\"Crop\")", icon="Crop.png") m.addCommand("CornerPin", "nuke.createNode(\"CornerPin2D\")", icon="CornerPin.png") m.addCommand("VectorCornerPin", "nuke.createNode(\"VectorCornerPin\")", icon="VectorCornerPin.png") m.addCommand("SphericalTransform", "nuke.createNode(\"SphericalTransform2\")", icon="EnvironMaps.png") m.addCommand("IDistort", "nuke.createNode(\"IDistort\")", icon="IDistort.png") m.addCommand("VectorDistort", "nuke.createNode(\"VectorDistort\")", icon="VectorDistort.png") m.addCommand("LensDistortion", "nuke.createNode(\"LensDistortion2\")", icon="LensDistort.png") m.addCommand("Mirror", "nuke.createNode(\"Mirror2\")", icon="Mirror.png") m.addCommand("Position", "nuke.createNode(\"Position\")", icon="Position.png") m.addCommand("Reformat", "nuke.createNode(\"Reformat\")", icon="Reformat.png") m.addCommand("Reconcile3D", "nuke.createNode(\"Reconcile3D\")", icon="Reconcile3D.png") m.addCommand("PointsTo3D", "nuke.createNode(\"PointsTo3D\")", icon="PointsTo3D.png") m.addCommand("PlanarTracker", "nukescripts.createPlanartracker()", icon="planar_tracker.png") m.addCommand("Tracker", "nuke.createNode(\"Tracker4\")", icon="Tracker.png") m.addCommand("TVIScale", "nuke.createNode(\"TVIscale\")", icon="TVIScale.png") m.addCommand("GridWarp", "nuke.createNode(\"GridWarp3\")", icon="GridWarp.png") m.addCommand("GridWarpTracker", "nuke.createNode(\"GridWarpTracker\")", icon="GridWarpTracker.png") m.addCommand("SplineWarp", "nuke.createNode(\"SplineWarp3\")", icon="SplineWarp.png") m.addCommand("Stabilize", "nuke.createNode(\"Stabilize2D\")", icon="Stabilize.png") m.addCommand("STMap", "nuke.createNode(\"STMap\")", icon="STMap.png") m.addCommand("Tile", "nuke.createNode(\"Tile\")", icon="Tile.png") #m.addCommand("AutoCrop", "nukescripts.autocrop()", icon="AutoCrop.png") # The "3D" menu m = toolbar.addMenu("3D", "Cube.png") m3D = m.addMenu("3D", "GeoCube_3D.png", tag=MenuItemTag.Beta) n = m3D.addMenu("Create", "Create_3D.png") n.addCommand("GeoCard", "nuke.createNode(\"GeoCard\")", icon="GeoCard_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoCube", "nuke.createNode(\"GeoCube\")", icon="GeoCube_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoCylinder", "nuke.createNode(\"GeoCylinder\")", icon="GeoCylinder_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoExport", "nuke.createNode(\"GeoExport\")", icon="GeoExport_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoImport", "nuke.createNode(\"GeoImport\")", icon="GeoImport_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoPoints", "nuke.createNode(\"GeoPoints\")", icon="GeoPoints_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoPointsToMesh", "nuke.createNode(\"GeoPointsToMesh\")", icon="GeoPointsToMesh_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoReference", "nuke.createNode(\"GeoReference\")", icon="GeoReference_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoRevolve", "nuke.createNode(\"GeoRevolve\")", icon="GeoRevolve_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoScope", "nuke.createNode(\"GeoScope\")", icon="GeoScope_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoSphere", "nuke.createNode(\"GeoSphere\")", icon="GeoSphere_3D.png", tag=MenuItemTag.Beta) n = m3D.addMenu("Lights", "Lights_3D.png") n.addCommand("DirectLight", "nuke.createNode(\"DirectLight1\")", icon="DirectLight_3D.png", tag=MenuItemTag.Beta, nodeClass="DirectLight1") n.addCommand("EnvironmentLight", "nuke.createNode(\"EnvironmentLight\")", icon="EnvironmentLight_3D.png", tag=MenuItemTag.Beta) n.addCommand("PointLight", "nuke.createNode(\"PointLight\")", icon="Light_3D.png", tag=MenuItemTag.Beta) n.addCommand("SpotLight", "nuke.createNode(\"SpotLight1\")", icon="SpotLight_3D.png", tag=MenuItemTag.Beta, nodeClass="SpotLight1") n = m3D.addMenu("Modify", "Modify_3D.png") n.addCommand("GeoBindMaterial", "nuke.createNode(\"GeoBindMaterial\")", icon="GeoBindMaterial_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoCollection", "nuke.createNode(\"GeoCollection\")", icon="GeoCollection_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoDisplace", "nuke.createNode(\"GeoDisplace\")", icon="GeoDisplace_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoDrawMode", "nuke.createNode(\"GeoDrawMode\")", icon="GeoDrawMode_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoInstance", "nuke.createNode(\"GeoInstance\")", icon="GeoInstance_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoMerge", "nuke.createNode(\"GeoMerge\")", icon="GeoMerge_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoNoise", "nuke.createNode(\"GeoNoise\")", icon="GeoNoise_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoNormals", "nuke.createNode(\"GeoNormals\")", icon="GeoNormals_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoPrune", "nuke.createNode(\"GeoPrune\")", icon="GeoPrune_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoRadialWarp", "nuke.createNode(\"GeoRadialWarp\")", icon="GeoRadialWarp_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoSelector", "nuke.createNode(\"GeoSelector\")", icon="GeoSelector_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoTransform", "nuke.createNode(\"GeoTransform\")", icon="GeoTransform_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoTrilinearWarp", "nuke.createNode(\"GeoTrilinearWarp\")", icon="GeoTrilinearWarp_3D.png", tag=MenuItemTag.Beta) n.addCommand("GeoUVProject", "nuke.createNode(\"GeoUVProject\")", icon="GeoUVProject_3D.png", tag=MenuItemTag.Beta) n = m3D.addMenu("Shader", "Shaders_3D.png") n.addCommand("BasicSurface", "nuke.createNode(\"BasicSurface\")", icon="Shader_3D.png", tag=MenuItemTag.Beta) n.addCommand("ConstantShader", "nuke.createNode(\"ConstantShader\")", icon="ConstantShader_3D.png", tag=MenuItemTag.Beta) n.addCommand("FillShader", "nuke.createNode(\"FillShader\")", icon="Shader_3D.png", tag=MenuItemTag.Beta) n.addCommand("MergeLayerShader", "nuke.createNode(\"MergeLayerShader\")", icon="MergeLayerShader_3D.png", tag=MenuItemTag.Beta) n.addCommand("PreviewSurface", "nuke.createNode(\"PreviewSurface\")", icon="Shader_3D.png", tag=MenuItemTag.Beta) n.addCommand("Project3DShader", "nuke.createNode(\"Project3DShader\")", icon="Project3D_3D.png", tag=MenuItemTag.Beta) n.addCommand("WireframeShader", "nuke.createNode(\"WireframeShader\")", icon="Shader_3D.png", tag=MenuItemTag.Beta) m3D.addCommand("Axis", "nuke.createNode(\"Axis4\")", icon="Axis_3D.png", tag=MenuItemTag.Beta, nodeClass="Axis4") m3D.addCommand("Camera", "nuke.createNode(\"Camera4\")", icon="Camera_3D.png", tag=MenuItemTag.Beta, nodeClass="Camera4") m3D.addCommand("CameraTracker", "nuke.createNode(\"CameraTracker\", \"new3D True\")", icon="CameraTracker_3D.png", tag=MenuItemTag.Beta) m3D.addCommand("DepthGenerator", "nuke.createNode(\"DepthGenerator\", \"new3D True\")", icon="DepthGenerator_3D.png", tag=MenuItemTag.Beta) m3D.addCommand("DepthToPosition", "nuke.createNode(\"DepthToPosition\")", icon="DepthToPosition_3D.png") m3D.addCommand("GeoScene", "nuke.createNode(\"GeoScene\")", icon="GeoScene_3D.png", tag=MenuItemTag.Beta) m3D.addCommand("GeoViewScene", "nuke.createNode(\"GeoViewScene\")", icon="GeoViewScene_3D.png", tag=MenuItemTag.Beta) m3D.addCommand("PointsGenerator", "nuke.createNode(\"PointsGenerator\")", icon="PointsGenerator_3D.png", tag=MenuItemTag.Beta) m3D.addCommand("ScanlineRender", "nuke.createNode(\"ScanlineRender2\")", icon="ScanlineRender_3D.png", tag=MenuItemTag.Beta, nodeClass="ScanlineRender2") m3Dclassic = m.addMenu("3D Classic", "Cube.png") m3Dclassic.addCommand("Axis", "nuke.createNode(\"Axis3\")", icon="Axis.png", tag=MenuItemTag.Classic, nodeClass="Axis3", tagTarget=MenuItemTagTargetFlag.TabMenu) n = m3Dclassic.addMenu("Geometry", "Geometry.png") n.addCommand("Card", "nuke.createNode(\"Card2\")", icon="Card.png", tag=MenuItemTag.Classic, nodeClass="Card2", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Cube", "nuke.createNode(\"Cube\")", icon="Cube.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Cylinder", "nuke.createNode(\"Cylinder\")", icon="Cylinder.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("DepthToPoints", "nuke.createNode(\"DepthToPoints\")", icon="DepthToPoints.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("ModelBuilder", "nuke.createNode(\"ModelBuilder\")", icon="Modeler.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("PointCloudGenerator", "nuke.createNode(\"PointCloudGenerator\")", icon="PointCloudGenerator.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("PositionToPoints", "nuke.createNode(\"PositionToPoints2\")", icon="PositionToPoints.png", tag=MenuItemTag.Classic, nodeClass="PositionsToPoints2", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("PoissonMesh", "nuke.createNode(\"PoissonMesh\")", icon="GeoPointsToMesh.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Sphere", "nuke.createNode(\"Sphere\")", icon="Sphere.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("ReadGeo", "nuke.createNode(\"ReadGeo2\")", icon="ReadGeo.png", tag=MenuItemTag.Classic, nodeClass="ReadGeo2", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("WriteGeo", "nuke.createNode(\"WriteGeo\")", icon="WriteGeo.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n = m3Dclassic.addMenu("Lights", "Toolbar3DLights.png") n.addCommand("Light", "nuke.createNode(\"Light3\")", icon="PointLight.png", tag=MenuItemTag.Classic, nodeClass="Light3", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Point", "nuke.createNode(\"Light\")", icon="PointLight.png", tag=MenuItemTag.Classic, nodeClass="Light", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Direct", "nuke.createNode(\"DirectLight\")", icon="DirectLight.png", tag=MenuItemTag.Classic, nodeClass="DirectLight", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Spot", "nuke.createNode(\"Spotlight\")", icon="SpotLight.png", tag=MenuItemTag.Classic, nodeClass="SpotLight", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Environment", "nuke.createNode(\"Environment\")", icon="Environment.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Relight", "nuke.createNode(\"ReLight\")", icon="ReLight.png", tag=MenuItemTag.Classic, nodeClass="ReLight", tagTarget=MenuItemTagTargetFlag.TabMenu) n = m3Dclassic.addMenu("Modify", "Modify.png") n.addCommand("TransformGeo", "nuke.createNode(\"TransformGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("MergeGeo", "nuke.createNode(\"MergeGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("CrosstalkGeo", "nuke.createNode(\"CrosstalkGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("DisplaceGeo", "nuke.createNode(\"DisplaceGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("EditGeo", "nuke.createNode(\"EditGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("GeoSelect", """nuke.createNode("GeoSelect")""", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("LookupGeo", "nuke.createNode(\"LookupGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("LogGeo", "nuke.createNode(\"LogGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Normals", "nuke.createNode(\"Normals\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("ProceduralNoise", "nuke.createNode(\"ProcGeo\")", icon="Modify.png", tag=MenuItemTag.Classic, nodeClass="ProcGeo", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("RadialDistort", "nuke.createNode(\"RadialDistort\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Trilinear", "nuke.createNode(\"Trilinear\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("UVProject", "nuke.createNode(\"UVProject\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n = n.addMenu("RenderMan", "Modify.png") n.addCommand("ModifyRIB", "nuke.createNode(\"ModifyRIB\")", icon="Modify.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n = m3Dclassic.addMenu("Shader", "Shaders.png") n.addCommand("AmbientOcclusion", "nuke.createNode(\"AmbientOcclusion\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("ApplyMaterial", "nuke.createNode(\"ApplyMaterial\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("BasicMaterial", "nuke.createNode(\"BasicMaterial\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("FillMat", "nuke.createNode(\"FillMat\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("MergeMat", "nuke.createNode(\"MergeMat\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("BlendMat", "nuke.createNode(\"BlendMat\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Project3D", "nuke.createNode(\"Project3D2\")", icon="Shader.png", tag=MenuItemTag.Classic, nodeClass="Project3D2", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Diffuse", "nuke.createNode(\"Diffuse\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Emission", "nuke.createNode(\"Emission\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Phong", "nuke.createNode(\"Phong\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Specular", "nuke.createNode(\"Specular\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Displacement", "nuke.createNode(\"Displacement\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) if not assist: n.addCommand("UVTile", "nukescripts.createUVTile()", icon="Shader.png", tag=MenuItemTag.Classic, nodeClass="UVTile2", tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Wireframe", "nuke.createNode(\"Wireframe\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Transmission", "nuke.createNode(\"Transmission\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n = n.addMenu("RenderMan", "Shaders.png") n.addCommand("Reflection", "nuke.createNode(\"Reflection\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) n.addCommand("Refraction", "nuke.createNode(\"Refraction\")", icon="Shader.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) m3Dclassic.addCommand("Camera", "nuke.createNode(\"Camera3\")", icon="Camera.png", tag=MenuItemTag.Classic, nodeClass="Camera3", tagTarget=MenuItemTagTargetFlag.TabMenu) m3Dclassic.addCommand("CameraTracker", "nuke.createNode(\"CameraTracker\")", icon="CameraTracker.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) m3Dclassic.addCommand("DepthGenerator", "nuke.createNode(\"DepthGenerator\")", icon="DepthGenerator.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) m3Dclassic.addCommand("DepthToPosition", "nuke.createNode(\"DepthToPosition\")", icon="DepthToPosition.png") m3Dclassic.addCommand("Scene", "nuke.createNode(\"Scene\")", icon="Scene.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) m3Dclassic.addCommand("ScanlineRender", "nuke.createNode(\"ScanlineRender\")", icon="Render.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) m3Dclassic.addCommand("RayRender", "nuke.createNode(\"RayRender\")", icon="Render.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) if not assist: n = m3Dclassic.addMenu("RenderMan", "Toolbar3D.png") n.addCommand("PrmanRender","nukescripts.createPrmanRender()", icon="Render.png", tag=MenuItemTag.Classic, tagTarget=MenuItemTagTargetFlag.TabMenu) # particles menu m = toolbar.addMenu("Particles", "ToolbarParticles.png") m.addCommand("ParticleEmitter") m.addCommand("ParticleBounce") m.addCommand("ParticleCache", icon="ParticleCache.png") m.addCommand("ParticleCurve") m.addCommand("ParticleDirectionalForce") m.addCommand("ParticleDrag", "nuke.createNode('ParticleDrag2')", icon="ParticleDrag.png") m.addCommand("ParticleExpression") m.addCommand("ParticleMerge") m.addCommand("ParticleMotionAlign") m.addCommand("ParticleGravity") #Disable ParticleLineForce for now as it is not ready for being included in the bundle - Bug 30000 # m.addCommand("ParticleLineForce") m.addCommand("ParticleLookAt") m.addCommand("ParticlePointForce") m.addCommand("ParticleSpeedLimit") m.addCommand("ParticleSpawn") m.addCommand("ParticleTurbulence") m.addCommand("ParticleVortex") m.addCommand("ParticleWind") m.addCommand("ParticleSettings", icon="particle_settings.png") m.addCommand("ParticleToGeo") m.addCommand("ParticleBlinkScript", icon="ParticleBlinkScript.png") n = m.addMenu("ParticleBlinkScript Gizmos", "ParticleBlinkScript.png") n.addCommand("ParticleColorByAge", icon="ParticleBlinkScript.png") n.addCommand("ParticleKill", icon="ParticleBlinkScript.png") n.addCommand("ParticleProjectDisplace", icon="ParticleBlinkScript.png") n.addCommand("ParticleProjectImage", icon="ParticleBlinkScript.png") n.addCommand("ParticleGrid", icon="ParticleBlinkScript.png") n.addCommand("ParticleDirection", icon="ParticleBlinkScript.png") n.addCommand("ParticleFuse", icon="ParticleBlinkScript.png") n.addCommand("ParticleDistributeSphere", icon="ParticleBlinkScript.png") n.addCommand("ParticleCylinderFlow", icon="ParticleBlinkScript.png") n.addCommand("ParticleConstrainToSphere", icon="ParticleBlinkScript.png") n.addCommand("ParticleFlock", icon="ParticleBlinkScript.png") n.addCommand("ParticleAttractToSphere", icon="ParticleBlinkScript.png") n.addCommand("ParticleHelixFlow", icon="ParticleBlinkScript.png") n.addCommand("ParticleShockWave", icon="ParticleBlinkScript.png") m.addCommand("ParticleInfo", icon="ParticleInfo.png") # deep menu m = toolbar.addMenu("Deep", "ToolbarDeep.png") m.addCommand("DeepColorCorrect", "nuke.createNode('DeepColorCorrect2')" ) m.addCommand("DeepCrop") m.addCommand("DeepExpression") m.addCommand("DeepFromFrames") m.addCommand("DeepFromImage") m.addCommand("DeepMerge", "nuke.createNode('DeepMerge2')") if not assist: m.addCommand("DeepRead", '''nukescripts.create_read("DeepRead")''') m.addCommand("DeepRecolor") m.addCommand("DeepReformat") m.addCommand("DeepSample") m.addCommand("DeepToImage") m.addCommand("DeepToImage", "nuke.createNode('DeepToImage2')") m.addCommand("DeepToPoints") m.addCommand("DeepTransform") m.addCommand("DeepWrite") # Views menu m = toolbar.addMenu("Views", "ToolbarViews.png") n = m.addMenu("Stereo", "ToolbarStereo.png") n.addCommand("Anaglyph", "nuke.createNode(\"Anaglyph\")", icon="Anaglyph.png") n.addCommand("MixViews", "nuke.createNode(\"MixViews\")", icon="MixViews.png") n.addCommand("SideBySide", "nuke.createNode(\"SideBySide\")", icon="SideBySide.png") n.addCommand("ReConverge", "nuke.createNode(\"ReConverge\")", icon="ReConverge.png") m.addCommand("JoinViews", "nuke.createNode(\"JoinViews\")", icon="JoinViews.png") m.addCommand("OneView", "nuke.createNode(\"OneView\")", icon="OneView.png") m.addCommand("ShuffleViews", "nuke.createNode(\"ShuffleViews\")", icon="ShuffleViews.png") m.addCommand("Split and Join", "nukescripts.create_viewsplitjoin()", icon="SplitAndJoin.png") m = toolbar.addMenu("MetaData", "MetaData.png") m.addCommand("ViewMetaData", "nuke.createNode(\"ViewMetaData\")", icon="ViewMetaData.png") m.addCommand("CompareMetaData", "nuke.createNode(\"CompareMetaData\")", icon="CompareMetaData.png") m.addCommand("ModifyMetaData", "nuke.createNode(\"ModifyMetaData\")", icon="ModifyMetaData.png") m.addCommand("CopyMetaData", "nuke.createNode(\"CopyMetaData\")", icon="CopyMetaData.png") m.addCommand("AddTimeCode", "nuke.createNode(\"AddTimeCode\")", icon="AddTimeCode.png") import nukescripts.toolsets nukescripts.toolsets.createToolsetsMenu(toolbar) nukescripts.createNodePresetsMenu() # The "Other" menu m = toolbar.addMenu("Other", "ToolbarOther.png") m.addCommand("AudioRead", "nuke.createNode(\"AudioRead\")", icon="Read.png") m.addCommand("Assert", "nuke.createNode(\"Assert\")", icon="Assert.png") m.addCommand("Backdrop", "nukescripts.autoBackdrop()", icon="Backdrop.png") m.addCommand("BlinkScript", "nuke.createNode(\"BlinkScript\")", icon="BlinkScript.png") m.addCommand("DiskCache", "nuke.createNode(\"DiskCache\")", ".", icon="DiskCache.png", shortcutContext=dagContext) m.addCommand("Dot", "nuke.createNode(\"Dot\", inpanel=False)", ".", icon="Dot.png", shortcutContext=dagContext) m.addCommand("Input", "nuke.createNode(\"Input\")", icon="Input.png") m.addCommand("Output", "nuke.createNode(\"Output\")", icon="Output.png") m.addCommand("NoOp", "nuke.createNode(\"NoOp\")", icon="NoOp.png") m.addCommand("PostageStamp", "nuke.createNode(\"PostageStamp\")", icon="PostageStamp.png") m.addCommand("Group", "nuke.collapseToGroup()", icon="Group.png") if not assist: m.addCommand("Precomp", "nukescripts.precomp_selected()","^+p", icon="Precomp.png", shortcutContext=dagContext) m.addCommand("LiveGroup", "nuke.collapseToLiveGroup()", icon="Group.png") m.addCommand("LiveInput", "nuke.createLiveInput()", icon="Input.png") m.addCommand("StickyNote", "nukescripts.toolbar_sticky_note()", "#n", icon="StickyNote.png", shortcutContext=dagContext) n = m.addMenu("All plugins", "AllPlugins.png") n.addCommand("Update", "nukescripts.update_plugin_menu(\"All plugins\")") # The OFX plugins menus nuke.ofxMenu("") # Have to remove some of the furnace core nodes that get added automatically in nuke.ofxMenu() m = toolbar.menu("FurnaceCore") if m: m.removeItem("F_DeGrain") m.removeItem("F_DeNoise") m.removeItem("F_Kronos") m.removeItem("F_MotionBlur") m.removeItem("F_VectorGenerator") m.removeItem("F_MatchGrade") # Denoise2 needs to be added after the OFX plugins menus m = toolbar.menu( 'Filter' ) if not m: # If the Filter menu is empty, eg no whitelisted filter plugins in Nuke Assist, # we must create the menu afresh, as it will not exist m = toolbar.addMenu("Filter", "ToolbarFilter.png") if m: m.addCommand("Denoise", "nuke.createNode(\"Denoise2\")", icon="denoise.png") # OFlow needs to be added after the OFX plugins menus m = toolbar.menu( 'Time' ) if not m: # If the Filter menu is empty, eg no whitelisted filter plugins in Nuke Assist, # we must create the menu afresh, as it will not exist m = toolbar.addMenu("Time", "ToolbarTime.png") if m: m.addCommand("OFlow", "nukescripts.createOFlow()", icon="Oflow.png") # AIR plugins menu m = toolbar.addMenu("AIR", "ToolbarAIR.png") m.addCommand("CopyCat", "nuke.createNode(\"CopyCat\")", icon="CopyCat.png") m.addCommand("Inference", "nuke.createNode(\"Inference\")", icon="Inference.png") m.addCommand("Deblur", "nuke.createNode(\"Deblur\")", icon="Deblur.png") m.addCommand("Upscale", "nuke.createNode(\"Upscale\")", icon="Upscale.png") m.addCommand("CatFileCreator", "nuke.createNode(\"CatFileCreator\")", icon="CatFileCreator.png") import nukescripts.cattery nukescripts.cattery.create_menu() # create cattery menu m = None n = None
[docs]def createCurveTool(): n = nuke.createNode( 'CurveTool' ) if n.input(0): n['resetROI'].execute()
[docs]def createKronos(): n = nuke.createNode( 'Kronos' ) if n.input(0): n['resetInputRange'].execute()
[docs]def createOFlow(): n = nuke.createNode('OFlow2'); if n.input(0): n['resetInputRange'].execute()
# Some helper functions that we can call from the toolbar items.
[docs]def create_time_warp(): t = nuke.createNode("TimeWarp") a = nuke.value(t.name()+".first_frame") e = nuke.value(t.name()+".last_frame") if float(e)<=float(a): a = nuke.value("root.first_frame") e = nuke.value("root.last_frame") cmd = "{curve C x"+a+" "+a+" x"+e+" "+e+"}" t.knob("lookup").fromScript(cmd)
[docs]def create_matrix(): p = nuke.Panel("Enter desired matrix size:") p.addSingleLineInput("width", 3) p.addSingleLineInput("height", 3) ret = p.show() if ret == 1: wdt = p.value("width") hgt = p.value("height") a = " { "+" 0 "*int(wdt)+" } " a = "{ " + a*int(hgt) + " }" nuke.createNode("Matrix", "matrix "+a)
[docs]def toolbar_sticky_note(): sticky = nuke.createNode("StickyNote") sticky.knob("label").setValue("type note here") sticky.knob("selected").setValue(False)
[docs]def createPrmanRender(): try: nuke.createNode( "PrmanRender" ) except: 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" if 'RMANTREE' not in os.environ: msg = msg + "\nAlso, the RMANTREE environment variable is not set.\n" if nuke.env['MACOS']: 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" msg = msg + "\nCheck your Pixar Photorealistic Renderman documentation section \"RenderMan Pro Server > Administration > Installation\" for platform-specific installation instructions." nuke.message( msg )
[docs]def createUVTile(): uvtile_node = nuke.createNode("UVTile2") n = uvtile_node.input(0) if n and n.Class() == 'Read': filename = n['file'].getValue() udim = nukescripts.parseUdimFile(filename) if udim != None: uvtile_node['udim_enable'].setValue(True) uvtile_node['udim'].setValue(udim)
[docs]def createPlanartracker(): rotoNode = nuke.createNode("Roto", "output {rgba.alpha none none mask_planartrack.a}", False) rotoLayerId = 1 rotoLayerName = "PlanarTrackLayer"+str(rotoLayerId) rotoTrackLayer = rotoNode.name() + "." + str(rotoLayerId) + "." + rotoLayerName rotoCurves = rotoNode["curves"] rotoCurveRoot = rotoCurves.rootLayer planarLayer = nuke.rotopaint.Layer(rotoCurves) rotoCurveRoot.append(planarLayer) atr = planarLayer.getAttributes() planarLayer.name = rotoLayerName planarLayer.getAttributes().set(nuke.rotopaint.AnimAttributes.kPlanarTrackLayerAttribute,rotoLayerId) rotoNode.showControlPanel() planarLayer.setFlag(nuke.rotopaint.FlagType.eSelectedFlag, 1) rotoCurves.changed() rotoNode["toolbox"].setValue(4)