From d4d32b373158a3614a6d4546ebb684fbb73b4d27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@blender.org>
Date: Thu, 30 Mar 2023 11:15:36 +0200
Subject: [PATCH] Pose library: fix context menu

The Pose Library context menu was broken in the 3D Viewport's template
view by a958ae36e8cbe687c77f77b375a2dd21c01d271d.

That commit removed `asset_handle` from the context, and added
`active_file`, so now the pose library context menu code uses that instead.
---
 pose_library/gui.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pose_library/gui.py b/pose_library/gui.py
index c5b5747ec..a7be26adb 100644
--- a/pose_library/gui.py
+++ b/pose_library/gui.py
@@ -62,7 +62,7 @@ def pose_library_list_item_context_menu(self: UIList, context: Context) -> None:
         list = getattr(context, "ui_list", None)
         if not list or list.bl_idname != "UI_UL_asset_view" or list.list_id != "pose_assets":
             return False
-        if not context.asset_handle:
+        if not context.active_file:
             return False
         return True
 
-- 
GitLab