2025-12-01
This commit is contained in:
@@ -45,6 +45,7 @@ BLENDERKIT_MATERIAL_UPLOAD_INSTRUCTIONS_URL = (
|
||||
BLENDERKIT_BRUSH_UPLOAD_INSTRUCTIONS_URL = f"{global_vars.SERVER}/docs/uploading-brush/"
|
||||
BLENDERKIT_HDR_UPLOAD_INSTRUCTIONS_URL = f"{global_vars.SERVER}/docs/uploading-hdr/"
|
||||
BLENDERKIT_SCENE_UPLOAD_INSTRUCTIONS_URL = f"{global_vars.SERVER}/docs/uploading-scene/"
|
||||
BLENDERKIT_ADDON_UPLOAD_INSTRUCTIONS_URL = f"{global_vars.SERVER}/add-ons-upload-beta/"
|
||||
BLENDERKIT_LOGIN_URL = f"{global_vars.SERVER}/accounts/login"
|
||||
BLENDERKIT_SIGNUP_URL = f"{global_vars.SERVER}/accounts/register"
|
||||
|
||||
@@ -152,6 +153,7 @@ def get_download_dirs(asset_type):
|
||||
"hdr": "hdrs",
|
||||
"nodegroup": "nodegroups",
|
||||
"printable": "printables",
|
||||
"addon": "addons",
|
||||
}
|
||||
|
||||
dirs = []
|
||||
@@ -273,6 +275,7 @@ def get_res_file(asset_data, resolution, find_closest_with_url=False):
|
||||
resolution, so that other processess can pass correctly which resolution is downloaded.
|
||||
"""
|
||||
orig = None
|
||||
zipf = None
|
||||
res = None
|
||||
closest = None
|
||||
target_resolution = resolutions.get(resolution)
|
||||
@@ -284,6 +287,8 @@ def get_res_file(asset_data, resolution, find_closest_with_url=False):
|
||||
if resolution == "blend":
|
||||
# orig file found, return.
|
||||
return orig, "blend"
|
||||
if f.get("fileType") == "zip_file":
|
||||
zipf = f
|
||||
|
||||
if f["fileType"] == resolution:
|
||||
# exact match found, return.
|
||||
@@ -296,7 +301,10 @@ def get_res_file(asset_data, resolution, find_closest_with_url=False):
|
||||
closest = f
|
||||
mindist = rdiff
|
||||
if not res and not closest:
|
||||
return orig, "blend"
|
||||
if orig is not None:
|
||||
return orig, "blend"
|
||||
if zipf is not None:
|
||||
return zipf, "zip_file"
|
||||
return closest, closest["fileType"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user