Blender V4.3
BKE_blendfile_link_append.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
10#include <list>
11#include <string>
12
13#include "BLI_bit_vector.hh"
14#include "BLI_function_ref.hh"
15#include "BLI_map.hh"
16
17#include "BLO_readfile.hh"
18
19struct BlendHandle;
20struct ID;
21struct Library;
24struct ReportList;
25
26/* TODO: Rename file to `BKE_blendfile_import.hh`. */
27/* TODO: Replace `BlendfileLinkAppend` prefix by `blender::bke::blendfile::import` namespace. */
28/* TODO: Move these enums to scoped enum classes. */
29
31enum {
37};
38
40enum {
58};
59
60/* NOTE: These three structs are currently exposed in header to allow for their usage in RNA.
61 * Regular C++ code should not access their content directly.
62 *
63 * TODO: Refactor these three structs into classes, and integrated the whole API into them. */
65
104
107 std::string path; /* Absolute .blend file path. */
108 BlendHandle *blo_handle; /* Blend file handle, if any. */
109 bool blo_handle_is_owned; /* Whether the blend file handle is owned, or borrowed. */
110 /* The blendfile report associated with the `blo_handle`, if owned. */
112};
113
125 std::list<BlendfileLinkAppendContextItem> items;
126 using items_iterator_t = std::list<BlendfileLinkAppendContextItem>::iterator;
129
134 enum class ProcessStage {
139 Init = 0,
141 Linking,
146 Appending,
156 Done,
157
158 /* NOTE: For the time being, liboverride step is not considered here (#BKE_blendfile_override).
159 * Mainly because it is only available through the BPY API currently. */
160 };
162
165
168
170 const void *blendfile_mem = nullptr;
172};
173
191 int flag,
192 bool do_set);
193
201 BlendfileLinkAppendContext *lapp_context, const void *blendfile_mem, int blendfile_memsize);
204 BlendfileLinkAppendContext *lapp_context);
205
219 const char *libname,
220 BlendHandle *blo_handle);
232 BlendfileLinkAppendContext *lapp_context, const char *idname, short idcode, void *userdata);
233
234#define BLENDFILE_LINK_APPEND_INVALID -1
250 BlendfileLinkAppendContext *lapp_context,
251 ReportList *reports,
252 uint64_t id_types_filter,
253 int library_index);
254
260 BlendfileLinkAppendContext *lapp_context,
262 int library_index);
267
278 ID *new_id);
283
294
304 BlendfileLinkAppendContext *lapp_context,
311 BlendfileLinkAppendContextItem *item)> callback_function,
313
320
324void BKE_blendfile_link(BlendfileLinkAppendContext *lapp_context, ReportList *reports);
325
334
339 ReportList *reports);
340
347
370
384 const eBKELibLinkOverride flags,
385 ReportList *reports);
386
410 ReportList *reports,
411 Library *library,
412 bool do_reload);
external readfile function prototypes.
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
unsigned __int64 uint64_t
Definition stdint.h:90
BlendfileLinkAppendContext * lapp_context
MainLibraryWeakReferenceMap * library_weak_reference_mapping
std::list< BlendfileLinkAppendContextItem >::iterator items_iterator_t
blender::Map< ID *, BlendfileLinkAppendContextItem * > new_id_to_item
blender::Vector< BlendfileLinkAppendContextLibrary > libraries
std::list< BlendfileLinkAppendContextItem > items
Definition DNA_ID.h:413
uint8_t flag
Definition wm_window.cc:138