Trees | Indices | Help |
|
---|
|
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.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 # Use the following options to set the shortcut context in the call to menu addCommand. 14 # Setting the shortcut context to a widget will mean the shortcut will only be triggered 15 # if that widget (or it's children) has focus. If no shortcut context is specified the 16 # default context is window context i.e. it can be triggered from anywhere in the window. 17 # The enum is defined in nk_menu_python_add_item in PythonObject.cpp 18 windowContext = 0 19 applicationContext = 1 20 dagContext = 2 21 22 # Get the top-level toolbar 23 toolbar = nuke.menu("Nodes") 24 assist = nuke.env['assist'] 25 26 # The "Image" menu 27 m = toolbar.addMenu("Image", "ToolbarImage.png") 28 m.addCommand("Read", "nukescripts.create_read()", "r", icon="Read.png", shortcutContext=dagContext) 29 m.addCommand("Write", "nuke.createNode(\"Write\")", "w", icon="Write.png", shortcutContext=dagContext) 30 if not assist: 31 m.addCommand("UDIM import", "nukescripts.udim_import()", "u", icon="Read.png", shortcutContext=dagContext) 32 m.addCommand("Constant", "nuke.createNode(\"Constant\")", icon="Constant.png") 33 m.addCommand("CheckerBoard", "nuke.createNode(\"CheckerBoard2\")", icon="CheckerBoard.png") 34 m.addCommand("ColorBars", "nuke.createNode(\"ColorBars\")", icon="ColorBars.png") 35 m.addCommand("ColorWheel", "nuke.createNode(\"ColorWheel\")", icon="ColorWheel.png") 36 if not assist: 37 m.addCommand("CurveTool", "nukescripts.createCurveTool()", icon="CurveTool.png") 38 m.addCommand("Viewer", "nuke.createNode(\"Viewer\")", icon="Viewer.png") 39 # m.addCommand("Proxy", "nuke.knob(\"root.proxy\", \"!root.proxy\")", icon="proxyfullres.png") 40 41 # The "Draw" menu 42 m = toolbar.addMenu("Draw", "ToolbarDraw.png") 43 m.addCommand("Roto", '''nuke.createNode("Roto")''', "o", icon="Roto.png", shortcutContext=dagContext) 44 m.addCommand("RotoPaint", "nuke.createNode(\"RotoPaint\")", "p", icon="RotoPaint.png", shortcutContext=dagContext) 45 46 m.addCommand("@;RotoBranch", "nuke.createNode(\"Roto\")", "+o", shortcutContext=dagContext) 47 m.addCommand("@;RotoPaintBranch", "nuke.createNode(\"RotoPaint\")", "+p", shortcutContext=dagContext) 48 49 m.addCommand("Dither", "nuke.createNode(\"Dither\")", icon="Dither.png") 50 m.addCommand("DustBust", "nuke.createNode(\"DustBust\")", icon="DustBust.png") 51 m.addCommand("Grain", "nuke.createNode(\"Grain2\")", icon="Grain.png") 52 m.addCommand("ScannedGrain", "nuke.createNode(\"ScannedGrain\")", icon="ScannedGrain.png") 53 m.addCommand("Glint", "nuke.createNode(\"Glint\")", icon="Glint.png") 54 m.addCommand("Grid", "nuke.createNode(\"Grid\")", icon="Grid.png") 55 m.addCommand("Flare", "nuke.createNode(\"Flare\")", icon="Flare.png") 56 m.addCommand("LightWrap", "nuke.createNode(\"LightWrap\")", icon="LightWrap.png") 57 m.addCommand("MarkerRemoval", "nuke.createNode(\"MarkerRemoval\")", icon="MarkerRemoval.png") 58 m.addCommand("Noise", "nuke.createNode(\"Noise\")", icon="Noise.png") 59 m.addCommand("Radial", "nuke.createNode(\"Radial\")", icon="Radial.png") 60 m.addCommand("Ramp", "nuke.createNode(\"Ramp\")", icon="Ramp.png") 61 m.addCommand("Rectangle", "nuke.createNode(\"Rectangle\")", icon="Rectangle.png") 62 m.addCommand("Sparkles", "nuke.createNode(\"Sparkles\")", icon="Sparkles.png") 63 m.addCommand("Text", "nuke.createNode(\"Text2\")", icon="Text.png") 64 65 m = toolbar.addMenu("Time", "ToolbarTime.png") 66 m.addCommand("Add 3:2 pulldown", "nuke.createNode(\"add32p\")", icon="Add32.png") 67 m.addCommand("Remove 3:2 pulldown", "nuke.createNode(\"remove32p\")", icon="Remove32.png") 68 m.addCommand("AppendClip", "nuke.createNode(\"AppendClip\")", icon="AppendClip.png") 69 m.addCommand("FrameBlend", "nuke.createNode(\"FrameBlend\")", icon="FrameBlend.png") 70 m.addCommand("FrameHold", "nuke.createNode(\"FrameHold\")", icon="FrameHold.png") 71 m.addCommand("FrameRange", "nuke.createNode(\"FrameRange\")", icon="FrameRange.png") 72 if not assist: 73 m.addCommand("Kronos", "nukescripts.createKronos()", icon="Oflow.png") 74 m.addCommand("OFlow", "nukescripts.createOFlow()", icon="Oflow.png") 75 m.addCommand("Retime", "nuke.createNode(\"Retime\")", icon="Retime.png") 76 m.addCommand("TemporalMedian", "nuke.createNode(\"TemporalMedian\")", icon="TemporalMedian.png") 77 m.addCommand("TimeBlur", "nuke.createNode(\"TimeBlur\")", icon="TimeBlur.png") 78 m.addCommand("NoTimeBlur", "nuke.createNode(\"NoTimeBlur\")", icon="NoTimeBlur.png") 79 m.addCommand("TimeEcho", "nuke.createNode(\"TimeEcho\")", icon="TimeEcho.png") 80 m.addCommand("TimeOffset", "nuke.createNode(\"TimeOffset\")", icon="TimeOffset.png") 81 82 if not assist: 83 m.addCommand("TimeWarp", "nukescripts.create_time_warp()", icon="TimeWarp.png") 84 m.addCommand("TimeClip") 85 86 m.addCommand("VectorGenerator", "nuke.createNode(\"VectorGenerator\")") 87 88 89 # The "Channel" menu 90 m = toolbar.addMenu("Channel", "ToolbarChannel.png") 91 m.addCommand("Shuffle", "nuke.createNode(\"Shuffle\")", icon="Shuffle.png") 92 m.addCommand("ShuffleCopy", "nuke.createNode(\"ShuffleCopy\")", icon="ShuffleCopy.png") 93 m.addCommand("Copy", "nuke.createNode(\"Copy\")", "k", icon="CopyNode.png", shortcutContext=dagContext) 94 m.addCommand("@;CopyBranch", "nuke.createNode(\"Copy\")", "+k", shortcutContext=dagContext) 95 m.addCommand("ChannelMerge", "nuke.createNode(\"ChannelMerge\")", icon="ChannelMerge.png") 96 m.addCommand("Add", "nuke.createNode(\"AddChannels\")", icon="Add.png") 97 m.addCommand("Remove","nuke.createNode(\"Remove\")", icon="Remove.png") 98 99 100 # The "Color" menu 101 m = toolbar.addMenu("Color", "ToolbarColor.png") 102 103 n = m.addMenu("Math", "ColorMath.png") 104 n.addCommand("Add", "nuke.createNode(\"Add\")", icon="ColorAdd.png") 105 n.addCommand("Multiply", "nuke.createNode(\"Multiply\")", icon="ColorMult.png") 106 n.addCommand("Gamma", "nuke.createNode(\"Gamma\")", icon="ColorGamma.png") 107 n.addCommand("ClipTest", "nuke.createNode(\"ClipTest\")", icon="ClipTest.png") 108 n.addCommand("ColorMatrix", "nuke.createNode(\"ColorMatrix\")", icon="ColorMatrix.png") 109 n.addCommand("Expression", "nuke.createNode(\"Expression\")", icon="Expression.png") 110 111 n = m.addMenu("OCIO", "OCIO.png") 112 n.addCommand("OCIO CDLTransform", "nuke.createNode(\"OCIOCDLTransform\")", icon="OCIO.png") 113 n.addCommand("OCIO ColorSpace", "nuke.createNode(\"OCIOColorSpace\")", icon="OCIO.png") 114 n.addCommand("OCIO Display", "nuke.createNode(\"OCIODisplay\")", icon="OCIO.png") 115 n.addCommand("OCIO FileTransform", "nuke.createNode(\"OCIOFileTransform\")", icon="OCIO.png") 116 n.addCommand("OCIO LogConvert", "nuke.createNode(\"OCIOLogConvert\")", icon="OCIO.png") 117 118 n = m.addMenu("3D LUT", "Toolbar3DLUT.png") 119 n.addCommand("CMSTestPattern", "nuke.createNode(\"CMSTestPattern\")", icon="CMSTestPattern.png") 120 n.addCommand("GenerateLUT", "nuke.createNode(\"GenerateLUT\")", icon="GenerateLUT.png") 121 n.addCommand("Vectorfield (Apply 3D LUT)", "nuke.createNode(\"Vectorfield\")", icon="Vectorfield.png") 122 123 m.addCommand("Clamp", "nuke.createNode(\"Clamp\")", icon="Clamp.png") 124 m.addCommand("ColorLookup", "nuke.createNode(\"ColorLookup\")", icon="ColorLookup.png") 125 m.addCommand("Colorspace", "nuke.createNode(\"Colorspace\")", icon="ColorSpace.png") 126 m.addCommand("ColorTransfer", "nuke.createNode(\"ColorTransfer\")", icon="ColorTransfer.png") 127 m.addCommand("ColorCorrect", "nuke.createNode(\"ColorCorrect\")", "c", icon="ColorCorrect.png", shortcutContext=dagContext) 128 m.addCommand("@;ColorCorrectBranch", "nuke.createNode(\"ColorCorrect\")", "+c") 129 m.addCommand("Crosstalk", "nuke.createNode(\"CCrosstalk\")", icon="Crosstalk.png") 130 m.addCommand("Exposure", "nuke.createNode(\"EXPTool\")", icon="Exposure.png") 131 m.addCommand("Grade", "nuke.createNode(\"Grade\")", "g", icon="Grade.png", shortcutContext=dagContext) 132 m.addCommand("@;GradeBranch", "nuke.createNode(\"Grade\")", "+g", shortcutContext=dagContext) 133 m.addCommand("Histogram", "nuke.createNode(\"Histogram\")", icon="Histogram.png") 134 m.addCommand("HistEQ", "nuke.createNode(\"HistEQ\")", icon="HistEQ.png") 135 m.addCommand("HueCorrect", "nuke.createNode(\"HueCorrect\")", icon="HueCorrect.png") 136 m.addCommand("HueShift", "nuke.createNode(\"HueShift\")", icon="HueShift.png") 137 m.addCommand("HSVTool", "nuke.createNode(\"HSVTool\")", icon="HSVTool.png") 138 m.addCommand("Invert", "nuke.createNode(\"Invert\")", icon="Invert.png") 139 m.addCommand("Log2Lin", "nuke.createNode(\"Log2Lin\")", icon="Log2Lin.png") 140 m.addCommand("PLogLin", "nuke.createNode(\"PLogLin\")", icon="Log2Lin.png") 141 m.addCommand("MatchGrade", "nuke.createNode(\"MatchGrade\")", icon="MatchGrade.png") 142 m.addCommand("MinColor", "nuke.createNode(\"MinColor\")", icon="MinColor.png") 143 m.addCommand("Posterize", "nuke.createNode(\"Posterize\")", icon="Posterize.png") 144 m.addCommand("RolloffContrast", "nuke.createNode(\"RolloffContrast\")", icon="RolloffContrast.png") 145 m.addCommand("Saturation", "nuke.createNode(\"Saturation\")", icon="Saturation.png") 146 m.addCommand("Sampler", "nuke.createNode(\"Sampler\")", icon="Sampler.png") 147 m.addCommand("SoftClip", "nuke.createNode(\"SoftClip\")", icon="SoftClip.png") 148 m.addCommand("Toe", "nuke.createNode(\"Toe2\")", icon="Toe.png" ) 149 m.addCommand("Truelight", "nuke.createNode(\"Truelight3\")", icon="Truelight.png") 150 151 152 # The "Filter" menu 153 m = toolbar.addMenu("Filter", "ToolbarFilter.png") 154 m.addCommand("Blur", "nuke.createNode(\"Blur\")", "b", icon="Blur.png", shortcutContext=dagContext) 155 m.addCommand("@;BlurBranch", "nuke.createNode(\"Blur\")", "+b", shortcutContext=dagContext) 156 m.addCommand("Bilateral", "nuke.createNode(\"Bilateral\")", icon="Bilateral.png") 157 m.addCommand("BumpBoss", "nuke.createNode(\"BumpBoss\")", icon="BumpBoss.png") 158 m.addCommand("Convolve", "nuke.createNode(\"Convolve2\")", icon="Convolve.png") 159 m.addCommand("Defocus", "nuke.createNode(\"Defocus\")", icon="Defocus.png") 160 m.addCommand("DegrainBlue", "nuke.createNode(\"DegrainBlue\")", icon="DegrainBlue.png") 161 m.addCommand("DegrainSimple", "nuke.createNode(\"DegrainSimple\")", icon="DegrainSimple.png") 162 m.addCommand("Denoise", "nuke.createNode(\"Denoise2\")", icon="denoise.png") 163 m.addCommand("DirBlur", "nuke.createNode(\"DirBlurWrapper\")", icon="DirBlur.png") 164 m.addCommand("DropShadow", "nuke.createNode(\"DropShadow\")", icon="DropShadow.png") 165 m.addCommand("EdgeBlur", "nuke.createNode(\"EdgeBlur\")", icon="EdgeBlur.png") 166 m.addCommand("EdgeDetect", "nuke.createNode(\"EdgeDetectWrapper\")", icon="EdgeDetect.png") 167 m.addCommand("Emboss", "nuke.createNode(\"Emboss\")", icon="Emboss.png") 168 m.addCommand("Erode (fast)", "nuke.createNode(\"Dilate\")", icon="ErodeFast.png") 169 m.addCommand("Erode (filter)", "nuke.createNode(\"FilterErode\")", icon="FilterErode.png") 170 m.addCommand("Erode (blur)", "nuke.createNode(\"Erode\")", icon="ErodeBlur.png") 171 m.addCommand("Glow", "nuke.createNode(\"Glow2\")", icon="Glow.png") 172 m.addCommand("GodRays", "nuke.createNode(\"GodRays\")", icon="GodRays.png") 173 m.addCommand("Laplacian", "nuke.createNode(\"Laplacian\")", icon="Laplacian.png") 174 m.addCommand("LevelSet", "nuke.createNode(\"LevelSet\")", icon="LevelSet.png") 175 176 if not assist: 177 m.addCommand("Matrix...", "nukescripts.create_matrix()", icon="Matrix.png") 178 m.addCommand("Median", "nuke.createNode(\"Median\")", icon="Median.png") 179 m.addCommand("MotionBlur", "nuke.createNode(\"MotionBlur\")", icon="MotionBlur2D.png") 180 m.addCommand("MotionBlur2D", "nuke.createNode(\"MotionBlur2D\")", icon="MotionBlur2D.png") 181 m.addCommand("MotionBlur3D", "nuke.createNode(\"MotionBlur3D\")", icon="MotionBlur3D.png") 182 m.addCommand("Sharpen", "nuke.createNode(\"Sharpen\")", icon="Sharpen.png") 183 m.addCommand("Soften", "nuke.createNode(\"Soften\")", icon="Soften.png") 184 m.addCommand("VectorBlur", "nuke.createNode(\"VectorBlur\")", icon="VectorBlur.png") 185 m.addCommand("VolumeRays", "nuke.createNode(\"VolumeRays\")", icon="VolumeRays.png") 186 m.addCommand("ZDefocus", "nuke.createNode(\"ZDefocus2\")", icon="ZBlur.png") 187 m.addCommand("ZSlice", "nuke.createNode(\"ZSlice\")", icon="ZSlice.png") 188 189 190 # The "Keyer" menu 191 m = toolbar.addMenu("Keyer", "ToolbarKeyer.png") 192 m.addCommand("Difference", "nuke.createNode(\"Difference\")", icon="DifferenceKeyer.png") 193 m.addCommand("HueKeyer", "nuke.createNode(\"HueKeyer\")", icon="HueKeyer.png") 194 if not assist: 195 m.addCommand("IBKGizmo", "nuke.tcl(\"IBKGizmoV3\")", icon="IBKGizmo.png") 196 m.addCommand("IBKColour", "nuke.tcl(\"IBKColourV3\")", icon="IBKColour.png") 197 m.addCommand("Keyer", "nuke.createNode(\"Keyer\")", icon="Keyer.png") 198 m.addCommand("Primatte", "nuke.createNode(\"Primatte3\")", icon="Primatte.png") 199 m.addCommand("Keylight", 'nuke.createNode("OFXuk.co.thefoundry.keylight.keylight_v201")', icon="Keylight.png") 200 m.addCommand("Ultimatte", "nuke.createNode(\"Ultimatte\")", icon="Ultimatte.png") 201 202 203 # The "Merge" menu 204 m = toolbar.addMenu("Merge", "ToolbarMerge.png") 205 m.addCommand("AddMix", "nuke.createNode(\"AddMix\")", "+a", icon="AddMix.png", shortcutContext=dagContext) 206 m.addCommand("KeyMix", "nuke.createNode(\"Keymix\")", icon="Keymix.png") 207 m.addCommand("ContactSheet", "nuke.createNode(\"ContactSheet\")", icon="ContactSheet.png") 208 m.addCommand("CopyBBox", "nuke.createNode(\"CopyBBox\")", icon="CopyBBox.png") 209 m.addCommand("CopyRectangle", "nuke.createNode(\"CopyRectangle\")", icon="CopyRectangle.png") 210 m.addCommand("Dissolve", "nuke.createNode(\"Dissolve\")", icon="Dissolve.png") 211 m.addCommand("LayerContactSheet", "nuke.createNode(\"LayerContactSheet\")", icon="LayerContactSheet.png") 212 m.addCommand("Merge", "nuke.createNode(\"Merge2\")", "m", icon="Merge.png", shortcutContext=dagContext) 213 m.addCommand("@;MergeBranch", "nuke.createNode(\"Merge2\")", "+m", shortcutContext=dagContext) 214 215 n = m.addMenu("Merges", "Merge.png") 216 if not assist: 217 n.addCommand("Plus", "nuke.createNode(\"Merge2\", \"operation plus name Plus\", False)", icon="MergePlus.png") 218 n.addCommand("Matte", "nuke.createNode(\"Merge2\", \"operation matte name Matte\", False)", icon="MergeMatte.png") 219 n.addCommand("Multiply", "nuke.createNode(\"Merge2\", \"operation multiply name Multiply\", False)", icon="MergeMultiply.png") 220 n.addCommand("In", "nuke.createNode(\"Merge2\", \"operation in name In\", False)", icon="MergeIn.png") 221 n.addCommand("Out", "nuke.createNode(\"Merge2\", \"operation out name Out\", False)", icon="MergeOut.png") 222 n.addCommand("Screen", "nuke.createNode(\"Merge2\", \"operation screen name Scrn\", False)", icon="MergeScreen.png") 223 n.addCommand("Max", "nuke.createNode(\"Merge2\", \"operation max name Max\", False)", icon="MergeMax.png") 224 n.addCommand("Min", "nuke.createNode(\"Merge2\", \"operation min name Min\", False)", icon="MergeMin.png") 225 n.addCommand("Absminus", "nuke.createNode(\"Merge2\", \"operation difference name Difference\", False)", icon="MergeDifference.png") 226 m.addCommand("MergeExpression", "nuke.createNode(\"MergeExpression\")", icon="MergeExpression.png") 227 m.addCommand("Switch", "nuke.createNode(\"Switch\")", icon="Switch.png") 228 if not assist: 229 m.addCommand("TimeDissolve", "nuke.createNode(\"TimeDissolve\")", icon="TimeDissolve.png") 230 m.addCommand("Premult", "nuke.createNode(\"Premult\")", icon="Premult.png") 231 m.addCommand("Unpremult", "nuke.createNode(\"Unpremult\")", icon="Unpremult.png") 232 if not assist: 233 m.addCommand("Blend", "nuke.createNode(\"Blend\")", icon="Blend.png") 234 m.addCommand("ZMerge", "nuke.createNode(\"ZMerge\")", icon="ZMerge.png") 235 236 237 # The "Transform" menu 238 m = toolbar.addMenu("Transform", "ToolbarTransform.png") 239 m.addCommand("Transform", "nuke.createNode(\"Transform\")", "t", icon="2D.png", shortcutContext=dagContext) 240 m.addCommand("@;Transform Branch", "nuke.createNode(\"Transform\")", "+t", shortcutContext=dagContext) 241 m.addCommand("TransformMasked", "nuke.createNode(\"TransformMasked\")", icon="2DMasked.png") 242 m.addCommand("Card3D", "nuke.createNode(\"Card3D\")", icon="3D.png") 243 m.addCommand("AdjustBBox", "nuke.createNode(\"AdjBBox\")", icon="AdjBBox.png") 244 m.addCommand("BlackOutside", "nuke.createNode(\"BlackOutside\")", icon="BlackOutside.png") 245 m.addCommand("CameraShake", "nuke.createNode(\"CameraShake2\")", icon="CameraShake.png") 246 m.addCommand("Crop", "nuke.createNode(\"Crop\")", icon="Crop.png") 247 m.addCommand("CornerPin", "nuke.createNode(\"CornerPin2D\")", icon="CornerPin.png") 248 m.addCommand("SphericalTransform", "nuke.createNode(\"SphericalTransform\")", icon="EnvironMaps.png") 249 m.addCommand("IDistort", "nuke.createNode(\"IDistort\")", icon="IDistort.png") 250 m.addCommand("LensDistortion", "nuke.createNode(\"LensDistortion\")", icon="LensDistort.png") 251 m.addCommand("Mirror", "nuke.createNode(\"Mirror2\")", icon="Mirror.png") 252 m.addCommand("Position", "nuke.createNode(\"Position\")", icon="Position.png") 253 m.addCommand("Reformat", "nuke.createNode(\"Reformat\")", icon="Reformat.png") 254 m.addCommand("Reconcile3D", "nuke.createNode(\"Reconcile3D\")", icon="Reconcile3D.png") 255 m.addCommand("PointsTo3D", "nuke.createNode(\"PointsTo3D\")", icon="PointsTo3D.png") 256 m.addCommand("PlanarTracker", "nukescripts.createPlanartracker()", icon="planar_tracker.png") 257 m.addCommand("Tracker", "nuke.createNode(\"Tracker4\")", icon="Tracker.png") 258 m.addCommand("TVIScale", "nuke.createNode(\"TVIscale\")", icon="TVIScale.png") 259 m.addCommand("GridWarp", "nuke.createNode(\"GridWarp3\")", icon="GridWarp.png") 260 m.addCommand("SplineWarp", "nuke.createNode(\"SplineWarp3\")", icon="SplineWarp.png") 261 m.addCommand("Stabilize", "nuke.createNode(\"Stabilize2D\")", icon="Stabilize.png") 262 m.addCommand("STMap", "nuke.createNode(\"STMap\")", icon="STMap.png") 263 m.addCommand("Tile", "nuke.createNode(\"Tile\")", icon="Tile.png") 264 265 #m.addCommand("AutoCrop", "nukescripts.autocrop()", icon="AutoCrop.png") 266 267 268 # The "3D" menu 269 m = toolbar.addMenu("3D", "Cube.png") 270 271 m.addCommand("Axis", "nuke.createNode(\"Axis2\")", icon="Axis.png") 272 273 n = m.addMenu("Geometry", "Geometry.png") 274 n.addCommand("Card", "nuke.createNode(\"Card2\")", icon="Card.png") 275 n.addCommand("Cube", "nuke.createNode(\"Cube\")", icon="Cube.png") 276 n.addCommand("Cylinder", "nuke.createNode(\"Cylinder\")", icon="Cylinder.png") 277 n.addCommand("DepthToPoints", "nuke.createNode(\"DepthToPoints\")", icon="DepthToPoints.png") 278 #n.addCommand("Modeler", "nuke.createNode(\"Modeler\")", icon="Modeler.png") 279 n.addCommand("ModelBuilder", "nuke.createNode(\"ModelBuilder\")", icon="Modeler.png") 280 n.addCommand("PointCloudGenerator", "nuke.createNode(\"PointCloudGenerator\")", icon="PointCloudGenerator.png") 281 n.addCommand("PositionToPoints", "nuke.createNode(\"PositionToPoints2\")", icon="PositionToPoints.png") 282 n.addCommand("PoissonMesh", "nuke.createNode(\"PoissonMesh\")", icon="PoissonMesh.png") 283 n.addCommand("Sphere", "nuke.createNode(\"Sphere\")", icon="Sphere.png") 284 n.addCommand("ReadGeo", "nuke.createNode(\"ReadGeo2\")", icon="ReadGeo.png") 285 n.addCommand("WriteGeo", "nuke.createNode(\"WriteGeo\")", icon="WriteGeo.png") 286 287 n = m.addMenu("Lights", "Toolbar3DLights.png") 288 n.addCommand("Light", "nuke.createNode(\"Light2\")", icon="PointLight.png") 289 n.addCommand("Point", "nuke.createNode(\"Light\")", icon="PointLight.png") 290 n.addCommand("Direct", "nuke.createNode(\"DirectLight\")", icon="DirectLight.png") 291 n.addCommand("Spot", "nuke.createNode(\"Spotlight\")", icon="SpotLight.png") 292 n.addCommand("Environment", "nuke.createNode(\"Environment\")", icon="Environment.png") 293 n.addCommand("Relight", "nuke.createNode(\"ReLight\")", icon="ReLight.png") 294 295 n = m.addMenu("Modify", "Modify.png") 296 n.addCommand("TransformGeo", "nuke.createNode(\"TransformGeo\")", icon="Modify.png") 297 n.addCommand("MergeGeo", "nuke.createNode(\"MergeGeo\")", icon="Modify.png") 298 n.addCommand("CrosstalkGeo", "nuke.createNode(\"CrosstalkGeo\")", icon="Modify.png") 299 #n.addCommand("Connect Points", "nuke.createNode(\"ConnectPointsGeo\")", icon="Modify.png") 300 n.addCommand("DisplaceGeo", "nuke.createNode(\"DisplaceGeo\")", icon="Modify.png") 301 n.addCommand("EditGeo", "nuke.createNode(\"EditGeo\")", icon="Modify.png") 302 n.addCommand("GeoSelect", """nuke.createNode("GeoSelect")""", icon="Modify.png") 303 n.addCommand("LookupGeo", "nuke.createNode(\"LookupGeo\")", icon="Modify.png") 304 n.addCommand("LogGeo", "nuke.createNode(\"LogGeo\")", icon="Modify.png") 305 n.addCommand("Normals", "nuke.createNode(\"Normals\")", icon="Modify.png") 306 n.addCommand("ProceduralNoise", "nuke.createNode(\"ProcGeo\")", icon="Modify.png") 307 n.addCommand("RadialDistort", "nuke.createNode(\"RadialDistort\")", icon="Modify.png") 308 n.addCommand("Trilinear", "nuke.createNode(\"Trilinear\")", icon="Modify.png") 309 n.addCommand("UVProject", "nuke.createNode(\"UVProject\")", icon="Modify.png") 310 #n.addCommand("VectorfieldGeo", "nuke.createNode(\"VectorfieldGeo\")", icon="Modify.png") 311 #n.addCommand("Vectorfield Create", "nuke.createNode(\"VectorfieldCreateGeo\")", icon="Modify.png") 312 n = n.addMenu("RenderMan", "Modify.png") 313 n.addCommand("ModifyRIB", "nuke.createNode(\"ModifyRIB\")", icon="Modify.png") 314 315 n = m.addMenu("Shader", "Shaders.png") 316 n.addCommand("ApplyMaterial", "nuke.createNode(\"ApplyMaterial\")", icon="Shader.png") 317 n.addCommand("BasicMaterial", "nuke.createNode(\"BasicMaterial\")", icon="Shader.png") 318 n.addCommand("FillMat", "nuke.createNode(\"FillMat\")", icon="Shader.png") 319 n.addCommand("MergeMat", "nuke.createNode(\"MergeMat\")", icon="Shader.png") 320 n.addCommand("BlendMat", "nuke.createNode(\"BlendMat\")", icon="Shader.png") 321 n.addCommand("Project3D", "nuke.createNode(\"Project3D2\")", icon="Shader.png") 322 n.addCommand("Diffuse", "nuke.createNode(\"Diffuse\")", icon="Shader.png") 323 n.addCommand("Emission", "nuke.createNode(\"Emission\")", icon="Shader.png") 324 n.addCommand("Phong", "nuke.createNode(\"Phong\")", icon="Shader.png") 325 n.addCommand("Specular", "nuke.createNode(\"Specular\")", icon="Shader.png") 326 n.addCommand("Displacement", "nuke.createNode(\"Displacement\")", icon="Shader.png") 327 if not assist: 328 n.addCommand("UVTile", "nukescripts.createUVTile()", icon="Shader.png") 329 n.addCommand("Wireframe", "nuke.createNode(\"Wireframe\")", icon="Shader.png") 330 n = n.addMenu("RenderMan", "Shaders.png") 331 n.addCommand("Reflection", "nuke.createNode(\"Reflection\")", icon="Shader.png") 332 n.addCommand("Refraction", "nuke.createNode(\"Refraction\")", icon="Shader.png") 333 334 m.addCommand("Camera", "nuke.createNode(\"Camera2\")", icon="Camera.png") 335 m.addCommand("CameraTracker", "nuke.createNode(\"CameraTracker\")", icon="CameraTracker.png") 336 m.addCommand("DepthGenerator", "nuke.createNode(\"DepthGenerator\")", icon="DepthGenerator.png") 337 m.addCommand("DepthToPosition", "nuke.createNode(\"DepthToPosition\")", icon="DepthToPosition.png") 338 m.addCommand("Scene", "nuke.createNode(\"Scene\")", icon="Scene.png") 339 m.addCommand("ScanlineRender", "nuke.createNode(\"ScanlineRender\")", icon="Render.png") 340 341 if not assist: 342 m = m.addMenu("RenderMan", "Toolbar3D.png") 343 m.addCommand("PrmanRender","nukescripts.createPrmanRender()", icon="Render.png") 344 345 # particles menu 346 m = toolbar.addMenu("Particles", "ToolbarParticles.png") 347 m.addCommand("ParticleEmitter") 348 349 m.addCommand("ParticleBounce") 350 m.addCommand("ParticleCache", icon="ParticleCache.png") 351 m.addCommand("ParticleCurve") 352 m.addCommand("ParticleDirectionalForce") 353 m.addCommand("ParticleDrag") 354 m.addCommand("ParticleExpression") 355 m.addCommand("ParticleMerge") 356 m.addCommand("ParticleMotionAlign") 357 m.addCommand("ParticleGravity") 358 359 #Disable ParticleLineForce for now as it is not ready for being included in the bundle - Bug 30000 360 # m.addCommand("ParticleLineForce") 361 362 m.addCommand("ParticleLookAt") 363 m.addCommand("ParticlePointForce") 364 m.addCommand("ParticleSpeedLimit") 365 m.addCommand("ParticleSpawn") 366 m.addCommand("ParticleTurbulence") 367 m.addCommand("ParticleVortex") 368 m.addCommand("ParticleWind") 369 370 m.addCommand("ParticleSettings", icon="particle_settings.png") 371 372 m.addCommand("ParticleToGeo") 373 374 # deep menu 375 m = toolbar.addMenu("Deep", "ToolbarDeep.png") 376 m.addCommand("DeepColorCorrect", "nuke.createNode('DeepColorCorrect2')" ) 377 m.addCommand("DeepCrop") 378 m.addCommand("DeepExpression") 379 m.addCommand("DeepFromFrames") 380 m.addCommand("DeepFromImage") 381 m.addCommand("DeepHoldout", "nuke.createNode('DeepHoldout2')" ) 382 m.addCommand("DeepMerge") 383 if not assist: 384 m.addCommand("DeepRead", '''nukescripts.create_read("DeepRead")''') 385 m.addCommand("DeepRecolor") 386 m.addCommand("DeepReformat") 387 m.addCommand("DeepSample") 388 m.addCommand("DeepToImage") 389 m.addCommand("DeepToPoints") 390 m.addCommand("DeepTransform") 391 m.addCommand("DeepWrite") 392 393 # Views menu 394 m = toolbar.addMenu("Views", "ToolbarViews.png") 395 n = m.addMenu("Stereo", "ToolbarStereo.png") 396 n.addCommand("Anaglyph", "nuke.createNode(\"Anaglyph\")", icon="Anaglyph.png") 397 n.addCommand("MixViews", "nuke.createNode(\"MixViews\")", icon="MixViews.png") 398 n.addCommand("SideBySide", "nuke.createNode(\"SideBySide\")", icon="SideBySide.png") 399 n.addCommand("ReConverge", "nuke.createNode(\"ReConverge\")", icon="ReConverge.png") 400 401 m.addCommand("JoinViews", "nuke.createNode(\"JoinViews\")", icon="JoinViews.png") 402 m.addCommand("OneView", "nuke.createNode(\"OneView\")", icon="OneView.png") 403 m.addCommand("ShuffleViews", "nuke.createNode(\"ShuffleViews\")", icon="ShuffleViews.png") 404 m.addCommand("Split and Join", "nukescripts.create_viewsplitjoin()", icon="SplitAndJoin.png") 405 406 m = toolbar.addMenu("MetaData", "MetaData.png") 407 m.addCommand("ViewMetaData", "nuke.createNode(\"ViewMetaData\")", icon="ViewMetaData.png") 408 m.addCommand("CompareMetaData", "nuke.createNode(\"CompareMetaData\")", icon="CompareMetaData.png") 409 m.addCommand("ModifyMetaData", "nuke.createNode(\"ModifyMetaData\")", icon="ModifyMetaData.png") 410 m.addCommand("CopyMetaData", "nuke.createNode(\"CopyMetaData\")", icon="CopyMetaData.png") 411 m.addCommand("AddTimeCode", "nuke.createNode(\"AddTimeCode\")", icon="AddTimeCode.png") 412 413 import nukescripts.toolsets 414 nukescripts.toolsets.createToolsetsMenu(toolbar) 415 nukescripts.createNodePresetsMenu() 416 417 418 # The "Other" menu 419 m = toolbar.addMenu("Other", "ToolbarOther.png") 420 m.addCommand("AudioRead", "nuke.createNode(\"AudioRead\")", icon="Read.png") 421 m.addCommand("Assert", "nuke.createNode(\"Assert\")", icon="Assert.png") 422 m.addCommand("Backdrop", "nukescripts.autoBackdrop()", icon="Backdrop.png") 423 m.addCommand("BlinkScript", "nuke.createNode(\"BlinkScript\")", icon="BlinkScript.png") 424 m.addCommand("DiskCache", "nuke.createNode(\"DiskCache\")", ".", icon="DiskCache.png", shortcutContext=dagContext) 425 m.addCommand("Dot", "nuke.createNode(\"Dot\", inpanel=False)", ".", icon="Dot.png", shortcutContext=dagContext) 426 m.addCommand("Input", "nuke.createNode(\"Input\")", icon="Input.png") 427 m.addCommand("Output", "nuke.createNode(\"Output\")", icon="Output.png") 428 m.addCommand("NoOp", "nuke.createNode(\"NoOp\")", icon="NoOp.png") 429 m.addCommand("PostageStamp", "nuke.createNode(\"PostageStamp\")", icon="PostageStamp.png") 430 m.addCommand("Group", "nuke.collapseToGroup()", icon="Group.png") 431 if not assist: 432 m.addCommand("Precomp", "nukescripts.precomp_selected()","^+p", icon="Precomp.png", shortcutContext=dagContext) 433 434 m.addCommand("StickyNote", "nukescripts.toolbar_sticky_note()", "#n", icon="StickyNote.png", shortcutContext=dagContext) 435 n = m.addMenu("All plugins", "AllPlugins.png") 436 n.addCommand("Update", "nukescripts.update_plugin_menu(\"All plugins\")") 437 438 # The OFX plugins menus 439 nuke.ofxMenu("") 440 441 # Have to remove some of the furnace core nodes that get added automatically in nuke.ofxMenu() 442 m = toolbar.menu("FurnaceCore") 443 if (m != None): 444 m.removeItem("F_DeGrain") 445 m.removeItem("F_DeNoise") 446 m.removeItem("F_Kronos") 447 m.removeItem("F_MotionBlur") 448 m.removeItem("F_VectorGenerator") 449 m.removeItem("F_MatchGrade") 450 451 # Denoise2 needs to be added after the OFX plugins menus 452 m = toolbar.menu( 'Filter' ) 453 if m == None or not hasattr(m, 'addCommand'): 454 # If the Filter menu is empty, eg no whitelisted filter plugins in Nuke Assist, 455 # we must create the menu afresh, as it will not exist 456 m = toolbar.addMenu("Filter", "ToolbarFilter.png") 457 if m != None and hasattr(m, 'addCommand'): 458 m.addCommand("Denoise", "nuke.createNode(\"Denoise2\")", icon="denoise.png") 459 460 # OFlow needs to be added after the OFX plugins menus 461 m = toolbar.menu( 'Time' ) 462 if m == None or not hasattr(m, 'addCommand'): 463 # If the Filter menu is empty, eg no whitelisted filter plugins in Nuke Assist, 464 # we must create the menu afresh, as it will not exist 465 m = toolbar.addMenu("Time", "ToolbarTime.png") 466 if m != None and hasattr(m, 'addCommand'): 467 m.addCommand("OFlow", "nukescripts.createOFlow()", icon="Oflow.png") 468 469 m = None 470 n = None471 472 477 482 487 488 # Some helper functions that we can call from the toolbar items. 489491 t = nuke.createNode("TimeWarp") 492 a = nuke.value(t.name()+".first_frame") 493 e = nuke.value(t.name()+".last_frame") 494 if float(e)<=float(a): 495 a = nuke.value("root.first_frame") 496 e = nuke.value("root.last_frame") 497 cmd = "{curve C x"+a+" "+a+" x"+e+" "+e+"}" 498 t.knob("lookup").fromScript(cmd)499 500502 p = nuke.Panel("Enter desired matrix size:") 503 p.addSingleLineInput("width", 3) 504 p.addSingleLineInput("height", 3) 505 ret = p.show() 506 if ret == 1: 507 wdt = p.value("width") 508 hgt = p.value("height") 509 a = " { "+" 0 "*int(wdt)+" } " 510 a = "{ " + a*int(hgt) + " }" 511 nuke.createNode("Matrix", "matrix "+a)512 513515 sticky = nuke.createNode("StickyNote") 516 sticky.knob("label").setValue("type note here") 517 sticky.knob("selected").setValue(False)518520 try: 521 nuke.createNode( "PrmanRender" ) 522 except: 523 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" 524 if not os.environ.has_key('RMANTREE'): 525 msg = msg + "\nAlso, the RMANTREE environment variable is not set.\n" 526 527 if nuke.env['MACOS']: 528 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" 529 msg = msg + "\nCheck your Pixar Photorealistic Renderman documentation section \"RenderMan Pro Server > Administration > Installation\" for platform-specific installation instructions." 530 531 nuke.message( msg )532534 uvtile_node = nuke.createNode("UVTile2") 535 n = uvtile_node.input(0) 536 537 if n != None and n.Class() == 'Read': 538 filename = n['file'].getValue() 539 udim = nukescripts.parseUdimFile(filename) 540 if udim != None: 541 uvtile_node['udim_enable'].setValue(True) 542 uvtile_node['udim'].setValue(udim)543545 546 rotoNode = nuke.createNode("Roto", "output {rgba.alpha none none mask_planartrack.a}", False) 547 rotoLayerId = 1 548 rotoLayerName = "PlanarTrackLayer"+str(rotoLayerId) 549 550 rotoTrackLayer = rotoNode.name() + "." + str(rotoLayerId) + "." + rotoLayerName 551 552 rotoCurves = rotoNode["curves"] 553 rotoCurveRoot = rotoCurves.rootLayer 554 planarLayer = nuke.rotopaint.Layer(rotoCurves) 555 rotoCurveRoot.append(planarLayer) 556 atr = planarLayer.getAttributes() 557 planarLayer.name = rotoLayerName 558 planarLayer.getAttributes().set(nuke.rotopaint.AnimAttributes.kPlanarTrackLayerAttribute,rotoLayerId) 559 560 rotoNode.showControlPanel() 561 planarLayer.setFlag(nuke.rotopaint.FlagType.eSelectedFlag, 1) 562 rotoCurves.changed() 563 rotoNode["toolbox"].setValue(4)564
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Nov 16 12:59:57 2014 | http://epydoc.sourceforge.net |