[Bf-extensions-cvs] [405b8c7d] master: BlenderKit: fix rating of sculpt brushes

Vilem Duha noreply at git.blender.org
Thu Jun 13 00:23:13 CEST 2019


Commit: 405b8c7dc9a1a4faa3eb6d9749f10ce53e9ff7c8
Author: Vilem Duha
Date:   Sat Jun 8 11:57:20 2019 +0200
Branches: master
https://developer.blender.org/rBA405b8c7dc9a1a4faa3eb6d9749f10ce53e9ff7c8

BlenderKit: fix rating of sculpt brushes

===================================================================

M	blenderkit/ui.py

===================================================================

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,



More information about the Bf-extensions-cvs mailing list