Cleanup: Assets: Remove now unused asset handle functions & file
These are unused since ae9ca35e3b I think. Removes some of the last
remaining usages of the hacky `AssetHandle` type, see #108806.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
@@ -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_system::AssetRepresentation *>(asset_handle.file_data->asset);
|
||||
}
|
||||
|
||||
bool listen(const wmNotifier *notifier)
|
||||
{
|
||||
return AssetList::listen(*notifier);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user