diff --git a/start.py b/start.py index 74cf4772d0..b5e0fee847 100644 --- a/start.py +++ b/start.py @@ -119,6 +119,26 @@ bootstrap = BootstrapRepos() silent_commands = ["run", "igniter", "standalonepublisher"] +def set_pype_global_environments() -> None: + """Set global pype's environments.""" + import acre + + from pype.settings import get_environments + + all_env = get_environments() + + # TODO Global environments will be stored in "general" settings so loading + # will be modified and can be done in igniter. + env = acre.merge(all_env["global"], dict(os.environ)) + os.environ.clear() + os.environ.update(env) + + # Hardcoded default values + os.environ["PYBLISH_GUI"] = "pyblish_pype" + # Change scale factor only if is not set + if "QT_AUTO_SCREEN_SCALE_FACTOR" not in os.environ: + os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" + def run(arguments: list, env: dict = None) -> int: """Use correct executable to run stuff. @@ -591,9 +611,11 @@ def boot(): from pype.lib import terminal as t from pype.version import __version__ print(">>> loading environments ...") - # Must happen before `set_modules_environments` + # Avalon environments must be set before avalon module is imported print(" - for Avalon ...") set_avalon_environments() + print(" - global Pype ...") + set_pype_global_environments() print(" - for modules ...") set_modules_environments()