feat(viz): fixed default viz mode (voronoi on t)
CI build oscope-of / build-check (push) Has been cancelled
CI build oscope-of / build-check (push) Has been cancelled
VIZ_DEFAULT_MODE=<name> 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.
This commit is contained in:
@@ -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_HUD "0" bool show debug HUD overlay
|
||||||
VIZ_SOURCE_KEYS "0" bool wxcvbn + 0-9 source-bundle shortcuts (off: perf safety)
|
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_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
|
IPHONE_OSC_PORT 57128 int UDP port for iPhone ARBodyTracker /body3d/kp
|
||||||
CONCERT_MIRROR "1" bool mirror video horizontally (!=0 = True)
|
CONCERT_MIRROR "1" bool mirror video horizontally (!=0 = True)
|
||||||
ICP_FUSION "0" bool enable ICP LiDAR fusion (only "1" = 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
|
# Audio-scene row (qsdfghjkl): same perf-safety gate, same date. The
|
||||||
# special m key (matrix mode: scene stop + openpos viz) stays active.
|
# special m key (matrix mode: scene stop + openpos viz) stays active.
|
||||||
viz_audio_keys: bool = False
|
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 ------------------------------------------------------
|
||||||
iphone_osc_port: int = 57128
|
iphone_osc_port: int = 57128
|
||||||
@@ -290,6 +296,7 @@ class VizConfig:
|
|||||||
viz_hud=_bool_std("VIZ_HUD", False),
|
viz_hud=_bool_std("VIZ_HUD", False),
|
||||||
viz_source_keys=_bool_std("VIZ_SOURCE_KEYS", False),
|
viz_source_keys=_bool_std("VIZ_SOURCE_KEYS", False),
|
||||||
viz_audio_keys=_bool_std("VIZ_AUDIO_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),
|
iphone_osc_port=_int("IPHONE_OSC_PORT", 57128),
|
||||||
concert_mirror=_bool_ne0("CONCERT_MIRROR", True),
|
concert_mirror=_bool_ne0("CONCERT_MIRROR", True),
|
||||||
# ICP_FUSION / MULTIHMR_AUTOCAST use strict "1" convention
|
# ICP_FUSION / MULTIHMR_AUTOCAST use strict "1" convention
|
||||||
|
|||||||
+12
-2
@@ -206,9 +206,19 @@ class AppDelegate(NSObject):
|
|||||||
# 2d) Auto-engage du mode openpos (#9) quand des personnes sont
|
# 2d) Auto-engage du mode openpos (#9) quand des personnes sont
|
||||||
# detectees. Si l'utilisateur a force un mode au clavier dans
|
# detectees. Si l'utilisateur a force un mode au clavier dans
|
||||||
# les 8 dernieres secondes, on n'override pas (lock manuel).
|
# les 8 dernieres secondes, on n'override pas (lock manuel).
|
||||||
|
# VIZ_DEFAULT_MODE=<name> 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._user_viz_lock_t = 0.0 # set par _on_key, lu par autoOpenpos
|
||||||
self._autoOpenposTimer = NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(
|
from .config import VizConfig as _VC
|
||||||
0.5, self, "autoOpenpos:", None, True)
|
_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:
|
if self._opts.fullscreen:
|
||||||
self._window.toggleFullScreen_(None)
|
self._window.toggleFullScreen_(None)
|
||||||
|
|||||||
@@ -419,3 +419,9 @@ def test_viz_audio_keys_default_off():
|
|||||||
cfg = VizConfig.from_env({})
|
cfg = VizConfig.from_env({})
|
||||||
assert cfg.viz_audio_keys is False
|
assert cfg.viz_audio_keys is False
|
||||||
assert VizConfig.from_env({"VIZ_AUDIO_KEYS": "1"}).viz_audio_keys is True
|
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"
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ export PINCH_ENABLE="${PINCH_ENABLE:-1}"
|
|||||||
# displayed video ccw. The 2D landmark streams arrive already uprighted
|
# displayed video ccw. The 2D landmark streams arrive already uprighted
|
||||||
# (see iphone_usb_source) and are not rotated.
|
# (see iphone_usb_source) and are not rotated.
|
||||||
export VIDEO_ROTATE="${VIDEO_ROTATE:-ccw}"
|
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);
|
# Gestures use the iPhone Vision hands exclusively (stable, rotation-invariant);
|
||||||
# the Mac MediaPipe hand detector is skipped under --iphone-usb (multi.py).
|
# the Mac MediaPipe hand detector is skipped under --iphone-usb (multi.py).
|
||||||
export FINGER_SOURCE="${FINGER_SOURCE:-iphone}"
|
export FINGER_SOURCE="${FINGER_SOURCE:-iphone}"
|
||||||
|
|||||||
Reference in New Issue
Block a user