Assets: hide low-level catalog info behind "developer extra's"

Hide the catalog UUID and the catalog simple name from the Asset Browser
side-panel, unless "Developer Extra's" is enabled in the user prefs.
This commit is contained in:
Sybren A. Stüvel
2021-10-12 12:17:42 +02:00
parent cc04399937
commit b67a937394

View File

@@ -658,25 +658,29 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
asset_library_ref = context.asset_library_ref asset_library_ref = context.asset_library_ref
asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library_ref) asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library_ref)
show_developer_ui = context.preferences.view.show_developer_ui
if asset_file_handle.local_id: if asset_file_handle.local_id:
# If the active file is an ID, use its name directly so renaming is possible from right here. # If the active file is an ID, use its name directly so renaming is possible from right here.
layout.prop(asset_file_handle.local_id, "name", text="") layout.prop(asset_file_handle.local_id, "name", text="")
col = layout.column(align=True) if show_developer_ui:
col.label(text="Asset Catalog:") col = layout.column(align=True)
col.prop(asset_file_handle.local_id.asset_data, "catalog_id", text="UUID") col.label(text="Asset Catalog:")
col.prop(asset_file_handle.local_id.asset_data, "catalog_simple_name", text="Simple Name") col.prop(asset_file_handle.local_id.asset_data, "catalog_id", text="UUID")
col.prop(asset_file_handle.local_id.asset_data, "catalog_simple_name", text="Simple Name")
row = layout.row() row = layout.row()
row.label(text="Source: Current File") row.label(text="Source: Current File")
else: else:
layout.prop(asset_file_handle, "name", text="") layout.prop(asset_file_handle, "name", text="")
col = layout.column(align=True) if show_developer_ui:
col.enabled = False col = layout.column(align=True)
col.label(text="Asset Catalog:") col.enabled = False
col.prop(asset_file_handle.asset_data, "catalog_id", text="UUID") col.label(text="Asset Catalog:")
col.prop(asset_file_handle.asset_data, "catalog_simple_name", text="Simple Name") col.prop(asset_file_handle.asset_data, "catalog_id", text="UUID")
col.prop(asset_file_handle.asset_data, "catalog_simple_name", text="Simple Name")
col = layout.column(align=True) # Just to reduce margin. col = layout.column(align=True) # Just to reduce margin.
col.label(text="Source:") col.label(text="Source:")