diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-12 15:45:11 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-12 15:45:11 +0300 |
commit | 74ea21ec9dfdff4c5b1c00092427c49044343ca9 (patch) | |
tree | 6a13d30217fea12867fad68c21a82b21ec1afde3 /source/blender/editors/asset/intern/asset_catalog.cc | |
parent | f1d97a308d4a588694cdd41db57197576f1432c0 (diff) |
Asset Catalogs: expose undo/redo operators to UI
Ensure that catalog operations create an undo snapshot, and show
undo/redo operators in the asset browser.
A hidden operator `ASSET_OT_catalog_undo_push` is also added such that
add-ons can also set undo snapshots if they need.
Diffstat (limited to 'source/blender/editors/asset/intern/asset_catalog.cc')
-rw-r--r-- | source/blender/editors/asset/intern/asset_catalog.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/editors/asset/intern/asset_catalog.cc b/source/blender/editors/asset/intern/asset_catalog.cc index eb1865ee9cc..056fda63bd7 100644 --- a/source/blender/editors/asset/intern/asset_catalog.cc +++ b/source/blender/editors/asset/intern/asset_catalog.cc @@ -66,6 +66,7 @@ AssetCatalog *ED_asset_catalog_add(::AssetLibrary *library, std::string unique_name = catalog_name_ensure_unique(*catalog_service, name, parent_path); AssetCatalogPath fullpath = AssetCatalogPath(parent_path) / unique_name; + catalog_service->undo_push(); return catalog_service->create_catalog(fullpath); } @@ -77,5 +78,6 @@ void ED_asset_catalog_remove(::AssetLibrary *library, const CatalogID &catalog_i return; } + catalog_service->undo_push(); catalog_service->prune_catalogs_by_id(catalog_id); } |