From fa52f689039293cbd58922dede2061155acb6b1d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 14 Apr 2021 11:42:36 +0200 Subject: [PATCH] changed how OPENPYPE_ROOT is set --- start.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/start.py b/start.py index f2fe1513e1..cfac340080 100644 --- a/start.py +++ b/start.py @@ -543,6 +543,11 @@ def _bootstrap_from_code(use_version): def boot(): """Bootstrap OpenPype.""" + # ------------------------------------------------------------------------ + # Set environment to OpenPype root path + # ------------------------------------------------------------------------ + os.environ["OPENPYPE_ROOT"] = OPENPYPE_ROOT + # ------------------------------------------------------------------------ # Play animation # ------------------------------------------------------------------------ @@ -573,16 +578,6 @@ def boot(): os.environ["OPENPYPE_MONGO"] = openpype_mongo os.environ["OPENPYPE_DATABASE_NAME"] = "openpype" # name of Pype database - # ------------------------------------------------------------------------ - # Set environments - load OpenPype path from database (if set) - # ------------------------------------------------------------------------ - # set OPENPYPE_ROOT to running location until proper version can be - # determined. - if getattr(sys, 'frozen', False): - os.environ["OPENPYPE_ROOT"] = os.path.dirname(sys.executable) - else: - os.environ["OPENPYPE_ROOT"] = os.path.dirname(__file__) - # Get openpype path from database and set it to environment so openpype can # find its versions there and bootstrap them. openpype_path = get_openpype_path_from_db(openpype_mongo) @@ -612,12 +607,6 @@ def boot(): # or to `openpype` or `openpype_console` in case of frozen code os.environ["OPENPYPE_EXECUTABLE"] = sys.executable - if getattr(sys, 'frozen', False): - os.environ["OPENPYPE_REPOS_ROOT"] = os.environ["OPENPYPE_ROOT"] - else: - os.environ["OPENPYPE_REPOS_ROOT"] = os.path.join( - os.environ["OPENPYPE_ROOT"], "repos") - # delete OpenPype module and it's submodules from cache so it is used from # specific version modules_to_del = [