BlenderKit: Don't do checks in the background mode or restricted context(blender startup)
This commit is contained in:
parent
8f1363a817
commit
3c410d63d3
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue