diff options
author | Vilém Duha <vilda.novak@gmail.com> | 2020-12-06 20:21:06 +0300 |
---|---|---|
committer | Vilém Duha <vilda.novak@gmail.com> | 2020-12-06 20:21:06 +0300 |
commit | c61ff213d6df5b89f53767d5b5a4b26075c04360 (patch) | |
tree | 4efd66895a1795f4d8b04269ce5ab357862593e1 /blenderkit | |
parent | 89a2b70bdd06807403fdcba1c7e4504a797c2e02 (diff) |
BlenderKit: allow search of non-rated assets
Diffstat (limited to 'blenderkit')
-rw-r--r-- | blenderkit/__init__.py | 3 | ||||
-rw-r--r-- | blenderkit/search.py | 4 | ||||
-rw-r--r-- | blenderkit/ui.py | 2 | ||||
-rw-r--r-- | blenderkit/ui_panels.py | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py index d38f185b..134f2a9b 100644 --- a/blenderkit/__init__.py +++ b/blenderkit/__init__.py @@ -1271,6 +1271,9 @@ class BlenderKitModelSearchProps(PropertyGroup, BlenderKitCommonSearchProps): free_only: BoolProperty(name="Free only", description="Show only free models", default=False, update=search.search_update) + unrated_only: BoolProperty(name="Unrated only", description="Show only unrated models", + default=False, update=search.search_update) + # CONDITION search_condition: EnumProperty( items=conditions, diff --git a/blenderkit/search.py b/blenderkit/search.py index c90bacf6..c04d5705 100644 --- a/blenderkit/search.py +++ b/blenderkit/search.py @@ -1071,6 +1071,9 @@ def build_query_common(query, props): if props.search_verification_status != 'ALL': query_common['verification_status'] = props.search_verification_status.lower() + if props.unrated_only: + query["quality_count"] = 0 + if props.search_file_size: query_common["files_size_gte"] = props.search_file_size_min * 1024 * 1024 query_common["files_size_lte"] = props.search_file_size_max * 1024 * 1024 @@ -1096,6 +1099,7 @@ def build_query_model(): if props.free_only: query["is_free"] = True + # if props.search_advanced: if props.search_condition != 'UNSPECIFIED': query["condition"] = props.search_condition diff --git a/blenderkit/ui.py b/blenderkit/ui.py index 71e4b06f..fdba3971 100644 --- a/blenderkit/ui.py +++ b/blenderkit/ui.py @@ -776,7 +776,7 @@ def draw_callback_2d_search(self, context): # 1, # img, # 1) - if not ui_props.dragging and ui_props.hcount > 0: + if not ui_props.dragging and ui_props.hcount > 0 and ui_props.wcount>0: search_results = s.get('search results') search_results_orig = s.get('search results orig') if search_results == None: diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py index b7c9884c..60e749e5 100644 --- a/blenderkit/ui_panels.py +++ b/blenderkit/ui_panels.py @@ -946,6 +946,8 @@ class VIEW3D_PT_blenderkit_unified(Panel): if utils.profile_is_validator(): search_props = utils.get_search_props() layout.prop(search_props, 'search_verification_status') + layout.prop(search_props, "unrated_only") + if ui_props.asset_type == 'MODEL': # noinspection PyCallByClass draw_panel_model_search(self, context) |