diff options
author | Vilém Duha <vilda.novak@gmail.com> | 2020-09-28 20:23:19 +0300 |
---|---|---|
committer | Vilém Duha <vilda.novak@gmail.com> | 2020-09-28 20:23:19 +0300 |
commit | e22a44f02b83b14d6d5c9b16c410266d230da882 (patch) | |
tree | 8973bbfc665dec8136d132d5c20b547e08eb1924 /blenderkit/ui.py | |
parent | 39de263951fd080255305201dbfd6f6a862c671f (diff) |
BlenderKit: more small performance tweaks to the material thumbnailer.
also fix a small bug in ui drawing (this has to be fixed better - reading of 'thumbnail not ready' is now broken)
Diffstat (limited to 'blenderkit/ui.py')
-rw-r--r-- | blenderkit/ui.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/blenderkit/ui.py b/blenderkit/ui.py index bf2785ed..1bfd708f 100644 --- a/blenderkit/ui.py +++ b/blenderkit/ui.py @@ -796,7 +796,7 @@ def draw_callback_2d_search(self, context): index = a + ui_props.scrolloffset + b * ui_props.wcount iname = utils.previmg_name(index) img = bpy.data.images.get(iname) - if img is not None: + if img is not None and img.size[0]>0 and img.size[1]>0: w = int(ui_props.thumb_size * img.size[0] / max(img.size[0], img.size[1])) h = int(ui_props.thumb_size * img.size[1] / max(img.size[0], img.size[1])) crop = (0, 0, 1, 1) |