🐛[bugfix] Model : steamVRが起動していない場合にOverlayが動作をしないように修正
This commit is contained in:
@@ -1,9 +1,16 @@
|
|||||||
|
import psutil
|
||||||
import ctypes
|
import ctypes
|
||||||
import time
|
import time
|
||||||
import asyncio
|
import asyncio
|
||||||
import openvr
|
import openvr
|
||||||
from PIL import Image
|
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:
|
# This code is based on the following source:
|
||||||
# [GOpy](https://github.com/MeroFune/GOpy)
|
# [GOpy](https://github.com/MeroFune/GOpy)
|
||||||
def mat34Id():
|
def mat34Id():
|
||||||
@@ -120,6 +127,7 @@ class Overlay:
|
|||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
try:
|
try:
|
||||||
|
if check_steamvr_running() is True:
|
||||||
openvr.init(openvr.VRApplication_Overlay)
|
openvr.init(openvr.VRApplication_Overlay)
|
||||||
self.initFlag = True
|
self.initFlag = True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user