diff options
author | Julian Eisel <julian@blender.org> | 2021-11-24 20:37:33 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-24 20:37:33 +0300 |
commit | 338408772a077089482de4d99c68126f6b931c21 (patch) | |
tree | 20b1733d8005e17a33dd7f6e093edc8ed3521428 /source/blender/editors/asset/ED_asset_catalog.hh | |
parent | 499c24ce7530b484b103fa714e94fc72ef6acfc2 (diff) | |
parent | 71c39a9e2ef300a1ca451f1080cf59dda94ef4a4 (diff) |
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'source/blender/editors/asset/ED_asset_catalog.hh')
-rw-r--r-- | source/blender/editors/asset/ED_asset_catalog.hh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/editors/asset/ED_asset_catalog.hh b/source/blender/editors/asset/ED_asset_catalog.hh index 8da8fc0d6c9..cbfce16e9eb 100644 --- a/source/blender/editors/asset/ED_asset_catalog.hh +++ b/source/blender/editors/asset/ED_asset_catalog.hh @@ -20,6 +20,8 @@ #pragma once +#include <optional> + #include "BKE_asset_catalog.hh" #include "BLI_string_ref.hh" @@ -37,6 +39,18 @@ void ED_asset_catalog_remove(AssetLibrary *library, const blender::bke::CatalogI void ED_asset_catalog_rename(AssetLibrary *library, blender::bke::CatalogID catalog_id, blender::StringRefNull new_name); -void ED_asset_catalog_move(AssetLibrary *library, - blender::bke::CatalogID src_catalog_id, - blender::bke::CatalogID dst_parent_catalog_id); +/** + * Reinsert catalog identified by \a src_catalog_id as child to catalog identified by \a + * dst_parent_catalog_id. If \a dst_parent_catalog_id is not set, the catalog is moved to the root + * level of the tree. + * The name of the reinserted catalog is made unique within the parent. Note that moving a catalog + * to the same level it was before will also change its name, since the name uniqueness check isn't + * smart enough to ignore the item to be reinserted. So the caller is expected to handle this case + * to avoid unwanted renames. + * + * Nothing is done (debug builds run into an assert) if the given catalog IDs can't be identified. + */ +void ED_asset_catalog_move( + AssetLibrary *library, + blender::bke::CatalogID src_catalog_id, + std::optional<blender::bke::CatalogID> dst_parent_catalog_id = std::nullopt); |