Skip to content
Snippets Groups Projects
Commit d920e6a3 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

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.
parent e9f83053
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment