diff options
Diffstat (limited to 'blenderkit/search.py')
-rw-r--r-- | blenderkit/search.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py index e81e456e..56c8b526 100644 --- a/blenderkit/search.py +++ b/blenderkit/search.py @@ -597,7 +597,7 @@ def fetch_author(a_id, api_key): f.write(r.content) adata['gravatarImg'] = gravatar_path elif r.status_code == '404': - adata['gravatarHash']= None + adata['gravatarHash'] = None except Exception as e: utils.p(e) utils.p('finish fetch') @@ -723,7 +723,6 @@ class Searcher(threading.Thread): else: requeststring += '+order:_score' - requeststring += '&addon_version=%s' % params['addon_version'] if params.get('scene_uuid') is not None: requeststring += '&scene_uuid=%s' % params['scene_uuid'] @@ -1101,6 +1100,7 @@ class SearchOperator(Operator): own: BoolProperty(name="own assets only", description="Find all own assets", default=False) + category: StringProperty( name="category", description="search only subtree of this category", @@ -1115,13 +1115,26 @@ class SearchOperator(Operator): description="get next page from previous search", default=False) + keywords = StringProperty( + name="Keywords", + description="Keywords", + default="") + @classmethod def poll(cls, context): return True def execute(self, context): - search(own=self.own, category=self.category, get_next=self.get_next, author_id=self.author_id) - bpy.ops.view3d.blenderkit_asset_bar() + # TODO ; this should all get transferred to properties of the search operator, so sprops don't have to be fetched here at all. + sprops = utils.get_search_props() + if self.author_id != '': + sprops.search_keywords = '' + if self.keywords != '': + sprops.search_keywords = self.keywords + + + search(category=self.category, get_next=self.get_next, author_id=self.author_id) + #bpy.ops.view3d.blenderkit_asset_bar() return {'FINISHED'} |