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>2020-07-01 19:24:37 +0300
committerVilém Duha <vilda.novak@gmail.com>2020-07-12 19:07:58 +0300
commit943d41d4438623e992b3c6919a2bb5a2b6818ff9 (patch)
treec29b77ea26777bec0e6f9671c892bd11124077f4 /blenderkit
parent48c8d6c23010fc73d62f44e366901f08680d08da (diff)
BlenderKit: fix search by author verification status
fix ratings drawing for not logged in users fix ratings update function(was reacting to quality rating)
Diffstat (limited to 'blenderkit')
-rw-r--r--blenderkit/__init__.py3
-rw-r--r--blenderkit/ratings.py2
-rw-r--r--blenderkit/ui.py2
-rw-r--r--blenderkit/ui_panels.py10
4 files changed, 11 insertions, 6 deletions
diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py
index 449e65a4..d511bbf8 100644
--- a/blenderkit/__init__.py
+++ b/blenderkit/__init__.py
@@ -481,6 +481,7 @@ class BlenderKitCommonSearchProps(object):
('DELETED', 'Deleted', 'Deleted'),
),
default='ALL',
+ update=search.search_update,
)
@@ -655,7 +656,7 @@ class BlenderKitRatingProps(PropertyGroup):
rating_work_hours: FloatProperty(name="Work Hours",
description="How many hours did this work take?",
- default=0.01,
+ default=0.00,
min=0.0, max=1000, update=ratings.update_ratings_work_hours
)
rating_complexity: IntProperty(name="Complexity",
diff --git a/blenderkit/ratings.py b/blenderkit/ratings.py
index 38dbbaf8..dbe8b8eb 100644
--- a/blenderkit/ratings.py
+++ b/blenderkit/ratings.py
@@ -128,7 +128,7 @@ def update_ratings_work_hours(self, context):
bkit_ratings = asset.bkit_ratings
url = paths.get_api_url() + 'assets/' + asset['asset_data']['id'] + '/rating/'
- if bkit_ratings.rating_quality > 0.1:
+ if bkit_ratings.rating_work_hours > 0.05:
ratings = [('working_hours', round(bkit_ratings.rating_work_hours, 1))]
tasks_queue.add_task((send_rating_to_thread_work_hours, (url, ratings, headers)), wait=1, only_last=True)
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index f56dad77..0a6b96a8 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -1688,10 +1688,12 @@ class AssetBarOperator(bpy.types.Operator):
if a is not None:
sprops = utils.get_search_props()
sprops.search_keywords = ''
+ sprops.search_verification_status = 'ALL'
utils.p('author:', a)
search.search(author_id=a)
return {'RUNNING_MODAL'}
if event.type == 'X' and ui_props.active_index > -1:
+ # delete downloaded files for this asset
sr = bpy.context.scene['search results']
asset_data = sr[ui_props.active_index]
print(asset_data['name'])
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py
index 4efe732f..7de2a240 100644
--- a/blenderkit/ui_panels.py
+++ b/blenderkit/ui_panels.py
@@ -74,15 +74,16 @@ def draw_ratings(layout, context):
if asset == None:
return;
+ col = layout.column()
if not utils.user_logged_in():
label_multiline(layout, text='Please login or sign up '
'to rate assets.')
- return
+ col.enabled = False
bkit_ratings = asset.bkit_ratings
- ratings.draw_rating(layout, bkit_ratings, 'rating_quality', 'Quality')
- layout.separator()
- layout.prop(bkit_ratings, 'rating_work_hours')
+ ratings.draw_rating(col, bkit_ratings, 'rating_quality', 'Quality')
+ col.separator()
+ col.prop(bkit_ratings, 'rating_work_hours')
w = context.region.width
# layout.label(text='problems')
@@ -93,6 +94,7 @@ def draw_ratings(layout, context):
# row = layout.row()
# op = row.operator("object.blenderkit_rating_upload", text="Send rating", icon='URL')
# return op
+ #re-enable layout if included in longer panel
def draw_not_logged_in(source):