|
Blender V5.3
|
#include <AS_remote_library.hh>
Public Types | |
| enum | Status { Loading , Finished , Failure , Cancelled } |
| using | TimePoint = std::chrono::time_point<std::chrono::steady_clock> |
| using | FileSystemTimePoint = std::filesystem::file_time_type |
Remote Library Loading Status | |
| static void | begin_loading (StringRef url, float timeout) |
| static void | ping_still_loading (StringRef url) |
| static void | ping_new_pages (StringRef url) |
| static void | ping_new_preview (const bContext &C, StringRef preview_full_filepath) |
| static void | ping_asset_file_progress (StringRef absolute_file_url, int64_t size_in_bytes) |
| static void | ping_asset_file_download_succeeded (const bContext &C, StringRef library_url, StringRef absolute_file_url, StringRef local_file_abspath) |
| static void | ping_asset_file_download_failed (const bContext &C, StringRef library_url, StringRef absolute_file_url, StringRef local_file_abspath) |
| static void | ping_download_queue_done (const bContext &C) |
| static void | ping_metafiles_in_place (StringRef url) |
| static void | set_finished (StringRef url) |
| static void | set_cancelled (const StringRef url) |
| static void | set_failure (StringRef url, std::optional< StringRefNull > failure_message) |
| static std::optional< StringRefNull > | failure_message (StringRef url) |
| static std::optional< RemoteLibraryLoadingStatus::Status > | status (StringRef url) |
| static std::optional< bool > | metafiles_in_place (StringRef url) |
| static std::optional< FileSystemTimePoint > | loading_start_time (const StringRef url) |
| static std::optional< TimePoint > | last_new_pages_time (StringRef url) |
| static bool | handle_timeout (StringRef url) |
Status information about an externally loaded asset library listing, stored globally.
Remote asset library downloading is handled in Python. This API allows storing status information globally per URL. Asset UIs can then query the status and reflect it accordingly.
Another important use is coordinating the Python side downloading with the C++ side loading. The C++ asset library loading might have to wait for Python to be done downloading and validating individual asset listing pages, and load in these new pages as they become ready.
All functions must be called on the same thread.
Definition at line 194 of file AS_remote_library.hh.
| using blender::asset_system::RemoteLibraryLoadingStatus::FileSystemTimePoint = std::filesystem::file_time_type |
Definition at line 203 of file AS_remote_library.hh.
| using blender::asset_system::RemoteLibraryLoadingStatus::TimePoint = std::chrono::time_point<std::chrono::steady_clock> |
Definition at line 202 of file AS_remote_library.hh.
| Enumerator | |
|---|---|
| Loading | |
| Finished | |
| Failure | |
| Cancelled | |
Definition at line 196 of file AS_remote_library.hh.
|
static |
Definition at line 426 of file remote_library.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), blender::BLI_assert(), blender::asset_system::library_to_status_map(), and Loading.
|
static |
Definition at line 614 of file remote_library.cc.
References Failure, blender::asset_system::library_to_status_map(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by blender::file_draw_asset_library_remote_loading_failed_hint(), and set_failure().
|
static |
Checks if the status storage timed out, because it hasn't received status updates for the given timeout duration. Changes the status to failure in that case.
Note that this function doesn't do more than check if the timeout is reached, and changing state to failure if so. It's meant to be called in regular, short intervals to make the whole timeout handling work. Current remote asset library loading takes care of this.
Definition at line 627 of file remote_library.cc.
References Failure, blender::asset_system::library_to_status_map(), Loading, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), and RPT_.
Referenced by blender::filelist_remote_asset_library_update_loading_flags().
|
static |
Definition at line 562 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by blender::filelist_remote_asset_library_update_loading_flags().
|
static |
Definition at line 548 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), Loading, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by blender::remote_asset_library_request().
|
static |
Definition at line 538 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by blender::filelist_remote_asset_library_update_loading_flags().
|
static |
Should be called when an asset file download has failed. Partial progress for the file is reset to zero, since a future retry has to start from scratch.
Definition at line 502 of file remote_library.cc.
References C, blender::asset_system::Failed, and blender::asset_system::ping_asset_file_done_impl().
|
static |
Should be called when an asset file download has completed successfully.
Definition at line 492 of file remote_library.cc.
References C, blender::asset_system::ping_asset_file_done_impl(), and blender::asset_system::Succeeded.
|
static |
Definition at line 470 of file remote_library.cc.
References blender::asset_system::ProgressTracker::file_report_progress().
|
static |
Inform the asset system that there are no more pending asset file downloads for any asset library.
Definition at line 512 of file remote_library.cc.
References C, blender::CTX_wm_manager(), and blender::asset_system::ProgressTracker::on_all_finished().
|
static |
Definition at line 517 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
|
static |
Definition at line 451 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), Loading, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
|
static |
Definition at line 464 of file remote_library.cc.
References C, blender::CTX_wm_manager(), and blender::ED_preview_online_download_finished().
|
static |
Let the state know that the loading is still ongoing, resetting the timeout.
Definition at line 439 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), Loading, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
|
static |
Definition at line 586 of file remote_library.cc.
References Cancelled, blender::asset_system::library_to_status_map(), Loading, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by blender::asset_system::remote_library_cancel_all_listing_downloads().
|
static |
Definition at line 599 of file remote_library.cc.
References Failure, failure_message(), blender::asset_system::library_to_status_map(), Loading, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
|
static |
Definition at line 573 of file remote_library.cc.
References Finished, blender::asset_system::library_to_status_map(), Loading, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
|
static |
Definition at line 527 of file remote_library.cc.
References blender::asset_system::library_to_status_map(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by blender::filelist_remote_asset_library_update_loading_flags(), blender::asset_system::remote_library_request_download(), and blender::show_asset_library_message().