|
Blender V5.3
|
Classes | |
| class | FileListWrapper |
| class | AssetList |
| struct | GlobalStorage |
Typedefs | |
| using | AssetListIterFn = FunctionRef<bool(asset_system::AssetRepresentation &)> |
Runtime asset list cache | |
| using | AssetListMap = Map<AssetLibraryReference, AssetList> |
| using | is_new_t = bool |
| void | storage_tag_main_data_dirty () |
| void | storage_id_remap (ID *id_old, ID *id_new) |
| static void | clear (const AssetLibraryReference *library_reference, wmWindowManager *wm) |
| static void | on_save_post (Main *main, PointerRNA **pointers, int num_pointers, void *arg) |
| static AssetListMap & | libraries_map () |
| static AssetList * | lookup_list (const AssetLibraryReference &library_ref) |
| static std::optional< eFileSelectType > | asset_library_reference_to_fileselect_type (const AssetLibraryReference &library_reference) |
| static std::tuple< AssetList &, is_new_t > | ensure_list_storage (const AssetLibraryReference &library_reference, eFileSelectType filesel_type) |
| using blender::ed::asset::list::AssetListIterFn = FunctionRef<bool(asset_system::AssetRepresentation &)> |
Can return false to stop iterating.
Definition at line 44 of file ED_asset_list.hh.
A global asset list map, each entry being a list for a specific asset library.
Definition at line 326 of file asset_list.cc.
| using blender::ed::asset::list::is_new_t = bool |
Definition at line 399 of file asset_list.cc.
|
static |
Definition at line 369 of file asset_list.cc.
References blender::ASSET_LIBRARY_ALL, blender::ASSET_LIBRARY_CUSTOM, blender::ASSET_LIBRARY_ESSENTIALS, blender::ASSET_LIBRARY_LOCAL, blender::ASSET_LIBRARY_ONLINE_ESSENTIALS, asset_library_reference_to_fileselect_type(), blender::ASSET_LIBRARY_USE_REMOTE_URL, blender::BKE_preferences_asset_library_find_index(), BLI_assert_unreachable, blender::AssetLibraryReference::custom_library_index, blender::FILE_ASSET_LIBRARY, blender::FILE_ASSET_LIBRARY_ALL, blender::FILE_ASSET_LIBRARY_ESSENTIALS, blender::FILE_ASSET_LIBRARY_REMOTE, blender::FILE_MAIN_ASSET, blender::bUserAssetLibrary::flag, blender::AssetLibraryReference::type, and blender::U.
Referenced by asset_library_reference_to_fileselect_type(), storage_fetch(), and storage_fetch_blocking().
| void blender::ed::asset::list::asset_reading_region_listen_fn | ( | const wmRegionListenerParams * | params | ) |
Definition at line 414 of file asset_list.cc.
References blender::wmNotifier::action, asset_reading_region_listen_fn(), blender::wmNotifier::category, blender::wmNotifier::data, blender::ED_region_tag_refresh_ui(), ELEM, NA_DOWNLOAD_FINISHED, NC_ASSET, ND_ASSET_LIST_PREVIEW, ND_ASSET_LIST_READING, blender::wmRegionListenerParams::notifier, and blender::wmRegionListenerParams::region.
Referenced by blender::ed::vse::add_catalog_assets_menu_type(), blender::ed::space_node::add_root_catalogs_menu_type(), blender::ed::vse::add_scene_menu_type(), blender::ed::vse::add_unassigned_assets_menu_type(), asset_reading_region_listen_fn(), blender::ed::space_node::catalog_assets_menu_type(), blender::ed::asset::shelf::catalog_selector_panel_register(), blender::ED_screen_user_menu_register(), blender::ed::object::modifier_add_catalog_assets_menu_type(), blender::ed::vse::modifier_add_catalog_assets_menu_type(), blender::ed::object::modifier_add_root_catalogs_menu_type(), blender::ed::vse::modifier_add_root_catalogs_menu_type(), blender::ed::object::modifier_add_unassigned_assets_menu_type(), blender::ed::vse::modifier_add_unassigned_assets_menu_type(), blender::ed::geometry::node_group_operator_assets_menu(), blender::ed::geometry::node_group_operator_assets_menu_unassigned(), blender::ed::asset::shelf::popover_panel_register(), blender::SCENE_MT_add_compositor_effect_catalog_assets(), blender::SCENE_MT_add_compositor_effect_root_catalogs(), blender::SCENE_MT_add_compositor_effect_unassigned_assets(), blender::ed::space_node::swap_root_catalogs_menu_type(), and blender::ed::space_node::unassigned_assets_menu_type().
| void blender::ed::asset::list::clear | ( | const AssetLibraryReference * | library_reference, |
| const bContext * | C ) |
Clears this asset library and the "All" asset library for reload in both the static asset list storage, as well as for all open asset browsers. Call this whenever the content of the given asset library changed in a way that a reload is necessary.
Definition at line 550 of file asset_list.cc.
References C, clear(), and blender::CTX_wm_manager().
Referenced by clear(), clear(), clear_all_library(), blender::ed::asset::do_asset_library_refresh(), blender::ed::asset::external_asset_rename_exec(), blender::file_main_region_message_subscribe(), on_save_post(), blender::ed::asset::refresh_asset_library(), and blender::ed::asset::shelf::region_message_subscribe().
|
static |
Definition at line 513 of file asset_list.cc.
References blender::asset_system::all_library_reference(), blender::ASSET_LIBRARY_ALL, blender::ASSET_LIBRARY_LOCAL, blender::ed::asset::list::AssetList::clear(), clear(), blender::ed::asset::list::AssetList::clear_current_file_assets(), blender::ED_fileselect_clear(), blender::ED_fileselect_clear_main_assets(), foreach_visible_asset_browser_showing_library(), lookup_list(), and blender::AssetLibraryReference::type.
| void blender::ed::asset::list::clear_all_library | ( | const bContext * | C | ) |
Clears the all asset library for reload in both the static asset list storage, as well as for all open asset browsers. Call this whenever any asset library content changed in a way that a reload is necessary.
Definition at line 555 of file asset_list.cc.
References blender::asset_system::all_library_reference(), C, clear(), clear_all_library(), and blender::CTX_wm_manager().
Referenced by clear_all_library(), blender::ED_userpref_asset_library_new(), and blender::ED_userpref_asset_library_remove().
|
static |
Definition at line 400 of file asset_list.cc.
References blender::ed::asset::list::AssetList::AssetList(), ensure_list_storage(), libraries_map(), and storage.
Referenced by ensure_list_storage(), storage_fetch(), and storage_fetch_blocking().
|
static |
Definition at line 491 of file asset_list.cc.
References blender::bScreen::areabase, blender::FileAssetSelectParams::asset_library_ref, blender::SpaceFile::asset_params, blender::SpaceFile::browse_mode, blender::FILE_BROWSE_MODE_ASSETS, foreach_visible_asset_browser_showing_library(), blender::SPACE_FILE, blender::ScrArea::spacedata, blender::ScrArea::spacetype, and blender::WM_window_get_active_screen().
Referenced by clear(), foreach_visible_asset_browser_showing_library(), and has_asset_browser_storage_for_library().
| bool blender::ed::asset::list::has_asset_browser_storage_for_library | ( | const AssetLibraryReference * | library_reference, |
| const bContext * | C ) |
Returns if any asset browser is visible showing the given asset library. Asset browsers are not really handled by this API, but for convenience of managing clearing it's handled here together with has_list_storage_for_library().
Definition at line 593 of file asset_list.cc.
References C, blender::CTX_wm_manager(), foreach_visible_asset_browser_showing_library(), and has_asset_browser_storage_for_library().
Referenced by blender::ed::asset::asset_library_refresh_poll(), and has_asset_browser_storage_for_library().
| bool blender::ed::asset::list::has_list_storage_for_library | ( | const AssetLibraryReference * | library_reference | ) |
Returns if the given asset library in global asset list storage.
Definition at line 588 of file asset_list.cc.
References has_list_storage_for_library(), and lookup_list().
Referenced by blender::ed::asset::asset_library_refresh_poll(), and has_list_storage_for_library().
| bool blender::ed::asset::list::is_loaded | ( | const AssetLibraryReference * | library_reference | ) |
Definition at line 479 of file asset_list.cc.
References is_loaded(), and lookup_list().
Referenced by blender::all_loading_finished(), blender::ed::object::all_loading_finished(), blender::ed::space_node::all_loading_finished(), blender::ed::vse::all_loading_finished(), blender::ed::asset::build_filtered_all_catalog_tree(), blender::ed::asset::shelf::AssetViewItem::build_grid_tile(), blender::ed::asset::find_asset_from_weak_ref(), blender::ed::asset::get_local_asset_from_weak_ref(), is_loaded(), and blender::root_catalogs_draw().
| void blender::ed::asset::list::iterate | ( | const AssetLibraryReference & | library_reference, |
| AssetListIterFn | fn ) |
Definition at line 605 of file asset_list.cc.
References iterate(), and lookup_list().
Referenced by blender::ed::asset::build_filtered_all_catalog_tree(), blender::ed::asset::build_filtered_catalog_tree(), blender::ed::asset::shelf::AssetView::build_items(), blender::ed::asset::find_asset_from_weak_ref(), blender::ed::space_node::gather_search_link_ops_for_all_assets(), blender::ed::asset::get_local_asset_from_weak_ref(), blender::ed::geometry::get_node_tools_type_data(), and iterate().
|
static |
Wrapper for Construct on First Use idiom, to avoid the Static Initialization Fiasco.
Definition at line 344 of file asset_list.cc.
References libraries_map(), and blender::ed::asset::list::GlobalStorage::list_map.
Referenced by ensure_list_storage(), libraries_map(), lookup_list(), on_remote_assets_downloaded(), storage_exit(), storage_id_remap(), and storage_tag_main_data_dirty().
| asset_system::AssetLibrary * blender::ed::asset::list::library_get_once_available | ( | const AssetLibraryReference & | library_reference | ) |
Get the asset library being read into an asset-list and identified using library_reference.
Definition at line 613 of file asset_list.cc.
References library_get_once_available(), and lookup_list().
Referenced by blender::ed::asset::asset_library_from_context(), blender::ed::asset::shelf::build_asset_view(), blender::ed::asset::build_filtered_all_catalog_tree(), blender::ed::asset::shelf::AssetView::build_items(), blender::ed::asset::shelf::catalog_selector_panel_draw(), blender::ed::asset::shelf::catalog_tree_draw(), blender::ed::asset::find_asset_from_weak_ref(), blender::ed::geometry::get_node_tools_type_data(), library_get_once_available(), blender::ed::geometry::register_node_group_operators(), and blender::ed::object::ui_template_modifier_asset_menu_items().
| bool blender::ed::asset::list::listen | ( | const wmNotifier * | notifier | ) |
Definition at line 623 of file asset_list.cc.
References blender::ed::asset::list::AssetList::listen(), and listen().
Referenced by listen(), and blender::ed::asset::shelf::region_listen().
|
static |
Definition at line 350 of file asset_list.cc.
References libraries_map(), lookup_list(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr().
Referenced by clear(), has_list_storage_for_library(), is_loaded(), iterate(), library_get_once_available(), lookup_list(), and size().
| void blender::ed::asset::list::on_remote_assets_downloaded | ( | wmWindowManager & | wm, |
| StringRef | library_url, | ||
| StringRef | downloaded_file_abspath ) |
Definition at line 561 of file asset_list.cc.
References blender::bScreen::areabase, blender::SpaceFile::browse_mode, blender::FILE_BROWSE_MODE_ASSETS, blender::filelist_remote_asset_library_refresh_online_assets_status(), blender::SpaceFile::files, libraries_map(), NA_DOWNLOAD_FINISHED, NC_ASSET, on_remote_assets_downloaded(), blender::SPACE_FILE, blender::ScrArea::spacedata, blender::ScrArea::spacetype, blender::WM_event_add_notifier_ex(), and blender::WM_window_get_active_screen().
Referenced by on_remote_assets_downloaded(), and blender::asset_system::ping_asset_file_done_impl().
|
static |
Definition at line 431 of file asset_list.cc.
References clear(), blender::asset_system::current_file_library_reference(), main, and on_save_post().
Referenced by blender::ed::asset::list::GlobalStorage::GlobalStorage(), and on_save_post().
| int blender::ed::asset::list::size | ( | const AssetLibraryReference * | library_reference | ) |
Definition at line 628 of file asset_list.cc.
References lookup_list(), and size().
Referenced by size().
| void blender::ed::asset::list::storage_exit | ( | ) |
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 637 of file asset_list.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), libraries_map(), and storage_exit().
Referenced by storage_exit(), blender::WM_exit_ex(), and blender::wm_file_read_setup_wm_init().
| void blender::ed::asset::list::storage_fetch | ( | const AssetLibraryReference * | library_reference, |
| const bContext * | C ) |
Invoke asset list reading, potentially in a parallel job. Won't wait until the job is done, and may return earlier.
Definition at line 446 of file asset_list.cc.
References asset_library_reference_to_fileselect_type(), C, ensure_list_storage(), and storage_fetch().
Referenced by blender::ed::asset::shelf::asset_shelf_header_draw(), blender::ed::asset::shelf::build_asset_view(), blender::ed::asset::build_filtered_all_catalog_tree(), blender::ed::asset::shelf::ensure_asset_library_fetched(), blender::ed::asset::find_asset_from_weak_ref(), blender::ed::space_node::gather_search_link_ops_for_all_assets(), blender::ed::asset::get_local_asset_from_weak_ref(), blender::ed::geometry::get_node_tools_type_data(), and storage_fetch().
| void blender::ed::asset::list::storage_fetch_blocking | ( | const AssetLibraryReference & | library_reference, |
| const bContext & | C ) |
Invoke asset list reading, guaranteed to execute on the same thread.
Definition at line 462 of file asset_list.cc.
References asset_library_reference_to_fileselect_type(), C, ensure_list_storage(), and storage_fetch_blocking().
Referenced by blender::ed::object::add_essential_asset_modifier(), blender::ed::sculpt_paint::brush_asset_activate_exec(), blender::ed::object::shade_auto_smooth_exec(), and storage_fetch_blocking().
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 362 of file asset_list.cc.
References libraries_map(), and storage_id_remap().
Referenced by storage_id_remap(), and blender::WM_main_remap_editor_id_reference().
| void blender::ed::asset::list::storage_tag_main_data_dirty | ( | ) |
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 listen() to check if the asset-list needs a redraw for a given notifier.
Definition at line 355 of file asset_list.cc.
References libraries_map(), and storage_tag_main_data_dirty().
Referenced by blender::ed::asset::clear_id(), blender::ED_editors_init(), blender::ed_undo_step_post(), blender::lib_id_generate_preview_exec(), blender::lib_id_generate_preview_from_object_exec(), blender::ed::asset::mark_id(), blender::ed::asset::screenshot_preview_exec(), and storage_tag_main_data_dirty().