Blender  V3.3
Functions
ED_asset_filter.h File Reference

Go to the source code of this file.

Functions

bool ED_asset_filter_matches_asset (const struct AssetFilterSettings *filter, const struct AssetHandle *asset)
 

Detailed Description

Functions for filtering assets.

Definition in file ED_asset_filter.h.

Function Documentation

◆ ED_asset_filter_matches_asset()

bool ED_asset_filter_matches_asset ( const struct AssetFilterSettings filter,
const struct AssetHandle asset 
)

Compare asset against the settings of filter.

Individual filter parameters are ORed with the asset properties. That means:

  • The asset type must be one of the ID types filtered by, and
  • The asset must contain at least one of the tags filtered by. However for an asset to be matching it must have one match in each of the parameters. I.e. one matching type and at least one matching tag.
Returns
True if the asset should be visible with these filter settings (parameters match). Otherwise returns false (mismatch).

Referenced by asset_view_template_refresh_asset_collection().