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:
authorVilem Duha <vilem.duha@gmail.com>2019-04-11 16:14:45 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-04-21 22:20:16 +0300
commit501f660fe857dd292a18248036124c5339019ed3 (patch)
treed1e1baac41067e0c31d8fe14966cade2dcbf0051 /blenderkit/download.py
parent7d305b6868e6505ba843ca1b0cc5d6042761e505 (diff)
BlenderKit: save user preferences if user pastes the API key into the panel in 3d view.
some users were confused by this, because they didn't save their preferences. Also some users filled in the API key area some other string and then didn't know what they did wrong.
Diffstat (limited to 'blenderkit/download.py')
-rw-r--r--blenderkit/download.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/blenderkit/download.py b/blenderkit/download.py
index 7fada2b9..3f340981 100644
--- a/blenderkit/download.py
+++ b/blenderkit/download.py
@@ -285,6 +285,11 @@ def append_asset(asset_data, **kwargs): # downloaders=[], location=None,
id = asset_data['asset_base_id']
scene['assets rated'][id] = scene['assets rated'].get(id, False)
+ user_preferences = bpy.context.preferences.addons['blenderkit'].preferences
+
+ if user_preferences.api_key == '':
+ user_preferences.asset_counter+=1
+
if asset_data['asset_type'] == 'scene':
scene = append_link.append_scene(file_names[0], link=False, fake_user=False)
props = scene.blenderkit