2025-12-01
This commit is contained in:
@@ -118,7 +118,9 @@ def show_quick_menu(
|
||||
_imported_model_extras(context, layout)
|
||||
|
||||
# List the different resolution sizes to provide.
|
||||
if asset_data.is_purchased or is_free or cTB.is_unlimited_user():
|
||||
have_size_opts = asset_data.is_purchased or is_free or cTB.is_unlimited_user()
|
||||
have_size_opts &= not asset_data.state.has_error
|
||||
if have_size_opts:
|
||||
for size in sizes:
|
||||
if asset_type == AssetType.TEXTURE:
|
||||
draw_material_sizes(context, size, layout)
|
||||
@@ -152,22 +154,20 @@ def show_quick_menu(
|
||||
|
||||
# Always show view online and high res previews.
|
||||
if not hide_detail_view:
|
||||
# new detail viewer design is unstable on OSX and fails for awhile
|
||||
# for the remainder of the session. For consistency, we disable it
|
||||
# outright for all OSX users until a better solution is found.
|
||||
is_osx = bpy.app.build_platform.lower() == b"darwin"
|
||||
if bpy.app.version >= (4, 2) and not is_osx:
|
||||
op_name = "poliigon.detail_view_open"
|
||||
op_text = _t("View Asset Details")
|
||||
if bpy.app.version >= (4, 2):
|
||||
row_detail_view = layout.row()
|
||||
row_detail_view.operator_context = 'INVOKE_DEFAULT'
|
||||
op = row_detail_view.operator(
|
||||
"poliigon.detail_view",
|
||||
text=_t("View Asset Details"),
|
||||
icon="OUTLINER_OB_IMAGE",
|
||||
)
|
||||
else:
|
||||
op_name = "poliigon.view_thumbnail"
|
||||
op_text = _t("View Large Preview")
|
||||
|
||||
op = layout.operator(
|
||||
op_name,
|
||||
text=op_text,
|
||||
icon="OUTLINER_OB_IMAGE",
|
||||
)
|
||||
op = layout.operator(
|
||||
"poliigon.view_thumbnail",
|
||||
text=_t("View Large Preview"),
|
||||
icon="OUTLINER_OB_IMAGE",
|
||||
)
|
||||
op.asset_id = asset_data.asset_id
|
||||
|
||||
op = layout.operator(
|
||||
@@ -197,15 +197,26 @@ def show_quick_menu(
|
||||
if not is_feature_avail or missing_local_model:
|
||||
return
|
||||
|
||||
# Asset browser sync option
|
||||
client_starting = cTB.lock_client_start.locked()
|
||||
owned = cTB.check_if_purchased(asset_data.asset_id)
|
||||
layout.separator()
|
||||
row = layout.row()
|
||||
op = row.operator(
|
||||
"poliigon.update_asset_browser",
|
||||
text=_t("Synchronize with Asset Browser"),
|
||||
icon="FILE_REFRESH")
|
||||
op.asset_id = asset_id
|
||||
row.enabled = not in_asset_browser and not client_starting
|
||||
msg = _t("Synchronize with Asset Browser")
|
||||
if not owned:
|
||||
msg = _t("Must own to sync with Asset Browser")
|
||||
elif in_asset_browser:
|
||||
msg = _t("Already synced with Asset Browser")
|
||||
elif client_starting:
|
||||
msg = _t("Starting Asset Browser sync...")
|
||||
|
||||
if cTB.user_legacy_own_assets():
|
||||
op = row.operator(
|
||||
"poliigon.update_asset_browser",
|
||||
text=msg,
|
||||
icon="FILE_REFRESH")
|
||||
op.asset_id = asset_id
|
||||
row.enabled = not in_asset_browser and not client_starting and owned
|
||||
|
||||
def draw_material_sizes(
|
||||
context, size: str, layout: bpy.types.UILayout) -> None:
|
||||
|
||||
Reference in New Issue
Block a user