diff options
author | Vilem Duha <vilem.duha@gmail.com> | 2019-04-21 22:19:34 +0300 |
---|---|---|
committer | Vilem Duha <vilem.duha@gmail.com> | 2019-04-21 22:20:17 +0300 |
commit | 3c410d63d347dd9fc45294fffe3dafd34f83e4d4 (patch) | |
tree | 1c8b5878fa53bc30cab7ef7d5d192185e5a1dffe /blenderkit | |
parent | 8f1363a8170bd33e8c66b16565afd31acd51dd64 (diff) |
BlenderKit: Don't do checks in the background mode or restricted context(blender startup)
Diffstat (limited to 'blenderkit')
-rw-r--r-- | blenderkit/download.py | 1 | ||||
-rw-r--r-- | blenderkit/utils.py | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/blenderkit/download.py b/blenderkit/download.py index c1db12ea..175a9771 100644 --- a/blenderkit/download.py +++ b/blenderkit/download.py @@ -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: diff --git a/blenderkit/utils.py b/blenderkit/utils.py index 2c12f0e7..56e9a0ef 100644 --- a/blenderkit/utils.py +++ b/blenderkit/utils.py @@ -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, |