/nuke-vfx:nuke-python-scriptingfrom nuke-vfx
Traps and patterns for scripting Foundry Nuke through the MCP bridge: Roto shapes via nuke.rotopaint (animated points, subtract shapes), Merge2 on alpha-only channels, sampling per frame, tuple kwargs corrupting nuke.views(), headless -t, version-up. Use before writing nuke Python, scripted Roto, or a bridge read-back.
Ships in nuke-vfx. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Version: 2.0.0 (staged 2026-11-08, baseline eval nuke-round2) Every trap below was reproduced on NukeX 17.0v2 through the bridge. Prove each construct by READING BACK pixels or knobs, never by the absence of an error.
runPythonScript returns the variable result, not printed output. First call of a session: return nuke.root().name() and the node count (two GUI Nukes can share port 8765; see reference/api_traps.md).nuke.frame(f) then node.sample(...) returned the frame-0 value for every f (0.0, 0.0, 0.0 for a ramp that is 0.2/0.5/0.8). Use node.sample(chan, x, y, 1, 1, f) with the frame explicit. nuke.sample() takes no frame.Achannels/Bchannels/output = alpha): mask and in give 0.0 and stencil leaves B (0.8) unchanged where 0.4 is right; multiply and max are right. Leave the channel set at rgba for mask/stencil/in/out, or multiply. Both arms of the eval followed a spec that asked for alpha-only, reported 0.0 and could not name the cause.nuke.nodes.Crop(box=(100,100,400,300)) left the box 0,0,0,0 AND turned nuke.views() into ['main', '100,', '400,'], which later makes nuke.execute fail with "multiple views". Set vectors with node['box'].setValue([...]); read nuke.views() back after any create that passed a knob value as a kwarg. (Repair: nuke.root()['views'].fromScript('{main ""}').)import nuke.rotopaint as rp) - recipe and traps in reference/roto_from_python.md. The ones that decide the result: key a point (cp.center.addPositionKey) BEFORE shape.append(cp) (keys added after are lost and the shape is empty/static: alpha 0 at every frame); the first shape appended is drawn LAST, so append remove shapes before keep shapes; subtract is blend id 12 ("minus"), not 11 ("from" flips overlaps back to 1); follow minus with a Clamp (overlapping removes give alpha -1).nuke -t --safe, one token for frame args (frames=1000:1010).createNode wires to the selection, nuke.nodes.X() does not (measured: input 0 stays empty even with a node selected). Prefer nuke.nodes.X() for graph building.from nuke_mcp_logger import NukeMCPLogger (installed in ~/.nuke) wraps results as {status, logs, errors, stats}. 0 of 44 valid Opus eval runs imported it; plain result = {...} works the same.
reference/api_traps.md, reference/roto_from_python.md, reference/version_up_method.md, scripts/nk_version_up.py (append, compose, diff, lint, outputs, reads, verify).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sideshowroberto/vfx-agent-toolkit --plugin nuke-vfx5 skills in this plugin
/nuke-blinkscriptVerified BlinkScript traps in Nuke 17 - kernelSource.setValue silently keeps the default kernel, a compile error in the GUI raises a modal dialog that wedges the MCP bridge, param knobs are Kernel_param, eAccessPoint takes no coordinates, eAccessRanged2D without setRange segfaults. Use when writing, loading or debugging a BlinkScript or .blink kernel from Python or the MCP./nuke-cattery-inferenceVerified Cattery traps in Nuke 17 - CatFileCreator knob is torchScriptFile (capital S), Inference tileSize only takes None/1024/2048/4096 (512 errors), torch is not importable from Nuke Python, cat.json minimum_nuke_version_required gates discovery, setting modelFile blocks the bridge. Use when tracing a PyTorch model for Nuke, building a .cat, installing a Cattery package or setting up an Inference node./nuke-node-tree-patternsVerified patterns for building Nuke node trees from Python - what auto-connects, cropping with Reformat 'to box', blending overlapping pre-masked tiles with an Expression mask, Premult and a plus Merge. Use when a script must wire, position or blend generated nodes, or for tile-and-blend tools./nuke-particle-blinkscriptVerified ParticleBlinkScript and procedural-particle traps in Nuke - loads kernels via kernelFile + loadKernelFile and makes no param knobs headless, bundled Particle* gizmo params have no kernel prefix (paDirection), ParticleEmitter takes emit geo on input 1, image y points up. Use for custom Nuke particles, Particle* gizmos, or BlinkScript snow, embers, dust or sparks overlays.Other plugins' skills for the same job