diff options
author | Julian Eisel <julian@blender.org> | 2021-07-08 23:33:02 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-07-15 17:12:36 +0300 |
commit | 3feb3ce32d7d1fddf745bf30592cf68d906c295f (patch) | |
tree | beb00d1e8295611520055bcd78f8d2c6226981c1 /source/blender/blenkernel/intern/context.c | |
parent | 7898089de3f20b08a08516bd2fd2be7dd1c565fe (diff) |
Assets: Expose active asset library in context
For the Asset Browser, this returns the active asset library of the
Asset Browser, otherwise it returns the one active in the workspace.
This gives simple access to the active asset library from UI code and
Python scripts. For example the upcoming Pose Library add-on uses this,
as well as the upcoming asset view template.
Diffstat (limited to 'source/blender/blenkernel/intern/context.c')
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 1028790856c..4c91a3f3387 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -1448,6 +1448,11 @@ int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list) return ctx_data_collection_get(C, "editable_gpencil_strokes", list); } +const AssetLibraryReference *CTX_wm_asset_library(const bContext *C) +{ + return ctx_data_pointer_get(C, "asset_library"); +} + Depsgraph *CTX_data_depsgraph_pointer(const bContext *C) { Main *bmain = CTX_data_main(C); |