Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'blenderkit/autothumb_material_bg.py')
-rw-r--r--blenderkit/autothumb_material_bg.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/blenderkit/autothumb_material_bg.py b/blenderkit/autothumb_material_bg.py
index 0a0ce5db..3ae0d5dd 100644
--- a/blenderkit/autothumb_material_bg.py
+++ b/blenderkit/autothumb_material_bg.py
@@ -20,7 +20,7 @@
from blenderkit import utils, append_link, bg_blender, upload_bg, download
-import sys, json, math
+import sys, json, math, os
import bpy
from pathlib import Path
@@ -48,6 +48,10 @@ if __name__ == "__main__":
data = json.load(s)
# append_material(file_name, matname = None, link = False, fake_user = True)
if data.get('do_download'):
+ #need to save the file, so that asset doesn't get downloaded into addon directory
+ temp_blend_path = os.path.join(data['tempdir'], 'temp.blend')
+ bpy.ops.wm.save_as_mainfile(filepath=temp_blend_path)
+
asset_data = data['asset_data']
has_url = download.get_download_url(asset_data, download.get_scene_id(), user_preferences.api_key, tcom=None,
resolution='blend')