exec_python
Run Python code in a live Nuke session as one undoable step, with Nuke modules imported and a persistent namespace; returns expression results plus stdout/stderr.
Instructions
Run Python inside the live Nuke session as ONE undo step. nuke and
nukescripts are imported; the namespace persists between calls. The
value of a trailing expression (or a result variable) is returned,
along with captured stdout/stderr. Prefer the dedicated tools when one fits.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "exec_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| reset_namespace | No |