[Bf-extensions-cvs] [65da3f00] master: BlenderKit: minor UI fixes and improvements

Vilém Duha noreply at git.blender.org
Thu Jan 9 17:29:26 CET 2020


Commit: 65da3f00f788c84db770f3d77bc1d09964f161ec
Author: Vilém Duha
Date:   Thu Jan 9 17:28:57 2020 +0100
Branches: master
https://developer.blender.org/rBA65da3f00f788c84db770f3d77bc1d09964f161ec

BlenderKit: minor UI fixes and improvements

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

M	blenderkit/__init__.py
M	blenderkit/search.py
M	blenderkit/ui.py
M	blenderkit/ui_panels.py

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

diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py
index 2734ad69..5409a441 100644
--- a/blenderkit/__init__.py
+++ b/blenderkit/__init__.py
@@ -277,7 +277,7 @@ class BlenderKitUIProps(PropertyGroup):
         default="SEARCH",
     )
     asset_type: EnumProperty(
-        name="Active Asset Type",
+        name="BlenderKit Active Asset Type",
         items=asset_type_callback,
         description="Activate asset in UI",
         default=None,
diff --git a/blenderkit/search.py b/blenderkit/search.py
index b4459167..9923610f 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -260,7 +260,7 @@ def timer_update():  # TODO might get moved to handle all blenderkit stuff.
                     ui_props.scrolloffset = 0
                 props.is_searching = False
                 props.search_error = False
-                props.report = 'Open assetbar to see %i results. ' % len(s['search results'])
+                props.report = 'Found %i results. ' % (s['search results orig']['count'])
                 if len(s['search results']) == 0:
                     tasks_queue.add_task((ui.add_report, ('No matching results found.',)))
 
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index 0e8b0744..8db62433 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -1290,7 +1290,7 @@ class AssetBarOperator(bpy.types.Operator):
                 ao = bpy.context.active_object
                 if ui_props.asset_type == 'MODEL' and ao != None \
                         or ui_props.asset_type == 'MATERIAL' and ao != None and ao.active_material != None \
-                        or ui_props.asset_type == 'BRUSH':
+                        or ui_props.asset_type == 'BRUSH' and utils.get_active_brush() is not None:
                     export_data, upload_data, eval_path_computing, eval_path_state, eval_path, props = upload.get_upload_data(
                         self,
                         context,
diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py
index 24d64cb3..44bd4d2e 100644
--- a/blenderkit/ui_panels.py
+++ b/blenderkit/ui_panels.py
@@ -150,7 +150,9 @@ def prop_needed(layout, props, name, value, is_not_filled=''):
     if value == is_not_filled:
         # row.label(text='', icon = 'ERROR')
         icon = 'ERROR'
-        row.prop(props, name, icon=icon)
+        row.alert = True
+        row.prop(props, name)#, icon=icon)
+        row.alert = False
     else:
         # row.label(text='', icon = 'FILE_TICK')
         icon = None
@@ -614,15 +616,21 @@ class VIEW3D_PT_blenderkit_unified(Panel):
         layout = self.layout
 
         # layout.prop_tabs_enum(ui_props, "asset_type", icon_only = True)
+
         row = layout.row()
-        row.scale_x = 1.6
-        row.scale_y = 1.6
+        #row.scale_x = 1.6
+        #row.scale_y = 1.6
         #
         row.prop(ui_props, 'down_up', expand=True, icon_only=False)
         # row.label(text='')
         #row = row.split().row()
-
-        layout.prop(ui_props, 'asset_type', expand=False, text = '', icon_only=False)
+        #layout.alert = True
+        #layout.alignment = 'CENTER'
+        #row = layout.row(align = True)
+        #split = row.split(factor=.5)
+        #row.prop(ui_props, 'asset_type', expand=True, icon_only=True)
+        #row = layout.column(align = False)
+        layout.prop(ui_props, 'asset_type', expand=False, text = '')
 
         w = context.region.width
         if user_preferences.login_attempt:
@@ -640,7 +648,9 @@ class VIEW3D_PT_blenderkit_unified(Panel):
                 layout.prop(user_preferences, 'api_key', text='')
             layout.separator()
         if bpy.data.filepath == '':
-            label_multiline(layout, text="It's better to save the file first.", width=w)
+            layout.alert = True
+            label_multiline(layout, text="It's better to save your file first.", width=w)
+            layout.alert = False
             layout.separator()
 
         if ui_props.down_up == 'SEARCH':



More information about the Bf-extensions-cvs mailing list