feat(viz): hold last X/Y markers when hand drops
CI build oscope-of / build-check (push) Has been cancelled
CI build oscope-of / build-check (push) Has been cancelled
SC's mod cache keeps the last received value when a hand vanishes, but the gauge markers and wrist cross disappeared — the screen no longer showed what the matrix was hearing. Markers now hold the last known position (dim conf 0.45) and go full-bright when the hand is live.
This commit is contained in:
@@ -589,26 +589,38 @@ class MetalRenderer(NSObject):
|
|||||||
if _q >= 0.85 or _st == 3:
|
if _q >= 0.85 or _st == 3:
|
||||||
for ax, ay, bx, by in _frame_segs:
|
for ax, ay, bx, by in _frame_segs:
|
||||||
push_panel(ax + 0.002, ay, bx + 0.002, by, _fconf, _fpid)
|
push_panel(ax + 0.002, ay, bx + 0.002, by, _fconf, _fpid)
|
||||||
# Position gauges (X below / Y outer-side)
|
# Position gauges (X below / Y outer-side). SC's mod cache
|
||||||
|
# HOLDS the last received value when a hand vanishes, so the
|
||||||
|
# markers must stay visible at that last value too (user:
|
||||||
|
# "X et Y toujours visibles") — live = full conf, held = dim.
|
||||||
_slot_key = "L" if side_name == "left" else "R"
|
_slot_key = "L" if side_name == "left" else "R"
|
||||||
_slot_hf = _hf_all.get(_slot_key)
|
_slot_hf = _hf_all.get(_slot_key)
|
||||||
_g_cx = _slot_hf["cx"] if _slot_hf else None
|
if not hasattr(self, "_gauge_hold"):
|
||||||
_g_cy = _slot_hf["cy"] if _slot_hf else None
|
self._gauge_hold = {"L": (None, None), "R": (None, None)}
|
||||||
|
_live = _slot_hf is not None
|
||||||
|
if _live:
|
||||||
|
self._gauge_hold[_slot_key] = (_slot_hf["cx"],
|
||||||
|
_slot_hf["cy"])
|
||||||
|
_g_cx, _g_cy = self._gauge_hold[_slot_key]
|
||||||
|
_mk_conf = 1.0 if _live else 0.45
|
||||||
for ax, ay, bx, by, gconf, gpid in gauge_segments(
|
for ax, ay, bx, by, gconf, gpid in gauge_segments(
|
||||||
_g_cx, _g_cy, side_name, asp, mirror,
|
_g_cx, _g_cy, side_name, asp, mirror,
|
||||||
content_pid=pid_s,
|
content_pid=pid_s,
|
||||||
):
|
):
|
||||||
push_panel(ax, ay, bx, by, gconf, gpid)
|
push_panel(ax, ay, bx, by,
|
||||||
|
min(gconf, _mk_conf) if gpid == pid_s
|
||||||
|
else gconf, gpid)
|
||||||
# Wrist marker ON the video: the X/Y voice mods are anchored
|
# Wrist marker ON the video: the X/Y voice mods are anchored
|
||||||
# to the wrist, so its control point stays visible whenever
|
# to the wrist, so its control point stays visible whenever
|
||||||
# features exist (even for far hands the overlay filters
|
# a value exists (held at the last position when the hand
|
||||||
# out). push_seg applies the video mirror like the overlay.
|
# drops, matching what SC hears). push_seg applies the
|
||||||
|
# video mirror like the overlay.
|
||||||
if _g_cx is not None and _g_cy is not None:
|
if _g_cx is not None and _g_cy is not None:
|
||||||
_mx = 0.015 / asp
|
_mx = 0.015 / asp
|
||||||
push_seg(_g_cx - _mx, _g_cy, _g_cx + _mx, _g_cy,
|
push_seg(_g_cx - _mx, _g_cy, _g_cx + _mx, _g_cy,
|
||||||
1.0, pid_s)
|
_mk_conf, pid_s)
|
||||||
push_seg(_g_cx, _g_cy - 0.015, _g_cx, _g_cy + 0.015,
|
push_seg(_g_cx, _g_cy - 0.015, _g_cx, _g_cy + 0.015,
|
||||||
1.0, pid_s)
|
_mk_conf, pid_s)
|
||||||
if h_kp is not None:
|
if h_kp is not None:
|
||||||
for seg in panel_segments(
|
for seg in panel_segments(
|
||||||
h_kp, side_name, lhand_bones_p, asp,
|
h_kp, side_name, lhand_bones_p, asp,
|
||||||
|
|||||||
Reference in New Issue
Block a user