From 7b039fbb78444d02673a60b61d52d154de3ffdbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=27=C3=A9lectron=20rare?= <108685187+electron-rare@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:54:48 +0200 Subject: [PATCH] feat(viz): fixed default viz mode (voronoi on t) VIZ_DEFAULT_MODE= boots the viz on that mode and disables the auto-openpos switch entirely, so the mode is truly always active (user request: the t-key voronoi effect permanent). Concert launcher defaults to voronoi; "auto" keeps the historical behavior. --- data_only_viz/config.py | 7 +++++++ data_only_viz/main.py | 14 ++++++++++++-- data_only_viz/tests/test_config.py | 6 ++++++ launcher/concert/launch_concert.sh | 3 +++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/data_only_viz/config.py b/data_only_viz/config.py index 8c4f255..af07416 100644 --- a/data_only_viz/config.py +++ b/data_only_viz/config.py @@ -44,6 +44,7 @@ ARKIT_FULL_SKELETON "1" bool draw full 91-joint ARKit body (!=0 VIZ_HUD "0" bool show debug HUD overlay VIZ_SOURCE_KEYS "0" bool wxcvbn + 0-9 source-bundle shortcuts (off: perf safety) VIZ_AUDIO_KEYS "0" bool qsdfghjkl audio-scene shortcuts (off: perf safety; m stays) +VIZ_DEFAULT_MODE "auto" str fixed boot viz mode (e.g. voronoi); disables auto-openpos IPHONE_OSC_PORT 57128 int UDP port for iPhone ARBodyTracker /body3d/kp CONCERT_MIRROR "1" bool mirror video horizontally (!=0 = True) ICP_FUSION "0" bool enable ICP LiDAR fusion (only "1" = True) @@ -141,6 +142,11 @@ class VizConfig: # Audio-scene row (qsdfghjkl): same perf-safety gate, same date. The # special m key (matrix mode: scene stop + openpos viz) stays active. viz_audio_keys: bool = False + # Fixed viz mode at boot (a viz_mode_names entry, e.g. "voronoi"). + # "auto" = historical behavior (mode 0 + auto-openpos when persons + # appear). A fixed mode also DISABLES the auto-openpos timer so it is + # truly always on (user request live 2026-07-02: t/voronoi permanent). + viz_default_mode: str = "auto" # ---- iPhone OSC ------------------------------------------------------ iphone_osc_port: int = 57128 @@ -290,6 +296,7 @@ class VizConfig: viz_hud=_bool_std("VIZ_HUD", False), viz_source_keys=_bool_std("VIZ_SOURCE_KEYS", False), viz_audio_keys=_bool_std("VIZ_AUDIO_KEYS", False), + viz_default_mode=_str("VIZ_DEFAULT_MODE", "auto"), iphone_osc_port=_int("IPHONE_OSC_PORT", 57128), concert_mirror=_bool_ne0("CONCERT_MIRROR", True), # ICP_FUSION / MULTIHMR_AUTOCAST use strict "1" convention diff --git a/data_only_viz/main.py b/data_only_viz/main.py index df040b6..2186ff0 100644 --- a/data_only_viz/main.py +++ b/data_only_viz/main.py @@ -206,9 +206,19 @@ class AppDelegate(NSObject): # 2d) Auto-engage du mode openpos (#9) quand des personnes sont # detectees. Si l'utilisateur a force un mode au clavier dans # les 8 dernieres secondes, on n'override pas (lock manuel). + # VIZ_DEFAULT_MODE= fixes the boot mode and DISABLES the + # auto-switch entirely (user request: t/voronoi always active). self._user_viz_lock_t = 0.0 # set par _on_key, lu par autoOpenpos - self._autoOpenposTimer = NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( - 0.5, self, "autoOpenpos:", None, True) + from .config import VizConfig as _VC + _vmode = _VC.from_env().viz_default_mode + self._autoOpenposTimer = None + if _vmode != "auto" and _vmode in self._state.viz_mode_names: + with self._state.lock(): + self._state.viz_mode = self._state.viz_mode_names.index(_vmode) + LOG.info("[viz] fixed default mode %s (auto-openpos disabled)", _vmode) + else: + self._autoOpenposTimer = NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( + 0.5, self, "autoOpenpos:", None, True) if self._opts.fullscreen: self._window.toggleFullScreen_(None) diff --git a/data_only_viz/tests/test_config.py b/data_only_viz/tests/test_config.py index e9edd19..73e59fe 100644 --- a/data_only_viz/tests/test_config.py +++ b/data_only_viz/tests/test_config.py @@ -419,3 +419,9 @@ def test_viz_audio_keys_default_off(): cfg = VizConfig.from_env({}) assert cfg.viz_audio_keys is False assert VizConfig.from_env({"VIZ_AUDIO_KEYS": "1"}).viz_audio_keys is True + + +def test_viz_default_mode(): + assert VizConfig.from_env({}).viz_default_mode == "auto" + assert VizConfig.from_env( + {"VIZ_DEFAULT_MODE": "voronoi"}).viz_default_mode == "voronoi" diff --git a/launcher/concert/launch_concert.sh b/launcher/concert/launch_concert.sh index fc8c4a8..7529766 100755 --- a/launcher/concert/launch_concert.sh +++ b/launcher/concert/launch_concert.sh @@ -29,6 +29,9 @@ export PINCH_ENABLE="${PINCH_ENABLE:-1}" # displayed video ccw. The 2D landmark streams arrive already uprighted # (see iphone_usb_source) and are not rotated. export VIDEO_ROTATE="${VIDEO_ROTATE:-ccw}" +# Fixed viz mode: voronoi (the t-key effect) always active — the auto +# openpos switch is disabled by data_only_viz when a mode is fixed. +export VIZ_DEFAULT_MODE="${VIZ_DEFAULT_MODE:-voronoi}" # Gestures use the iPhone Vision hands exclusively (stable, rotation-invariant); # the Mac MediaPipe hand detector is skipped under --iphone-usb (multi.py). export FINGER_SOURCE="${FINGER_SOURCE:-iphone}"