diff options
Diffstat (limited to 'blenderkit/categories.py')
-rw-r--r-- | blenderkit/categories.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/blenderkit/categories.py b/blenderkit/categories.py index ee20557c..6407b050 100644 --- a/blenderkit/categories.py +++ b/blenderkit/categories.py @@ -92,16 +92,18 @@ def load_categories(): categories_filepath = os.path.join(tempdir, 'categories.json') wm = bpy.context.window_manager - with open(categories_filepath, 'r') as catfile: - wm['bkit_categories'] = json.load(catfile) - - wm['active_category'] = { - 'MODEL': ['model'], - 'SCENE': ['scene'], - 'MATERIAL': ['material'], - 'BRUSH': ['brush'], - } - + try: + with open(categories_filepath, 'r') as catfile: + wm['bkit_categories'] = json.load(catfile) + + wm['active_category'] = { + 'MODEL': ['model'], + 'SCENE': ['scene'], + 'MATERIAL': ['material'], + 'BRUSH': ['brush'], + } + except: + print('categories failed to read') def fetch_categories(API_key): url = paths.get_api_url() + 'categories/' |