Refactor: Get asset data via asset representation, not file

The "active_file" context member as a way to get the active asset should be
avoided, in favor of "asset". This moves us away from the file browser backend
as basis of the asset system,
This commit is contained in:
Julian Eisel
2024-05-29 13:47:28 +02:00
parent 9ca5289bc1
commit a6ed013baa
3 changed files with 4 additions and 8 deletions

View File

@@ -25,11 +25,6 @@ class SpaceAssetInfo:
def is_asset_browser_poll(cls, context: Context):
return cls.is_asset_browser(context.space_data)
@classmethod
def get_active_asset(cls, context: Context):
if active_file := getattr(context, "active_file", None):
return active_file.asset_data
class AssetBrowserPanel:
bl_space_type = 'FILE_BROWSER'