🐛[bugfix] Model : steamVRが起動していない場合にOverlayが動作をしないように修正
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import psutil
|
||||
import ctypes
|
||||
import time
|
||||
import asyncio
|
||||
import openvr
|
||||
from PIL import Image
|
||||
|
||||
def check_steamvr_running():
|
||||
for proc in psutil.process_iter():
|
||||
if "vrserver" in proc.name().lower() or "vrcompositor" in proc.name().lower():
|
||||
return True
|
||||
return False
|
||||
|
||||
# This code is based on the following source:
|
||||
# [GOpy](https://github.com/MeroFune/GOpy)
|
||||
def mat34Id():
|
||||
@@ -120,8 +127,9 @@ class Overlay:
|
||||
|
||||
def init(self):
|
||||
try:
|
||||
openvr.init(openvr.VRApplication_Overlay)
|
||||
self.initFlag = True
|
||||
if check_steamvr_running() is True:
|
||||
openvr.init(openvr.VRApplication_Overlay)
|
||||
self.initFlag = True
|
||||
except Exception as e:
|
||||
print("Could not initialise OpenVR")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user