Adds a new built-in asset library that contains all other asset libraries visible in the asset library selector menu. This also means all their asset catalogs will be displayed as a single merged tree. The asset catalogs are not editable, since this would require support for writing multiple catalog definition files, which isn't there yet. Often it's not relevant where an asset comes from. Users just want to be able to get an asset quickly, comparable to how people use a search engine to browse images or the web itself, instead of first going to a dedicated platform. They don't want to bother with first choosing where they want the result to come from. This especially is needed for the Asset Shelf (T102879) that is being developed for the brush assets project (T101895). With this, users will have access to all their brushes efficiently from the 3D view, without much browsing. Did an informal review of the asset system bits with Sybren.
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup edasset
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "DNA_asset_types.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Return an index that can be used to uniquely identify \a library, assuming
|
|
* that all relevant indices were created with this function.
|
|
*/
|
|
int ED_asset_library_reference_to_enum_value(const AssetLibraryReference *library);
|
|
/**
|
|
* Return an asset library reference matching the index returned by
|
|
* #ED_asset_library_reference_to_enum_value().
|
|
*/
|
|
AssetLibraryReference ED_asset_library_reference_from_enum_value(int value);
|
|
/**
|
|
* Translate all available asset libraries to an RNA enum, whereby the enum values match the result
|
|
* of #ED_asset_library_reference_to_enum_value() for any given library.
|
|
*
|
|
* Since this is meant for UI display, skips non-displayable libraries, that is, libraries with an
|
|
* empty name or path.
|
|
*
|
|
* \param include_generated: Whether to include libraries that are generated and thus cannot be
|
|
* written to. Setting this to false means only custom libraries will be
|
|
* included, since they are stored on disk with a single root directory,
|
|
* thus have a well defined location that can be written to.
|
|
*/
|
|
const struct EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf(
|
|
bool include_generated);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|