Assets: Allow downloading asset with already downloaded asset active

When selecting multiple assets, the "Download Assets" entry in the
context menu was only visible if the right-clicked on asset was not
downloaded yet. The operator downloads all selected assets if needed, so
it should instead be in the context menu when any of the selected assets
is online. Regardless of which one the context menu was spawned from.

The operator poll already does this correctly, the Python UI definition
was based on the active asset only. Instead of duplicating logic, use
the operator poll to decide if the operator should be visible in the
context menu.
This commit is contained in:
Julian Eisel 2026-04-21 16:47:04 +02:00
parent d6ec967599
commit c856aed5a7

View file

@ -866,9 +866,8 @@ class ASSETBROWSER_MT_context_menu(AssetBrowserMenu, Menu):
layout = self.layout
st = context.space_data
params = st.params
asset = context.asset
if asset and asset.is_online:
if bpy.ops.asset.assets_download.poll():
layout.operator("asset.assets_download")
layout.separator()