diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/asset/asset_list.cc | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_template_asset_view.cc | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/asset/asset_list.cc b/source/blender/editors/asset/asset_list.cc index 3095239b711..e610a1dfbcd 100644 --- a/source/blender/editors/asset/asset_list.cc +++ b/source/blender/editors/asset/asset_list.cc @@ -500,7 +500,7 @@ std::string ED_assetlist_asset_filepath_get(const bContext *C, return {}; } const char *library_path = ED_assetlist_library_path(&library_reference); - if (!library_path) { + if (!library_path && C) { library_path = assetlist_library_path_from_sfile_get_hack(C); } if (!library_path) { diff --git a/source/blender/editors/interface/interface_template_asset_view.cc b/source/blender/editors/interface/interface_template_asset_view.cc index 1d8420718bb..6fa5300401a 100644 --- a/source/blender/editors/interface/interface_template_asset_view.cc +++ b/source/blender/editors/interface/interface_template_asset_view.cc @@ -58,12 +58,10 @@ static void asset_view_item_but_drag_set(uiBut *but, return; } - const blender::StringRef asset_list_path = ED_assetlist_library_path(&list_data->asset_library); char blend_path[FILE_MAX_LIBEXTRA]; + ED_asset_handle_get_full_library_path(NULL, &list_data->asset_library, asset_handle, blend_path); - char path[FILE_MAX_LIBEXTRA]; - BLI_join_dirfile(path, sizeof(path), asset_list_path.data(), asset_handle->file_data->relpath); - if (BLO_library_path_explode(path, blend_path, nullptr, nullptr)) { + if (blend_path[0]) { ImBuf *imbuf = ED_assetlist_asset_image_get(asset_handle); UI_but_drag_set_asset(but, asset_handle->file_data->name, |