Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-12-16 03:07:01 +0300
committerJulian Eisel <julian@blender.org>2020-12-16 14:10:58 +0300
commit0ae15e68c78530843a670e2d57854e8aa12178d2 (patch)
tree732a8f809ccab4eb6afb8db8b733e2c145a58136
parent055ef5df615632f81e30e39ae47b42a87af350ca (diff)
Asset Browser: Allow renaming asset data-blocks from the sidebar directly
This is something we wanted to support doing. It's confusing if users see the name but it's always grayed out. So be convenient and avoid the confusion.
-rw-r--r--release/scripts/startup/bl_ui/space_filebrowser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 15e2e3d02e0..b6ca0639b4b 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -598,7 +598,8 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
box.template_icon(icon_value=active_file.preview_icon_id, scale=5.0)
if bpy.ops.ed.lib_id_load_custom_preview.poll():
box.operator("ed.lib_id_load_custom_preview", icon='FILEBROWSER', text="Load Custom")
- layout.prop(active_file, "name")
+ # If the active file is an ID, use its name directly so renaming is possible from right here.
+ layout.prop(context.id if not None else active_file, "name")
class ASSETBROWSER_PT_metadata_details(asset_utils.AssetBrowserPanel, Panel):