Skip to content

Native Windows video motion capture with ExMR, FlowHMR and GVHMR, contact correction, humanoid retargeting, and FBX/VMD export.

Python

Fix Windows FlowHMR worker output encoding

Justin John693b9bfa4fa0
diff --git a/mocap/worker_progress.py b/mocap/worker_progress.py
index 8efcfed..4086504 100644
--- a/mocap/worker_progress.py
+++ b/mocap/worker_progress.py
@@ -1,6 +1,10 @@
"""Presentation-only worker entry; inference/cache identities stay unchanged."""
import json,runpy,sys
+for stream in (sys.stdout,sys.stderr):
+ if hasattr(stream,'reconfigure'):
+ stream.reconfigure(encoding='utf-8',errors='backslashreplace')
+
def emit(kind,**value):
print('@@MOCAP@@'+json.dumps(dict(type=kind,**value)),flush=True)