Blender V4.3
asset_ui_utils.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <string>
10
12
13#include "ED_asset.hh"
14
15namespace blender::ed::asset {
16
17std::string asset_tooltip(const asset_system::AssetRepresentation &asset, const bool include_name)
18{
19 std::string complete_string;
20
21 if (include_name) {
22 complete_string += asset.get_name();
23 }
24
25 const AssetMetaData &meta_data = asset.get_metadata();
26 if (meta_data.description) {
27 complete_string += '\n';
28 complete_string += meta_data.description;
29 }
30 return complete_string;
31}
32
33} // namespace blender::ed::asset
Main runtime representation of an asset.
std::string asset_tooltip(const asset_system::AssetRepresentation &asset, const bool include_name)
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...