diff --git a/source/blender/editors/asset/CMakeLists.txt b/source/blender/editors/asset/CMakeLists.txt index 978237550ee..c4da04fe24d 100644 --- a/source/blender/editors/asset/CMakeLists.txt +++ b/source/blender/editors/asset/CMakeLists.txt @@ -20,7 +20,6 @@ set(INC_SYS set(SRC intern/asset_catalog.cc intern/asset_filter.cc - intern/asset_handle.cc intern/asset_import.cc intern/asset_indexer.cc intern/asset_library_reference_enum.cc @@ -41,7 +40,6 @@ set(SRC ED_asset_catalog.hh ED_asset_filter.hh - ED_asset_handle.hh ED_asset_import.hh ED_asset_indexer.hh ED_asset_library.hh diff --git a/source/blender/editors/asset/ED_asset_handle.hh b/source/blender/editors/asset/ED_asset_handle.hh deleted file mode 100644 index e81f62252ac..00000000000 --- a/source/blender/editors/asset/ED_asset_handle.hh +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-FileCopyrightText: 2023 Blender Authors - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -/** \file - * \ingroup edasset - * - * Asset-handle is a temporary design, not part of the core asset system design. - * - * Currently asset-list items are just file directory items (#FileDirEntry). So an asset-handle - * just wraps a pointer to this. We try to abstract away the fact that it's just a file entry, - * although that doesn't always work (see #rna_def_asset_handle()). - */ - -#pragma once - -struct AssetHandle; -namespace blender::asset_system { -class AssetRepresentation; -} - -namespace blender::ed::asset { - -asset_system::AssetRepresentation *handle_get_representation(const AssetHandle *asset); - -} // namespace blender::ed::asset diff --git a/source/blender/editors/asset/ED_asset_list.hh b/source/blender/editors/asset/ED_asset_list.hh index 6dba96787e7..fe7716c8470 100644 --- a/source/blender/editors/asset/ED_asset_list.hh +++ b/source/blender/editors/asset/ED_asset_list.hh @@ -105,11 +105,6 @@ void storage_id_remap(ID *id_old, ID *id_new); */ void storage_exit(); -AssetHandle asset_handle_get_by_index(const AssetLibraryReference *library_reference, - int asset_index); -asset_system::AssetRepresentation *asset_get_by_index( - const AssetLibraryReference &library_reference, int asset_index); - /** * \return True if the region needs a UI redraw. */ diff --git a/source/blender/editors/asset/intern/asset_handle.cc b/source/blender/editors/asset/intern/asset_handle.cc deleted file mode 100644 index 2510bfbb5aa..00000000000 --- a/source/blender/editors/asset/intern/asset_handle.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-FileCopyrightText: 2023 Blender Authors - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -/** \file - * \ingroup edasset - */ - -#include "AS_asset_representation.hh" - -#include "DNA_space_types.h" - -#include "ED_fileselect.hh" - -#include "ED_asset_handle.hh" - -namespace blender::ed::asset { - -asset_system::AssetRepresentation *handle_get_representation(const AssetHandle *asset) -{ - return asset->file_data->asset; -} - -} // namespace blender::ed::asset diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc index 9d15d95b3c9..515a8773522 100644 --- a/source/blender/editors/asset/intern/asset_list.cc +++ b/source/blender/editors/asset/intern/asset_list.cc @@ -35,7 +35,6 @@ #include "../space_file/file_indexer.hh" #include "../space_file/filelist.hh" -#include "ED_asset_handle.hh" #include "ED_asset_indexer.hh" #include "ED_asset_list.hh" #include "ED_fileselect.hh" @@ -98,8 +97,6 @@ class AssetList : NonCopyable { void clear(wmWindowManager *wm); void clear_current_file_assets(wmWindowManager *wm); - AssetHandle asset_get_by_index(int index) const; - bool needs_refetch() const; bool is_loaded() const; asset_system::AssetLibrary *asset_library() const; @@ -238,11 +235,6 @@ void AssetList::clear_current_file_assets(wmWindowManager *wm) WM_main_add_notifier(NC_ASSET | ND_ASSET_LIST, nullptr); } -AssetHandle AssetList::asset_get_by_index(int index) const -{ - return {filelist_file(filelist_, index)}; -} - /** * \return True if the asset-list needs a UI redraw. */ @@ -552,20 +544,6 @@ asset_system::AssetLibrary *library_get_once_available( return list->asset_library(); } -AssetHandle asset_handle_get_by_index(const AssetLibraryReference *library_reference, - int asset_index) -{ - const AssetList *list = lookup_list(*library_reference); - return list->asset_get_by_index(asset_index); -} - -asset_system::AssetRepresentation *asset_get_by_index( - const AssetLibraryReference &library_reference, int asset_index) -{ - AssetHandle asset_handle = asset_handle_get_by_index(&library_reference, asset_index); - return reinterpret_cast(asset_handle.file_data->asset); -} - bool listen(const wmNotifier *notifier) { return AssetList::listen(*notifier); diff --git a/source/blender/editors/include/ED_asset.hh b/source/blender/editors/include/ED_asset.hh index d6182b5c13c..06ffc8d48a3 100644 --- a/source/blender/editors/include/ED_asset.hh +++ b/source/blender/editors/include/ED_asset.hh @@ -15,7 +15,6 @@ * dedicated headers. */ #include "../asset/ED_asset_catalog.hh" // IWYU pragma: export -#include "../asset/ED_asset_handle.hh" // IWYU pragma: export #include "../asset/ED_asset_library.hh" // IWYU pragma: export #include "../asset/ED_asset_list.hh" // IWYU pragma: export #include "../asset/ED_asset_mark_clear.hh" // IWYU pragma: export diff --git a/source/blender/editors/sculpt_paint/brush_asset_ops.cc b/source/blender/editors/sculpt_paint/brush_asset_ops.cc index 7aaf2300be6..7086a6a34d1 100644 --- a/source/blender/editors/sculpt_paint/brush_asset_ops.cc +++ b/source/blender/editors/sculpt_paint/brush_asset_ops.cc @@ -32,7 +32,6 @@ #include "RNA_define.hh" #include "ED_asset.hh" -#include "ED_asset_handle.hh" #include "ED_asset_library.hh" #include "ED_asset_list.hh" #include "ED_asset_mark_clear.hh"