Blender  V3.3
Functions
ED_asset_library.h File Reference
#include "DNA_asset_types.h"

Go to the source code of this file.

Functions

int ED_asset_library_reference_to_enum_value (const AssetLibraryReference *library)
 
AssetLibraryReference ED_asset_library_reference_from_enum_value (int value)
 
const struct EnumPropertyItemED_asset_library_reference_to_rna_enum_itemf (bool include_local_library)
 

Function Documentation

◆ ED_asset_library_reference_from_enum_value()

AssetLibraryReference ED_asset_library_reference_from_enum_value ( int  value)

◆ ED_asset_library_reference_to_enum_value()

int ED_asset_library_reference_to_enum_value ( const AssetLibraryReference library)

Return an index that can be used to uniquely identify library, assuming that all relevant indices were created with this function.

Definition at line 24 of file asset_library_reference_enum.cc.

References ASSET_LIBRARY_CUSTOM, ASSET_LIBRARY_LOCAL, BKE_preferences_asset_library_find_from_index(), and library.

Referenced by ED_asset_library_reference_to_rna_enum_itemf().

◆ ED_asset_library_reference_to_rna_enum_itemf()

const struct EnumPropertyItem* ED_asset_library_reference_to_rna_enum_itemf ( bool  include_local_library)

Translate all available asset libraries to an RNA enum, whereby the enum values match the result of ED_asset_library_reference_to_enum_value() for any given library.

Since this is meant for UI display, skips non-displayable libraries, that is, libraries with an empty name or path.

Parameters
include_local_libraryWhether to include the "Current File" library or not.

Definition at line 73 of file asset_library_reference_enum.cc.

References ASSET_LIBRARY_CUSTOM, ASSET_LIBRARY_LOCAL, BLI_listbase_is_empty(), AssetLibraryReference::custom_library_index, ED_asset_library_reference_to_enum_value(), is_valid, EnumPropertyItem::name, bUserAssetLibrary::next, RNA_enum_item_add(), RNA_enum_item_add_separator(), RNA_enum_item_end(), RNA_enum_items_add(), and AssetLibraryReference::type.

Referenced by rna_asset_library_reference_itemf().