From f6c5af3d47539d710f8a0542fcd8340a6e67f65a Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 11 Jun 2021 16:35:39 +0200 Subject: Add option to link assets on drag & drop Note: Linking in this case as in link vs. append. Easily confused with linking a data-block to multiple usages (e.g. single material used by multiple objects). Adds a drop-down to the Asset Browser header to choose between Link and Append. This is probably gonna be a temporary place, T54642 shows where this could be placed eventually. Linking support is crucial for usage of the asset browser in production environments. It just wasn't enabled yet because a) the asset project currently focuses on single user, not production assets, and b) because there were many unkowns still for the workflow that have big impact on production use as well. With the recently held asset workshop I'm more confident with enabling linking, as design ideas relevant to production use were confirmed. Differential Revision: https://developer.blender.org/D11536 Reviewed by: Bastien Montagne --- source/blender/blenloader/intern/versioning_300.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 93e2af1b68e..268598ccc51 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -244,5 +244,20 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } FOREACH_NODETREE_END; + + if (!DNA_struct_elem_find(fd->filesdna, "FileAssetSelectParams", "int", "import_type")) { + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_FILE) { + SpaceFile *sfile = (SpaceFile *)sl; + if (sfile->asset_params) { + sfile->asset_params->import_type = FILE_ASSET_IMPORT_APPEND; + } + } + } + } + } + } } } -- cgit v1.2.3