From be25a64e690ed09c2eb3b2f114c56811be6d6e11 Mon Sep 17 00:00:00 2001 From: imc Date: Fri, 7 Oct 2022 12:23:12 +0100 Subject: [PATCH] run.py and tests.py re-use existing evironment vars and can now successfully run blender on my Windows setup --- run.py | 6 ++++-- tests.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index bfabfa7d..59dcab19 100644 --- a/run.py +++ b/run.py @@ -64,8 +64,10 @@ def main(argv=None) -> int: # Environment variables - in order for --addons to work, we need to have OUR folder # exist, and we need to have "addons/modules" simlink BACK to us to create the illusion # of the directory structure Blender expects. - enviro={"BLENDER_USER_SCRIPTS": os.path.dirname(os.path.realpath(__file__))} - + #enviro={"BLENDER_USER_SCRIPTS": os.path.dirname(os.path.realpath(__file__))} + enviro=os.environ.copy() + enviro["BLENDER_USER_SCRIPTS"] = os.path.dirname(os.path.realpath(__file__)) + # Run Blender, normalize output line endings because Windows is dumb out = subprocess.run( blender_args, universal_newlines=True, env=enviro diff --git a/tests.py b/tests.py index 3893b4da..98065ac6 100644 --- a/tests.py +++ b/tests.py @@ -226,7 +226,9 @@ def main(argv=None) -> int: # Environment variables - in order for --addons to work, we need to have OUR folder # exist, and we need to have "addons/modules" simlink BACK to us to create the illusion # of the directory structure Blender expects. - enviro={"BLENDER_USER_SCRIPTS": os.path.dirname(os.path.realpath(__file__))} + #enviro={"BLENDER_USER_SCRIPTS": os.path.dirname(os.path.realpath(__file__))} + enviro = os.environ.copy() + enviro["BLENDER_USER_SCRIPTS"] = os.path.dirname(os.path.realpath(__file__)) # Run Blender, normalize output line endings because Windows is dumb out = subprocess.check_output( -- 2.36.0.windows.1