Commit Graph
6 Commits
Author SHA1 Message Date
PozzettiAndrea 9dbd869c9d Dual overlay: per-mesh color + opacity via two actors; VTK preview bar loses Mode
Preview Mesh Dual (fields overlay):
- The overlay now renders from the TWO per-mesh files (already exported every
  run) as two actors in one renderer, replacing the combined-file single
  actor. Per-mesh opacity finally works for real (the old path could only
  apply the AVERAGE of both opacities to one merged actor).
- New color pickers (1: / 2:) next to the opacity inputs in the bar, overlay
  only. Colors + opacities are pure client-side (viewerState-persisted,
  re-posted on change); defaults red/blue match the old baked colors.
- Viewer (viewer_dual.html): second overlay actor; layout-aware mapper +
  render helpers (mapper1Active/mapper2Active/renderActiveViews) so field
  selection, colormaps, and edge toggles now work in overlay too (previously
  field application only targeted the side-by-side mappers); settings apply
  point size/edges/representation to both overlay actors (color stays
  per-mesh). Legacy combined-file overlay path kept for old widgets; the
  textured overlay still uses the combined GLB (colors don't apply to
  textures).

Preview Mesh (VTK): Mode selector removed from the JS bar -- the node's own
`mode` input is the only control (bar keeps just the fullscreen button).
2026-08-14 14:45:43 +02:00
PozzettiAndrea 4b5486076a Revert "Hide bar-driven widgets from node bodies (JS only; Python untouched)"
This reverts commit 54c3ad01aa.
2026-08-14 14:21:57 +02:00
PozzettiAndrea 54c3ad01aa Hide bar-driven widgets from node bodies (JS only; Python untouched)
The control bars are now the ONLY visible controls; the node input widgets
they drive are hidden via a new hideWidgets() util (uiComponents.js). The
widgets keep existing -- values still serialize into the workflow and flow to
Python as inputs -- they just stop rendering on the node body.

- Multi / VTK preview / Batch: `mode` widget hidden (bar Mode selector drives
  it). Batch keeps its `index` widget visible (useful for typing an exact
  index).
- Dual: `layout`, `mode`, `opacity_1`, `opacity_2` all hidden. Opacity moves
  into the bar (shown only for the Overlay layout) and is applied
  CLIENT-SIDE: changing it updates the hidden widgets (persistence + next
  run) and re-posts to the viewer immediately -- no re-run. render() now
  prefers widget values over the last message's, which also fixes the
  `|| 1.0` bug that made opacity 0 impossible.

No Python or export-format changes, per direction.
2026-08-14 14:18:15 +02:00
PozzettiAndrea 6047a30e1b Dual/VTK/Multi preview bars: layout+mode selectors, opacity gating, shared fullscreen
Preview Mesh Dual:
- New control bar with Layout (Side by side | Overlay | Slider) and Mode
  (Fields | Texture), two-way synced with the node widgets.
- side_by_side <-> slider reuse the SAME exported files, so that switch is
  CLIENT-SIDE: onExecuted was refactored into render(message, layoutOverride)
  and the last message is stored -- switching re-renders instantly, no re-run.
  Overlay needs the combined export and mode changes the export format, so
  those queue a re-run (same cost as editing the widget).
- opacity_1/opacity_2 widgets are hidden unless layout is Overlay (the
  hidden-type trick from preview_mesh_batch_render.js), restored when it is.

Preview Mesh (VTK): new bar with Mode (Fields | Texture | Texture (PBR)),
two-way synced, re-runs on change.

Fullscreen: new createFullscreenButton(container) in utils/uiComponents.js
(fullscreens the whole widget so bar controls stay usable; listeners on the
container only, isolation-clean). Wired into Dual, VTK, and Multi bars (in
Multi it sits outside the collapsible group so it survives collapse). The
batch node keeps its own earlier implementation with arrow-key nav.

Note: plain Preview Mesh (three.js, GeomPackPreviewMesh) has no mode input on
the Python side, so there is nothing to select there; the VTK preview is the
one with modes. comfy-3d-viewers was checked for fullscreen prior art -- its
"FullScreen" hits are VTK class names, not browser fullscreen; this is new.
2026-08-14 14:01:37 +02:00
PozzettiAndrea feb273ad0a Isolation-clean frontend: delete dead JS, guard listeners, leave shared DOM
- Delete 7 dead-squat widgets (registered UI only for other packs' nodes:
  UniRig/SAM3D/Mocap/FBXPreview/BVH/pointcloud) + their 6 orphaned viewer
  HTMLs + the entire unused js/viewer tree (21 files, imported by nothing;
  only ui/styles.css survives) + unused utils barrel.
- Rename namespace geompack -> geometrypack (= DisplayName, lowercased);
  all 17 surviving extensions now geometrypack.*.
- Add event.source provenance guards to every message listener (2 inline,
  2 factory handlers via new iframe param).
- Stop touching document.body: upload file input stays detached (click()
  works detached in modern browsers); folder autocomplete dropdown becomes
  a manual popover inside the widget's own DOM (top layer escapes canvas
  transforms without shared-DOM appends).

Passes comfy-test's javascript isolation lint with 0 errors.
2026-08-13 14:31:51 +02:00
PozzettiAndrea 414f759791 Vendor frontend JS into javascript/; drop the prestartup copy dance
The viewer JS/HTML/bundles are now committed in javascript/ (declared via
pyproject [tool.comfy] web = "javascript") instead of being copied from the
shared comfy-3d-viewers pip package at prestartup. Consequences:

- requirements.txt is now just comfy-env (host env installs nothing else,
  per the never-touch-the-host-env principle)
- prestartup_script.py no longer copies viewers or web_src; it keeps only
  setup_env() and the input-asset copies
- WEB_DIRECTORY attribute removed; the pyproject declaration is the single
  source (served at /extensions/comfyui-geometrypack/, keyed by project name)
- web_src/ deleted; its 6 widgets now live in javascript/js/ as the tracked
  source, edited directly
- viewer_pbr.html hardcoded-fallback URL updated to the new mount name

Iframe URLs auto-detect the mount from import.meta.url, so the folder rename
and mount-name change are transparent at runtime.
2026-08-12 17:37:09 +02:00