Skip to main content
1 of 2

Asset browser python filter

I am writing an addon where I need to show to the user all the objects in a specific blend file.

The best option for this is of course the asset browser, but the blend file is in a folder with other blend files, and all of them have objects marked as assets.

I know I can use tags to filter out the unwanted assets, but with the python API, there seem to be no way at all to filter anything with the asset browser but the type of datablock. There is a way to show the filter field to the user, but no apparent way to edit it's content.

I tried to take a look in the collections given to the template_asset_view, but I am either not skilled enough or can't see a way to put a filter there since it seems that the collections are filled on runtime, and I don't know how to filter them properly.

The one and only relevent reference to the asset browser I could find in the documentation is this: https://docs.blender.org/api/current/bpy.types.UILayout.html?highlight=asset#bpy.types.UILayout.template_asset_view