[Bf-extensions-cvs] [7410d631] blender-v2.82-release: BlenderKit:

Vilém Duha noreply at git.blender.org
Tue Jan 28 13:49:36 CET 2020


Commit: 7410d631ce4ac4f3e53c1d634eb6b70499398371
Author: Vilém Duha
Date:   Fri Jan 24 19:43:06 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBA7410d631ce4ac4f3e53c1d634eb6b70499398371

BlenderKit:

-icons module
-clipboard monitoring
-fix link to website when people want to see asset online
-advanced search parameters

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

M	blenderkit/__init__.py
A	blenderkit/icons.py
M	blenderkit/paths.py
M	blenderkit/ratings.py
M	blenderkit/search.py
A	blenderkit/thumbnails/flp.png
A	blenderkit/thumbnails/fp.png
M	blenderkit/ui.py
M	blenderkit/ui_panels.py

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

diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py
index f8b31fec..fc2599a2 100644
--- a/blenderkit/__init__.py
+++ b/blenderkit/__init__.py
@@ -39,6 +39,7 @@ if "bpy" in locals():
     ratings = reload(ratings)
     autothumb = reload(autothumb)
     ui = reload(ui)
+    icons = reload(icons)
     bg_blender = reload(bg_blender)
     paths = reload(paths)
     utils = reload(utils)
@@ -48,7 +49,8 @@ if "bpy" in locals():
     bkit_oauth = reload(bkit_oauth)
     tasks_queue = reload(tasks_queue)
 else:
-    from blenderkit import asset_inspector, search, download, upload, ratings, autothumb, ui, bg_blender, paths, utils, \
+    from blenderkit import asset_inspector, search, download, upload, ratings, autothumb, ui, icons, bg_blender, paths, \
+        utils, \
         overrides, ui_panels, categories, bkit_oauth, tasks_queue
 
 import os
@@ -91,6 +93,7 @@ def scene_load(context):
     preferences = bpy.context.preferences.addons['blenderkit'].preferences
     preferences.login_attempt = False
 
+
 def check_timers_timer():
     ''' checks if all timers are registered regularly. Prevents possible bugs from stopping the addon.'''
     if not bpy.app.timers.is_registered(search.timer_update):
@@ -103,6 +106,7 @@ def check_timers_timer():
         bpy.app.timers.register(bg_blender.bg_update)
     return 5.0
 
