From 743d7ae95a3cc1bb66bf5f37189b6c33e4bf916b Mon Sep 17 00:00:00 2001 From: Victorious Children Studios Date: Tue, 19 Dec 2023 21:20:58 +0200 Subject: [PATCH] Slight change to make Blender Thing Work with Tor --- settings/oscalls.py | 20 ++++++++++++++++---- studio/studio_assetLayer.py | 7 ++----- studio/studio_asset_selectLayer.py | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/settings/oscalls.py b/settings/oscalls.py index 15a22af..9f26c9b 100644 --- a/settings/oscalls.py +++ b/settings/oscalls.py @@ -130,6 +130,13 @@ def file_open(win, path): else: Open(path) +def ontor(win): + if ".onion" in win.analytics.get("remote-server-url", ""): + return True + else: + return False + + def copy_file(win, from_path, to_path, new_name=""): ############################################################################ @@ -174,8 +181,10 @@ def copy_file(win, from_path, to_path, new_name=""): for bt in [".blend", ".blend1"]: if from_path.endswith(bt): blendfile = True - - if blendfile: + + + + if blendfile and not ontor(win): # Now before we copy blend file we need to check whether Blender is even # installed. @@ -214,5 +223,8 @@ def get_current_blender(win): # (At the moment the feature is not implemented. So this is a placeholder.) ############################################################################ - - return win.settings.get("blender-bash", "blender") + + if not ontor(win): + return win.settings.get("blender-bash", "blender") + else: + return "xdg-open" diff --git a/studio/studio_assetLayer.py b/studio/studio_assetLayer.py index f645fad..bd8e37b 100644 --- a/studio/studio_assetLayer.py +++ b/studio/studio_assetLayer.py @@ -489,14 +489,11 @@ def layer(win): if win.current["in-asset-remote-server"]: - # First we gonna change the active folder to view the Blend files. - # This is important for the function for the remote server. - win.current["asset_cur_folder"] = "blender" + # Let's also check for updates on the file - # Remote Server Stuff if win.analytics["from-remote-server"]: @@ -513,7 +510,7 @@ def layer(win): check_updates.setDaemon(True) check_updates.start() - + win.current["in-asset-remote-server"] = False diff --git a/studio/studio_asset_selectLayer.py b/studio/studio_asset_selectLayer.py index 3fac51d..ae046b1 100644 --- a/studio/studio_asset_selectLayer.py +++ b/studio/studio_asset_selectLayer.py @@ -291,6 +291,7 @@ def layer(win, call): # Button to activate it def do(): + print("test") win.current["calls"][call]["var"] = "/"+win.current["asset_cur"]+"/"+asset win.assets = {}