From df5c4aebd8cd2adc31144eaecb3819c9561421ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 20 May 2021 17:13:23 +0200 Subject: [PATCH] also prepend modules to sys path --- openpype/hosts/blender/api/lib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/blender/api/lib.py b/openpype/hosts/blender/api/lib.py index e4d063a583..fe5d3f93e9 100644 --- a/openpype/hosts/blender/api/lib.py +++ b/openpype/hosts/blender/api/lib.py @@ -78,8 +78,12 @@ def load_scripts(paths): addons_paths = [] for base_path in paths: addons_path = os.path.join(base_path, "addons") - if os.path.exists(addons_path): - addons_paths.append(addons_path) + if not os.path.exists(addons_path): + continue + addons_paths.append(addons_path) + addons_module_path = os.path.join(addons_path, "modules") + if os.path.exists(addons_module_path): + bpy.utils._sys_path_ensure_prepend(addons_module_path) if addons_paths: # Fake addons