+
 licenses = (
     ('royalty_free', 'Royalty Free', 'royalty free commercial license'),
     ('cc_zero', 'Creative Commons Zero', 'Creative Commons Zero'),
@@ -191,6 +195,7 @@ thumbnail_resolutions = (
     ('2048', '2048', ''),
 )
 
+
 def get_upload_asset_type(self):
     typemapper = {
         BlenderKitModelUploadProps: 'model',
@@ -244,9 +249,10 @@ def switch_search_results(self, context):
         s['search results orig'] = s.get('bkit brush search orig')
     search.load_previews()
 
+
 def asset_type_callback(self, context):
-    #s = bpy.context.scene
-    #ui_props = s.blenderkitUI
+    # s = bpy.context.scene
+    # ui_props = s.blenderkitUI
     if self.down_up == 'SEARCH':
         items = (
             ('MODEL', 'Find Models', 'Find models in the BlenderKit online database', 'OBJECT_DATAMODE', 0),
@@ -265,6 +271,7 @@ def asset_type_callback(self, context):
         )
     return items
 
+
 class BlenderKitUIProps(PropertyGroup):
     down_up: EnumProperty(
         name="Download vs Upload",
@@ -387,13 +394,35 @@ class BlenderKitCommonSearchProps(object):
     search_done: BoolProperty(name="Search Completed", description="at least one search did run (internal)",
                               default=False)
     own_only: BoolProperty(name="My Assets", description="Search only for your assets",
-                              default=False)
+                           default=False)
     search_error: BoolProperty(name="Search Error", description="last search had an error", default=False)
     report: StringProperty(
         name="Report",
         description="errors and messages",
         default="")
 
+    # TEXTURE RESOLUTION
+    search_texture_resolution: BoolProperty(name="Texture Resolution",
+                                            description="Span of the texture resolutions",
+                                            default=False,
+                                            update=search.search_update,
+                                            )
+    search_texture_resolution_min: IntProperty(name="Min Texture Resolution",
+                                               description="Minimum texture resolution",
+                                               default=256,
+                                               min=0,
+                                               max=32768,
+                                               update=search.search_update,
+                                               )
+
+    search_texture_resolution_max: IntProperty(name="Max Texture Resolution",
+                                               description="Maximum texture resolution",
+                                               default=4096,
+                                               min=0,
+                                               max=32768,
+                                               update=search.search_update,
+                                               )
+
 
 def name_update(self, context):
     ''' checks for name change, because it decides if whole asset has to be re-uploaded. Name is stored in the blend file
@@ -401,7 +430,6 @@ def name_update(self, context):
     utils.name_update()
 
 
-
 def update_tags(self, context):
     props = utils.get_upload_props()
 
@@ -426,6 +454,7 @@ def update_tags(self, context):
     if props.tags != ns:
         props.tags = ns
 
+
 def update_free(self, context):
     if self.is_free == False:
         self.is_free = True
@@ -440,6 +469,7 @@ def update_free(self, context):
 
         bpy.context.window_manager.popup_menu(draw_message, title=title, icon='INFO')
 
+
 class BlenderKitCommonUploadProps(object):
     id: StringProperty(
         name="Asset Version Id",
@@ -506,9 +536,9 @@ class BlenderKitCommonUploadProps(object):
     )
 
     is_procedural: BoolProperty(name="Procedural",
-                          description="Asset is procedural - has no texture.",
-                          default=True
-                          )
+                                description="Asset is procedural - has no texture.",
+                                default=True
+                                )
     node_count: IntProperty(name="Node count", description="Total nodes in the asset", default=0)
     texture_count: IntProperty(name="Texture count", description="Total texture count in asset", default=0)
     total_megapixels: IntProperty(name="Megapixels", description="Total megapixels of texture", default=0)
@@ -593,22 +623,26 @@ class BlenderKitMaterialSearchProps(PropertyGroup, BlenderKitCommonSearchProps):
         items=search_material_styles,
         description="Style of material",
         default="ANY",
+        update=search.search_update,
     )
     search_style_other: StringProperty(
         name="Style Other",
         description="Style not in the list",
         default="",
+        update=search.search_update,
     )
     search_engine: EnumProperty(
         name='Engine',
         items=engines,
         default='NONE',
         description='Output engine',
+        update=search.search_update,
     )
     search_engine_other: StringProperty(
         name="Engine",
         description="engine not specified by addon",
         default="",
+        update=search.search_update,
     )
     automap: BoolProperty(name="Auto-Map",
                           description="reset object texture space and also add automatically a cube mapped UV "
@@ -1147,10 +1181,10 @@ class BlenderKitModelSearchProps(PropertyGroup, BlenderKitCommonSearchProps):
     )
 
     free_only: BoolProperty(name="Free only", description="Show only free models",
-                            default=False)
+                            default=False,update=search.search_update)
 
     search_advanced: BoolProperty(name="Advanced Search Options", description="use advanced search properties",
-                                  default=False)
+                                  default=False,update=search.search_update)
 
     # CONDITION
     search_condition: EnumProperty(
@@ -1169,9 +1203,9 @@ class BlenderKitModelSearchProps(PropertyGroup, BlenderKitCommonSearchProps):
 
     search_procedural: EnumProperty(
         items=(
-            ('BOTH', 'Both',''),
-            ('PROCEDURAL', 'Procedural',''),
-            ('TEXTURE_BASED', 'Texture based',''),
+            ('BOTH', 'Both', ''),
+            ('PROCEDURAL', 'Procedural', ''),
+            ('TEXTURE_BASED', 'Texture based', ''),
 
         ),
         default='BOTH',
@@ -1182,51 +1216,47 @@ class BlenderKitModelSearchProps(PropertyGroup, BlenderKitCommonSearchProps):
     # DESIGN YEAR
     search_design_year: BoolProperty(name="Sesigned in Year",
                                      description="when the object was approximately designed",
-                                     default=False)
+                                     default=False,
+                                     update=search.search_update,
+                                     )
 
     search_design_year_min: IntProperty(name="Min Age",
                                         description="when the object was approximately designed",
-                                        default=1950, min=-100000000, max=1000000000)
+                                        default=1950, min=-100000000, max=1000000000,
+                                        update=search.search_update,
+                                        )
 
     search_design_year_max: IntProperty(name="Max Age",
                                         description="when the object was approximately designed",
                                         default=2017,
                                         min=0,
-                                        max=10000000)
+                                        max=10000000,
+                                        update=search.search_update,
+                                        )
 
-    # TEXTURE RESOLUTION
-    search_texture_resolution: BoolProperty(name="Texture Resolution",
-                                            description="Span of the texture resolutions",
-                                            default=False)
 
-    search_texture_resolution_min: IntProperty(name="Min Texture Resolution",
-                                               description="when the object was approximately designed",
-                                               default=256,
-                                               min=0,
-                                               max=32768)
 
-    search_texture_resolution_max: IntProperty(name="Max Texture Resolution",
-                                               description="when the object was approximately designed",
-                                               default=4096,
-                                               min=0,
-                             

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list