Blender V5.3
BKE_asset_edit.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
26
27#include <optional>
28#include <string>
29
30#include "BLI_string_ref.hh"
31
32#include "DNA_ID_enums.h"
33
34namespace blender {
35
38struct ID;
39struct Main;
40struct ReportList;
41
42namespace bke {
43
45ID *asset_edit_id_from_weak_reference(Main &global_main,
46 ID_Type id_type,
47 const AssetWeakReference &weak_ref);
48
50std::optional<AssetWeakReference> asset_edit_weak_reference_from_id(const ID &id);
51
53
54bool asset_edit_id_is_editable(const ID &id);
55bool asset_edit_id_is_writable(const ID &id);
56
57std::optional<std::string> asset_edit_id_save_as(Main &global_main,
58 const ID &id,
59 StringRefNull name,
60 const bUserAssetLibrary &user_library,
61 AssetWeakReference &r_weak_ref,
62 ReportList &reports);
63
64bool asset_edit_id_save(Main &global_main, ID &id, ReportList &reports);
65
74bool asset_edit_id_rename(Main &global_main,
75 ID &id,
76 StringRefNull new_name,
77 const bUserAssetLibrary &user_library,
78 ReportList &reports);
79
85ID *asset_edit_id_revert(Main &global_main, ID &id, ReportList &reports);
86bool asset_edit_id_delete(Main &global_main, ID &id, ReportList &reports);
87
89ID *asset_edit_id_find_local(Main &global_main, ID &id);
94ID *asset_edit_id_ensure_local(Main &global_main, ID &id);
95
96} // namespace bke
97} // namespace blender
Enumerations for DNA_ID.h.
ID * asset_edit_id_from_weak_reference(Main &global_main, ID_Type id_type, const AssetWeakReference &weak_ref)
std::optional< AssetWeakReference > asset_edit_weak_reference_from_id(const ID &id)
bool asset_edit_id_save(Main &global_main, ID &id, ReportList &reports)
std::optional< std::string > asset_edit_id_save_as(Main &global_main, const ID &id, StringRefNull name, const bUserAssetLibrary &user_library, AssetWeakReference &r_weak_ref, ReportList &reports)
ID * asset_edit_id_revert(Main &global_main, ID &id, ReportList &reports)
bool asset_edit_id_delete(Main &global_main, ID &id, ReportList &reports)
ID * asset_edit_id_find_local(Main &global_main, ID &id)
bool asset_edit_id_rename(Main &global_main, ID &id, StringRefNull new_name, const bUserAssetLibrary &user_library, ReportList &reports)
bool asset_edit_id_is_writable(const ID &id)
ID * asset_edit_id_ensure_local(Main &global_main, ID &id)
bool asset_edit_id_is_editable(const ID &id)
BMesh Iterators.