From 548ffeab316a17a2382f286fa998ad6ab47edfa3 Mon Sep 17 00:00:00 2001 From: Jack Yao Date: Fri, 19 Jul 2024 08:23:41 -0500 Subject: [PATCH] deferred instancing rpc client --- src/addons/send2ue/dependencies/unreal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/addons/send2ue/dependencies/unreal.py b/src/addons/send2ue/dependencies/unreal.py index 4dd646f2..f41b0505 100644 --- a/src/addons/send2ue/dependencies/unreal.py +++ b/src/addons/send2ue/dependencies/unreal.py @@ -31,8 +31,6 @@ default_imports=['import unreal'], remap_pairs=REMAP_PAIRS, ) - -rpc_client = rpc.client.RPCClient(port=UNREAL_PORT) unreal_response = '' @@ -170,6 +168,7 @@ def is_connected(): Checks the rpc server connection """ try: + rpc_client = rpc.client.RPCClient(port=UNREAL_PORT) return rpc_client.proxy.is_running() except (RemoteDisconnected, ConnectionRefusedError, ProtocolError): return False @@ -179,6 +178,7 @@ def set_rpc_env(key, value): """ Sets an env value on the unreal RPC server. """ + rpc_client = rpc.client.RPCClient(port=UNREAL_PORT) rpc_client.proxy.set_env(key, value)