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/makesrna/intern/rna_space.c | |
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/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a4f79696276..9e06533d41b 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -6643,6 +6643,14 @@ static void rna_def_fileselect_asset_params(BlenderRNA *brna) 0, "Append", "Import the assets as copied data-block, with no link to the original asset data-block"}, + {FILE_ASSET_IMPORT_APPEND_REUSE, + "APPEND_REUSE", + 0, + "Append (Reuse Data)", + "Import the assets as copied data-block while avoiding multiple copies of nested, " + "typically heavy data. For example the textures of a material asset, or the mesh of an " + "object asset, don't have to be copied every time this asset is imported. The instances of " + "the asset share the data instead"}, {0, NULL, 0, NULL, NULL}, }; |