diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py index 2734ad69b58e93d9cfbd08f6f283091c968f93b2..5409a4411ce8d184ec068ffd9f7511d81b5991bf 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 b445916786e9d173e9e51bc652d6c25062caadc8..9923610fa9000deb118e5ee800cab0b25880d91c 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 0e8b0744a715ca0c156c3349133406df5449a009..8db62433defae708ca9e7671782a782c3d99e2f7 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 24d64cb3b0d274acb80278a46e8fa0a153704024..44bd4d2efdba53379055ac1b870422ee3f2ede2a 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':