Skip to content
Snippets Groups Projects
Commit d7f05ada authored by Vilém Duha's avatar Vilém Duha
Browse files

BlenderKit: fix ratings

-rating was virtually possible even if not logged in, but in reality the user couldn't rate on server.
-ratings were sent far too often to server thanks to an extra call.
parent d348bde0
No related branches found
No related tags found
No related merge requests found
......@@ -990,6 +990,10 @@ def floor_raycast(context, mx, my):
def is_rating_possible():
ao = bpy.context.active_object
ui = bpy.context.scene.blenderkitUI
preferences = bpy.context.preferences.addons['blenderkit'].preferences
#first test if user is logged in.
if preferences.api_key == '':
return False, False, None, None
if bpy.context.scene.get('assets rated') is not None and ui.down_up == 'SEARCH':
if bpy.context.mode in ('SCULPT', 'PAINT_TEXTURE'):
b = utils.get_active_brush()
......@@ -1096,9 +1100,7 @@ def interact_rating(r, mx, my, event):
bkit_ratings.rating_work_hours = wh
if event.type == 'LEFTMOUSE' and event.value == 'RELEASE':
if bkit_ratings.rating_quality > 0.1 or bkit_ratings.rating_work_hours > 0.1:
ratings.upload_rating(asset)
ui.last_rating_time = time.time()
ui.last_rating_time = time.time() # this prop seems obsolete now?
return True
else:
ui.rating_button_on = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment