Asset shelf: Use asset representation for asset shelf BPY methods

Changes the `asset_poll()` and `draw_context_menu()` methods for asset
shelves to use the `AssetRepresentation` type, instead of `AssetHandle`.
The latter should be removed, so it's better to avoid using it in the
asset shelf BPY to avoid future compatibility breakage. This is possible
now with d421ebac5e.
This commit is contained in:
Julian Eisel
2023-09-15 16:17:44 +02:00
parent d421ebac5e
commit 728d47f3e4
10 changed files with 38 additions and 23 deletions

View File

@@ -11,7 +11,7 @@ class MyAssetShelf(bpy.types.AssetShelf):
@classmethod
def asset_poll(cls, asset):
return asset.file_data.id_type in {'MATERIAL', 'OBJECT'}
return asset.id_type in {'MATERIAL', 'OBJECT'}
def register():