Skip to content
Snippets Groups Projects
Commit 3c410d63 authored by Vilem Duha's avatar Vilem Duha
Browse files

BlenderKit: Don't do checks in the background mode or restricted context(blender startup)

parent 8f1363a8
No related branches found
No related tags found
No related merge requests found
......@@ -687,7 +687,6 @@ def get_download_url(asset_data, scene_id, api_key, tcom=None):
r = None
try:
r = requests.get(asset_data['download_url'], params=data, headers=headers)
fprint(r.text)
except Exception as e:
print(e)
if tcom is not None:
......
......@@ -175,11 +175,10 @@ def load_prefs():
user_preferences.global_dir = prefs['global_dir']
def save_prefs(self, context):
if not bpy.app.background:
# print(type(context),type(bpy.context))
if not bpy.app.background and hasattr(bpy.context, 'view_layer'):
user_preferences = bpy.context.preferences.addons['blenderkit'].preferences
if user_preferences.api_key != '':
print(len(user_preferences.api_key))
print('length')
if len(user_preferences.api_key)>35:
prefs = {
'API_key': user_preferences.api_key,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment