Blender
V3.3
|
#include <optional>
#include <string>
#include "BKE_context.h"
#include "BLI_map.hh"
#include "BLI_path_util.h"
#include "BLI_utility_mixins.hh"
#include "DNA_space_types.h"
#include "BKE_preferences.h"
#include "ED_fileselect.h"
#include "WM_api.h"
#include "../space_file/file_indexer.h"
#include "../space_file/filelist.h"
#include "ED_asset_handle.h"
#include "ED_asset_indexer.h"
#include "ED_asset_list.h"
#include "ED_asset_list.hh"
#include "asset_library_reference.hh"
Go to the source code of this file.
Classes | |
class | blender::ed::asset::FileListWrapper |
class | blender::ed::asset::PreviewTimer |
class | blender::ed::asset::AssetList |
class | blender::ed::asset::AssetListStorage |
Namespaces | |
blender | |
blender::ed | |
blender::ed::asset | |
Abstractions to manage runtime asset lists with a global cache for multiple UI elements to access. Internally this uses the FileList API and structures from filelist.c
. This is just because it contains most necessary logic already and there's not much time for a more long-term solution.
Definition in file asset_list.cc.
|
static |
Definition at line 457 of file asset_list.cc.
References C, CTX_wm_space_file(), ED_fileselect_get_asset_params(), ED_fileselect_is_asset_browser(), filelist_dir(), and SpaceFile::files.
Referenced by ED_assetlist_asset_filepath_get().
std::string ED_assetlist_asset_filepath_get | ( | const bContext * | C, |
const AssetLibraryReference & | library_reference, | ||
const AssetHandle & | asset_handle | ||
) |
Definition at line 472 of file asset_list.cc.
References assetlist_library_path_from_sfile_get_hack(), BLI_join_dirfile(), C, ED_asset_handle_get_local_id(), ED_asset_handle_get_metadata(), ED_assetlist_library_path(), AssetHandle::file_data, FILE_MAX_LIBEXTRA, and FileDirEntry::relpath.
Referenced by ED_asset_handle_get_full_library_path().
ImBuf* ED_assetlist_asset_image_get | ( | const AssetHandle * | asset_handle | ) |
Definition at line 495 of file asset_list.cc.
References AssetHandle::file_data, filelist_file_getimage(), and filelist_geticon_image_ex().
Referenced by asset_view_item_but_drag_set().
void ED_assetlist_clear | ( | const AssetLibraryReference * | library_reference, |
bContext * | C | ||
) |
Definition at line 434 of file asset_list.cc.
References C, blender::ed::asset::AssetList::clear(), and blender::ed::asset::AssetListStorage::lookup_list().
void ED_assetlist_ensure_previews_job | ( | const AssetLibraryReference * | library_reference, |
bContext * | C | ||
) |
Definition at line 425 of file asset_list.cc.
References C, blender::ed::asset::AssetList::ensurePreviewsJob(), and blender::ed::asset::AssetListStorage::lookup_list().
void ED_assetlist_iterate | ( | const AssetLibraryReference & | library_reference, |
AssetListIterFn | fn | ||
) |
Definition at line 447 of file asset_list.cc.
References blender::ed::asset::AssetList::iterate(), and blender::ed::asset::AssetListStorage::lookup_list().
Referenced by asset_view_template_refresh_asset_collection().
const char* ED_assetlist_library_path | ( | const AssetLibraryReference * | library_reference | ) |
Definition at line 505 of file asset_list.cc.
References blender::StringRefBase::data(), blender::ed::asset::AssetList::filepath(), and blender::ed::asset::AssetListStorage::lookup_list().
Referenced by ED_assetlist_asset_filepath_get().
bool ED_assetlist_listen | ( | const AssetLibraryReference * | library_reference, |
const wmNotifier * | notifier | ||
) |
Definition at line 514 of file asset_list.cc.
References blender::ed::asset::AssetList::listen(), and blender::ed::asset::AssetListStorage::lookup_list().
int ED_assetlist_size | ( | const AssetLibraryReference * | library_reference | ) |
Definition at line 524 of file asset_list.cc.
References blender::ed::asset::AssetListStorage::lookup_list(), and blender::ed::asset::AssetList::size().
Can't wait for static deallocation to run. There's nested data allocated with our guarded allocator, it will complain about unfreed memory on exit.
Definition at line 543 of file asset_list.cc.
References blender::ed::asset::AssetListStorage::destruct().
Referenced by WM_exit_ex().
void ED_assetlist_storage_fetch | ( | const AssetLibraryReference * | library_reference, |
const bContext * | C | ||
) |
Definition at line 420 of file asset_list.cc.
References C, and blender::ed::asset::AssetListStorage::fetch_library().
bool ED_assetlist_storage_has_list_for_library | ( | const AssetLibraryReference * | library_reference | ) |
Definition at line 442 of file asset_list.cc.
References blender::ed::asset::AssetListStorage::lookup_list().
Referenced by asset_library_refresh_poll().
Remapping of ID pointers within the asset lists. Typically called when an ID is deleted to clear all references to it (id_new is null then).
Definition at line 538 of file asset_list.cc.
References blender::ed::asset::AssetListStorage::remapID().
Referenced by wm_main_remap_assetlist().
Tag all asset lists in the storage that show main data as needing an update (re-fetch).
This only tags the data. If the asset list is visible on screen, the space is still responsible for ensuring the necessary redraw. It can use ED_assetlist_listen() to check if the asset-list needs a redraw for a given notifier.
Definition at line 533 of file asset_list.cc.
References blender::ed::asset::AssetListStorage::tagMainDataDirty().
Referenced by asset_view_listener(), ED_asset_clear_id(), ED_asset_mark_id(), ED_editors_init(), ed_undo_step_post(), lib_id_generate_preview_exec(), and lib_id_generate_preview_from_object_exec().