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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-10-07 18:39:03 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-07 18:39:12 +0300
commitd920e6a3785f054ee306ba7712cd0cdafc3e02ce (patch)
tree3b251c960065e9710788d24921eb6f9d31b40d85 /pose_library
parente9f83053149def0f561ca5769f8bc4f5bc335247 (diff)
Pose Library: do a broader search for the asset browser
When creating a pose, it gets assigned to the catalog that is currently shown in the asset browser. To find which asset browser to use for this, if the current window does not contain one, other windows are considered as well. Before this change this was limited to the current screen.
Diffstat (limited to 'pose_library')
-rw-r--r--pose_library/asset_browser.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/pose_library/asset_browser.py b/pose_library/asset_browser.py
index 036a271b..a95e48fe 100644
--- a/pose_library/asset_browser.py
+++ b/pose_library/asset_browser.py
@@ -53,7 +53,19 @@ def area_from_context(context: bpy.types.Context) -> Optional[bpy.types.Area]:
if asset_utils.SpaceAssetInfo.is_asset_browser(space_data):
return context.area
- return biggest_asset_browser_area(context.screen)
+ # Try the current screen first.
+ browser_area = biggest_asset_browser_area(context.screen)
+ if browser_area:
+ return browser_area
+
+ for win in context.window_manager.windows:
+ if win.screen == context.screen:
+ continue
+ browser_area = biggest_asset_browser_area(win.screen)
+ if browser_area:
+ return browser_area
+
+ return None
def activate_asset(