Skip to content

Commit 9ac6153

Browse files
committed
Use bpy.utils.extension_path_user() for wheels download and custom config files
1 parent 62e068b commit 9ac6153

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
blc_wheel_path = os.environ.get("BLC_WHEEL_PATH")
5353

5454
if am_in_extension:
55+
root_folder = pathlib.Path(bpy.utils.extension_path_user(__package__, path="", create=True))
56+
wheel_dl_folder = pathlib.Path(bpy.utils.extension_path_user(__package__, path="wheels", create=True))
57+
wheel_backup_folder = pathlib.Path(bpy.utils.extension_path_user(__package__, path="wheels_backup", create=True))
58+
wheel_dev_folder = pathlib.Path(bpy.utils.extension_path_user(__package__, path="pyluxcore_custom", create=True))
59+
60+
"""
5561
root_folder = pathlib.Path(__file__).parent.resolve()
5662
wheel_dl_folder = root_folder / "wheels" # for wheels download
5763
if not os.path.exists(wheel_dl_folder):
@@ -62,6 +68,7 @@
6268
wheel_dev_folder = root_folder / "pyluxcore_custom" # folder where a nightly build pyluxcore wheel can be placed
6369
if not os.path.exists(wheel_dev_folder):
6470
os.makedirs(wheel_dev_folder)
71+
"""
6572
# For installation on PCs without internet, or in company networks where downloading
6673
# with pip is an issue (reported cases), check for the presence of a folder install_offline/
6774
# where the pyluxcore wheel, and its dependencies, are placed.
@@ -102,10 +109,10 @@ def _execute_wheel_download(command):
102109

103110
def _update_manifest():
104111
# Setup manifest with wheel list
105-
manifest_path = root_folder / 'blender_manifest.toml'
112+
manifest_path = pathlib.Path('.', 'blender_manifest.toml')
106113
files, *_ = os.walk(wheel_dl_folder)
107114
wheels = [
108-
pathlib.Path('.', 'wheels', f).as_posix()
115+
pathlib.Path(wheel_dl_folder, f).as_posix()
109116
for f in files[2]
110117
]
111118
wheel_statement = f'wheels = {wheels}\n'

0 commit comments

Comments
 (0)