Blender V5.3
remote_library.cc File Reference
#include <fmt/format.h>
#include "BLI_assert.hh"
#include "BLI_fileops.hh"
#include "BLI_hash_md5.hh"
#include "BLI_listbase.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.hh"
#include "BLI_string_ref.hh"
#include "BLI_threads.hh"
#include "BLT_translation.hh"
#include "BKE_appdir.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_idprop.hh"
#include "BKE_preferences.h"
#include "BKE_report.hh"
#include "CLG_log.h"
#include "DNA_asset_types.h"
#include "DNA_space_enums.h"
#include "DNA_userdef_types.h"
#include "ED_asset.hh"
#include "ED_fileselect.hh"
#include "ED_render.hh"
#include "RNA_access.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "AS_asset_representation.hh"
#include "AS_essentials_library.hh"
#include "AS_remote_library.hh"
#include "remote_library.hh"

Go to the source code of this file.

Classes

struct  blender::asset_system::RequestIdentifier
struct  blender::asset_system::FileProgress
struct  blender::asset_system::ProgressData
struct  blender::asset_system::ProgressTracker

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::asset_system

Macros

#define AUTH_TOKEN_MAYBE_OVERRIDE_FROM_EXTENSIONS

Functions

Download Requests
void blender::asset_system::remote_library_request_download (const RemoteLibraryDefinitionRef &library_definition)
void blender::asset_system::remote_library_cancel_all_listing_downloads (const bContext &C)
void blender::asset_system::remote_library_request_asset_download (const bContext &C, const AssetRepresentation &asset, ReportList *reports)
void blender::asset_system::remote_library_request_preview_download (const bContext &C, const AssetRepresentation &asset, const StringRef dst_filepath, ReportList *reports)
Download Cancelling
void blender::asset_system::remote_library_cancel_all_asset_downloads (bContext &C)
Other Free Functions
std::string blender::asset_system::remote_library_top_meta_file_path (const RemoteLibraryDefinitionRef &library)
bool blender::asset_system::remote_library_url_ends_with_top_meta_file_name (const StringRef url)
void blender::asset_system::foreach_registered_user_remote_library (FunctionRef< void(bUserAssetLibrary &)> fn)

Variables

static CLG_LogRef LOG = {"asset.remote_library"}

Progress Tracking

enum class  blender::asset_system::DownloadOutcome { blender::asset_system::Succeeded , blender::asset_system::Failed }
float blender::asset_system::remote_library_total_asset_downloads_progress ()
bool blender::asset_system::remote_library_has_unfinished_asset_downloads ()

Remote Library Loading Status

using blender::asset_system::UrlToLibraryStatusMap = Map<std::string , asset_system::RemoteLibraryLoadingStatus>
static UrlToLibraryStatusMap & blender::asset_system::library_to_status_map ()
static void blender::asset_system::ping_asset_file_done_impl (const bContext &C, const StringRef library_url, const StringRef absolute_file_url, const StringRef local_file_abspath, const DownloadOutcome outcome)

Cache Paths

const int8_t blender::asset_system::REMOTE_LIBRARY_DIRNAME_LEN = 16
std::string blender::asset_system::remote_library_cache_directory_path_from_url (StringRef remote_url)
std::string blender::asset_system::remote_library_cache_directory_path (StringRefNull library_dirname)
std::string blender::asset_system::remote_library_asset_preview_path (const AssetRepresentation &asset)

Macro Definition Documentation

◆ AUTH_TOKEN_MAYBE_OVERRIDE_FROM_EXTENSIONS

#define AUTH_TOKEN_MAYBE_OVERRIDE_FROM_EXTENSIONS
Value:
"from _bpy_internal.extensions.asset_library_query import token_from_asset_url\n" \
"if (auth_token_override := token_from_asset_url(library_url)) is not None:\n" \
" auth_token = auth_token_override\n"

An extension repository may define itself as the origin of an asset-libraries token. In this case, always use the token from the extensions repository.

Note
_remote_asset_library_sync_all_periodic in bl_pkg/__init__.py does the same for the startup sync, which doesn't run this script.

Definition at line 63 of file remote_library.cc.

Referenced by blender::asset_system::remote_library_request_download(), and blender::asset_system::remote_library_request_preview_download().

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"asset.remote_library"}
static

Definition at line 54 of file remote_library.cc.