Asset Browser: add operator for installing asset bundles

Add an operator "Copy to Asset Library" for installing asset bundles
into already-existing asset libraries.

The operator is shown when:
- the "Current File" library is selected,
- the blend file name matches `*_bundle.blend`, and
- the file is not already located in an asset library.

The user can select a target asset library, then gets a "Save As"
dialogue box to select where in that library the file should be saved.
This allows for renaming, saving in a subdirectory, etc.

The Asset Catalogs from the asset bundle are merged into the target
asset library.

The operator will refuse to run when external files are referenced. This
is not done in its poll function, as it's quite an extensive operator
(it loops over all ID datablocks).

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D13312
This commit is contained in:
2021-11-23 12:29:44 +01:00
parent b02ac2d8be
commit cd2849c89b
12 changed files with 353 additions and 17 deletions

View File

@@ -24,6 +24,10 @@
* \brief external writefile function prototypes.
*/
#ifdef __cplusplus
extern "C" {
#endif
struct BlendThumbnail;
struct Main;
struct MemFile;
@@ -72,3 +76,7 @@ extern bool BLO_write_file_mem(struct Main *mainvar,
int write_flags);
/** \} */
#ifdef __cplusplus
}
#endif