Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Blender: Set --python-use-system-env from PreLaunchHook #5565

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions openpype/hosts/blender/hooks/pre_add_python_use_system_env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from openpype.lib.applications import PreLaunchHook, LaunchTypes


class AddPythonUseSystemEnvArg(PreLaunchHook):
"""Add `--python-use-system-env` arg to blender launch."""

# Append before file argument from add last workfile (at order 10)
order = 5
app_groups = {"blender"}
launch_types = {LaunchTypes.local}

def execute(self):

arg = "--python-use-system-env"
if arg not in self.launch_context.launch_args:
self.log.debug(f"Adding required {arg} argument")
self.launch_context.launch_args.append(arg)
36 changes: 9 additions & 27 deletions openpype/settings/defaults/system_settings/applications.json
Original file line number Diff line number Diff line change
Expand Up @@ -1168,15 +1168,9 @@
"linux": []
},
"arguments": {
"windows": [
"--python-use-system-env"
],
"darwin": [
"--python-use-system-env"
],
"linux": [
"--python-use-system-env"
]
"windows": [],
"darwin": [],
"linux": []
},
"environment": {}
},
Expand All @@ -1189,15 +1183,9 @@
"linux": []
},
"arguments": {
"windows": [
"--python-use-system-env"
],
"darwin": [
"--python-use-system-env"
],
"linux": [
"--python-use-system-env"
]
"windows": [],
"darwin": [],
"linux": []
},
"environment": {}
},
Expand All @@ -1210,15 +1198,9 @@
"linux": []
},
"arguments": {
"windows": [
"--python-use-system-env"
],
"darwin": [
"--python-use-system-env"
],
"linux": [
"--python-use-system-env"
]
"windows": [],
"darwin": [],
"linux": []
},
"environment": {}
},
Expand Down