diff options
author | Julian Eisel <julian@blender.org> | 2021-08-02 17:59:10 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-08-02 18:00:20 +0300 |
commit | 3ff5d8f719f592c2ea17533532708e883a8baa96 (patch) | |
tree | 36561027ba8887c5437accdca4045e0dd9e9077b /source/blender/editors | |
parent | ceb049133c6fe7e66e67227c5f8fde311e69aa14 (diff) |
Asset Browser: Proper context menu for assets
Add a context menu dedicated to asset operations to the Asset Browser.
There are two separate context menus to keep things separated well and
avoid confusing if-else logic (similar to D12057 & D12059). Their polls
make sure they are displayed for the right contexts only.
Also (to be committed as followup cleanup): Remove now unused special
handling for assets in file delete operator.
Differential Revision: https://developer.blender.org/D12062
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 616e7fe51db..944eb9988fa 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -2830,20 +2830,10 @@ static bool file_delete_single(const FileSelectParams *params, FileDirEntry *file, const char **r_error_message) { - if (file->typeflag & FILE_TYPE_ASSET) { - ID *id = filelist_file_get_id(file); - if (!id) { - *r_error_message = "File is not a local data-block asset."; - return false; - } - ED_asset_clear_id(id); - } - else { - char str[FILE_MAX]; - BLI_join_dirfile(str, sizeof(str), params->dir, file->relpath); - if (BLI_delete_soft(str, r_error_message) != 0 || BLI_exists(str)) { - return false; - } + char str[FILE_MAX]; + BLI_join_dirfile(str, sizeof(str), params->dir, file->relpath); + if (BLI_delete_soft(str, r_error_message) != 0 || BLI_exists(str)) { + return false; } return true; |