diff options
author | Vilem Duha <vilem.duha@gmail.com> | 2019-06-08 12:57:20 +0300 |
---|---|---|
committer | Vilem Duha <vilem.duha@gmail.com> | 2019-06-13 01:22:30 +0300 |
commit | 405b8c7dc9a1a4faa3eb6d9749f10ce53e9ff7c8 (patch) | |
tree | 055ebe1495bbe2da77115484646c41cb3df19a14 /blenderkit | |
parent | 6b0e1127ae295c0f3e041fb6ff5373fa6aab1056 (diff) |
BlenderKit: fix rating of sculpt brushes
Diffstat (limited to 'blenderkit')
-rw-r--r-- | blenderkit/ui.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/blenderkit/ui.py b/blenderkit/ui.py index 923cc9a7..59059e68 100644 --- a/blenderkit/ui.py +++ b/blenderkit/ui.py @@ -219,6 +219,7 @@ def get_rating_scalevalues(asset_type): xs.append(x) return scalevalues, xs + def draw_ratings_bgl(): # return; ui = bpy.context.scene.blenderkitUI @@ -993,16 +994,16 @@ def is_rating_possible(): def interact_rating(r, mx, my, event): ui = bpy.context.scene.blenderkitUI rating_possible, rated, asset, asset_data = is_rating_possible() - if rating_possible: bkit_ratings = asset.bkit_ratings t = time.time() - ui.last_rating_time - # if t>2: - # if rated: - # ui_props.rating_button_on = True - # ui_props.rating_menu_on = False - if ui.rating_button_on and event.type == 'LEFTMOUSE' and event.value == 'RELEASE': + if bpy.context.mode in ('SCULPT', 'PAINT_TEXTURE'): + accept_value = 'PRESS' + else: + accept_value = 'RELEASE' + + if ui.rating_button_on and event.type == 'LEFTMOUSE' and event.value == accept_value: if mouse_in_area(mx, my, ui.rating_x, ui.rating_y - ui.rating_button_width, |