Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-07-08 17:27:18 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-07-15 17:12:36 +0300
commit637731dc610370782b1041ece4425bf3e6086ba0 (patch)
tree16f275abd6924c02035ded0fe591895db21fd599 /source/blender/editors/include
parent55d48defc50fac7756ccf5b5afbba8f35cf31835 (diff)
Assets: Abstraction for temporary loading of asset data-blocks
This is an editor-level abstraction for the `BLO_library_temp_xxx()` API for temporary loading of data-blocks from another Blend file. It abstracts away the asset specific code, like asset file-path handling and local asset data-block handling. Main use-case for this is applying assets as presets that are based on data-blocks, like poses. Such preset assets are an important part of the asset system design, so such an abstraction will likely find more usage in the future.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/ED_asset.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_asset.h b/source/blender/editors/include/ED_asset.h
index 381071a5c6f..d33085f1cc4 100644
--- a/source/blender/editors/include/ED_asset.h
+++ b/source/blender/editors/include/ED_asset.h
@@ -33,6 +33,8 @@ struct Main;
struct ReportList;
struct wmNotifier;
+typedef struct AssetTempIDConsumer AssetTempIDConsumer;
+
bool ED_asset_mark_id(const struct bContext *C, struct ID *id);
bool ED_asset_clear_id(struct ID *id);
@@ -47,6 +49,15 @@ void ED_asset_handle_get_full_library_path(const struct bContext *C,
const AssetHandle *asset,
char r_full_lib_path[]);
+AssetTempIDConsumer *ED_asset_temp_id_consumer_create(const AssetHandle *handle);
+void ED_asset_temp_id_consumer_free(AssetTempIDConsumer **consumer);
+struct ID *ED_asset_temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer,
+ const struct bContext *C,
+ const AssetLibraryReference *asset_library,
+ ID_Type id_type,
+ struct Main *bmain,
+ struct ReportList *reports);
+
void ED_assetlist_storage_fetch(const struct AssetLibraryReference *library_reference,
const struct AssetFilterSettings *filter_settings,
const struct bContext *C);