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:
authorVilém Duha <vilda.novak@gmail.com>2019-08-20 11:22:16 +0300
committerVilém Duha <vilda.novak@gmail.com>2019-08-20 11:24:07 +0300
commit05ed8f54271de2c6e4a91fdda14c9ac3f95431ab (patch)
tree158d4e0d9f7309fd3b252314913b0559ac815d77 /blenderkit/categories.py
parent37db201e51c55dda4d302c9ce0a51105f59435bb (diff)
BlenderKit:
thumbnailer had accidentally set resolution to 50% Try to avoid a rare bug where categories file isn't present (not sure yet as why that happens, but this enables the use of the addon until categories are loaded) Internal Transfer BlendrKit data operator Switch some operators to internal and remove undo from those where it doesn't make sense.
Diffstat (limited to 'blenderkit/categories.py')
-rw-r--r--blenderkit/categories.py22
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/'