diff options
author | Julian Eisel <julian@blender.org> | 2021-09-29 16:01:36 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-09-29 16:02:38 +0300 |
commit | ef29bf9023f54667db7a0c2898d12a3bce0873ed (patch) | |
tree | 91a5dfcd0cc0d46b33dae9e3a6b674dd08f7b877 /source/blender/makesdna | |
parent | 5cebcb415e76aaff74bc03c66414aa93b5c90e70 (diff) |
Assets: Expose option to reuse data-block data when appending
With 794c2828af60 & f48a4aa0f915 it's possible to reuse possibly
expensive, nested data of a data-block when appending. E.g. the
texture of a material, or the mesh of an object. Without this it's easy
to bloat memory and the file size. Duplicated textures also cause
unnecessary shader recompilations.
The feature was intended to be the new default behavior for the Asset
Browser, but it wasn't actually added to the UI yet. This patch adds a
new import type option to the Asset Browser. So from the menu in the
header, you can now choose between:
* Link
* Append
* Append (Reuse Data)
The latter is the new default.
Maniphest Task: https://developer.blender.org/T91741
Differential Revision: https://developer.blender.org/D12647
Reviewed by: Sybren Stüvel, Bastien Montagne
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index a7fcf2cfb89..2f3f52a6b82 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -812,8 +812,14 @@ typedef struct FileAssetSelectParams { } FileAssetSelectParams; typedef enum eFileAssetImportType { + /** Regular data-block linking. */ FILE_ASSET_IMPORT_LINK = 0, + /** Regular data-block appending (basically linking + "Make Local"). */ FILE_ASSET_IMPORT_APPEND = 1, + /** Append data-block with the #BLO_LIBLINK_APPEND_LOCAL_ID_REUSE flag enabled. Some typically + * heavy data dependencies (e.g. the image data-blocks of a material, the mesh of an object) may + * be reused from an earlier append. */ + FILE_ASSET_IMPORT_APPEND_REUSE = 2, } eFileAssetImportType; /** |