Skip to content

fix: interactive point placement on Nuke 16 (Qt6)#3

Open
semx2a wants to merge 3 commits into
Code2Collapse:mainfrom
semx2a:studio/03-nuke16-viewer
Open

fix: interactive point placement on Nuke 16 (Qt6)#3
semx2a wants to merge 3 commits into
Code2Collapse:mainfrom
semx2a:studio/03-nuke16-viewer

Conversation

@semx2a

@semx2a semx2a commented Jul 2, 2026

Copy link
Copy Markdown

Part 3 of the series — builds on #2 (review the last commit only).

The click-to-place workflow is fully wired but currently dead on Nuke 16:

  • viewer_events imports PySide2 only (NameError under Nuke 16's PySide6) and its install() is never called by anything — now PySide6-first and installed from menu.py.
  • Qt6 removed QGLWidget, so the viewer GL surface wraps to Python as a plain QWidget and the class-name gate rejected every click; the surface is now detected via the Viewer.N ancestor objectName + size, and event.position() is used with a pos() fallback.
  • Clicks fall back to the node in an active edit mode instead of silently requiring DAG selection.
  • ui_overlay: forward slashes in Read-node file knobs (Windows backslashes are mangled as escapes) and serial-numbered overlay files so the file-knob change triggers the reload — knob('reload').execute() from a click event raises Nuke's "I'm already executing something else" on every placed point.
  • callbacks: the legacy add_fg/bg_point checkbox shim only fires for Boolean knobs (on current gizmos these are PyScript buttons, where setValue(False) maps to setCommand → TypeError).

semx2a added 3 commits July 2, 2026 17:34
The package had no Nuke-level init.py, so ./gizmos was never added to the
plugin path (H2_SamViT: "Unknown command") and the H2_SamViT_Gizmo package
itself was not importable from gizmo knob callbacks. Add an init.py that
registers ./gizmos and puts the package's parent on the plugin path (which
Nuke also adds to sys.path).

Also ignore .codegraph/ tool artifacts.
Replace the ad-hoc pip installer (which failed on sam2/sam3 source builds:
missing setuptools/bdist_wheel under --no-build-isolation) with uv:

- pyproject.toml declares the full dependency set; torch/torchvision pinned
  to the CUDA 12.6 wheel index; sam2/sam3 build via
  [tool.uv.extra-build-dependencies] (setuptools/wheel injected into their
  isolated builds); triton-windows for sam3's `import triton` on Windows.
- uv.lock committed for byte-identical installs across machines.
- install.py becomes a thin driver: bootstraps uv, runs `uv sync`,
  records the venv in env_config.json, verifies imports.
- --venv <path> installs a machine-local env (faster cold starts);
  the shared ./venv next to the plugin remains the zero-setup default.
The mode-based viewer click workflow was fully wired but dead:

- viewer_events imported PySide2 only (NameError on import under Nuke 16's
  PySide6) and was never installed by anything — install it from menu.py.
- Qt6 wraps the viewer GL surface as a plain QWidget (QGLWidget is gone),
  so the class-name gate rejected every click; detect the surface via the
  "Viewer.N" ancestor objectName + size instead, and use event.position()
  with a pos() fallback.
- Clicks now fall back to the node that entered an edit mode, instead of
  silently requiring the H2 node to stay selected in the DAG.
- ui_overlay: forward slashes in Read-node file knobs (Windows backslashes
  are mangled as escape sequences) and serial-numbered overlay files so the
  file-knob change triggers the reload — knob("reload").execute() from a
  click event raised "I'm already executing something else" on every point.
- callbacks: the legacy add_fg/bg_point checkbox shim now only fires for
  Boolean knobs (on current gizmos they are PyScript buttons, where
  setValue(False) is setCommand → TypeError spam).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant