Blender V5.3
blender::asset_system::RemoteAssetLibrary Class Reference

#include <remote_library.hh>

Inherits blender::asset_system::AssetLibrary.

Inherited by blender::asset_system::OnlineEssentialsLibrary, and blender::asset_system::PreferencesRemoteAssetLibrary.

Public Member Functions

Remote Library Base Class
 RemoteAssetLibrary (eAssetLibraryType library_type, bool is_read_only, StringRef remote_url, StringRef name, StringRef root_path)
void force_remote_listing_download () const override
std::optional< eAssetImportMethod > import_method () const override
std::optional< StringRefNull > remote_url () const override
void refresh_catalogs () override
Public Member Functions inherited from blender::asset_system::AssetLibrary
 AssetLibrary (eAssetLibraryType library_type, bool is_read_only, StringRef name="", StringRef root_path="")
virtual ~AssetLibrary ()
virtual std::optional< AssetLibraryReference > library_reference () const =0
virtual const bUserAssetLibrary * user_asset_library () const
virtual bool use_relative_paths () const
virtual std::optional< StringRefNull > auth_token () const
AssetCatalogService & catalog_service () const
std::shared_ptr< AssetCatalogService > catalog_service_ptr () const
std::weak_ptr< AssetRepresentation > add_external_on_disk_asset (StringRef relative_asset_path, StringRef name, int id_type, std::unique_ptr< AssetMetaData > metadata)
std::weak_ptr< AssetRepresentation > add_external_online_asset (StringRef relative_asset_path, StringRef name, int id_type, std::unique_ptr< AssetMetaData > metadata, OnlineAssetInfo online_info)
std::weak_ptr< AssetRepresentation > add_local_id_asset (ID &id)
bool remove_asset (AssetRepresentation &asset)
void remap_ids_and_remove_invalid (const bke::id::IDRemapper &mappings)
void refresh_catalog_simplename (AssetMetaData *asset_data)
void load_or_reload_catalogs ()
void on_blend_save_handler_register ()
void on_blend_save_handler_unregister ()
void on_blend_save_post (Main *bmain, PointerRNA **pointers, int num_pointers)
std::string resolve_asset_weak_reference_to_full_path (const AssetWeakReference &asset_reference)
eAssetLibraryType library_type () const
StringRefNull name () const
StringRefNull root_path () const
bool is_read_only () const

Additional Inherited Members

Static Public Member Functions inherited from blender::asset_system::AssetLibrary
static void foreach_loaded (FunctionRef< void(AssetLibrary &)> fn, bool include_all_library)
Static Public Attributes inherited from blender::asset_system::AssetLibrary
static bool save_catalogs_when_file_is_saved = true
Protected Attributes inherited from blender::asset_system::AssetLibrary
std::shared_ptr< AssetCatalogService > catalog_service_
std::recursive_mutex catalog_service_mutex_
bool may_override_import_method_ = false
bCallbackFuncStore on_save_callback_store_ {}

Detailed Description

Abstract class for remote libraries. PreferencesRemoteAssetLibrary and OnlineEssentialsLibrary derive from this.

Definition at line 21 of file remote_library.hh.

Constructor & Destructor Documentation

◆ RemoteAssetLibrary()

Member Function Documentation

◆ force_remote_listing_download()

void blender::asset_system::RemoteAssetLibrary::force_remote_listing_download ( ) const
overridevirtual

(Re-)download the remote listing for this library.

This only has an effect for asset libraries that are themselves a remote library, or contain one (such as the "Essentials" library if it includes online essentials, or the "All" if there are any remote libraries included).

The "Allow Online Access" option will be enforced internally, but probably some check to give a user message should be done at a higher level.

Reimplemented from blender::asset_system::AssetLibrary.

Definition at line 96 of file remote_library.cc.

References blender::asset_system::AssetLibrary::auth_token(), blender::asset_system::remote_library_request_download(), and blender::asset_system::AssetLibrary::root_path().

◆ import_method()

std::optional< eAssetImportMethod > blender::asset_system::RemoteAssetLibrary::import_method ( ) const
overridevirtual

Get the import method that should be used for assets in this library.

Returns
The import method or no value if the library doesn't support importing. For example because the library is the "Current File" library or the library was removed from the Preferences.

Implements blender::asset_system::AssetLibrary.

Definition at line 102 of file remote_library.cc.

References blender::ASSET_IMPORT_APPEND_REUSE, blender::ASSET_IMPORT_PACK, and blender::U.

◆ refresh_catalogs()

void blender::asset_system::RemoteAssetLibrary::refresh_catalogs ( )
overridevirtual

◆ remote_url()

std::optional< StringRefNull > blender::asset_system::RemoteAssetLibrary::remote_url ( ) const
overridevirtual

Return the URL of the remote asset library, or #std::nullopt if this is not a remote library.

Note: don't use this as a way to distinguish remote vs. local libraries. Either query the asset itself, or use is_or_contains_remote_libraries(). The Essentials and All libraries may contain a mixture of remote and local assets.

Reimplemented from blender::asset_system::AssetLibrary.

Definition at line 110 of file remote_library.cc.

Referenced by blender::asset_system::PreferencesRemoteAssetLibrary::PreferencesRemoteAssetLibrary(), and RemoteAssetLibrary().


The documentation for this class was generated from the following files: