2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2016-04-24 14:42:41 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2016-04-24 14:42:41 +02:00
|
|
|
*/
|
|
|
|
|
2020-03-03 17:21:28 +01:00
|
|
|
#include "BLI_sys_types.h"
|
|
|
|
|
2016-04-24 14:42:41 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct ID;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct Main;
|
|
|
|
struct ReportList;
|
|
|
|
struct bContext;
|
2016-04-24 14:42:41 +02:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/* Copy-buffer (wrapper for BKE_blendfile_write_partial). */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a copy operation.
|
|
|
|
*/
|
2021-11-12 10:17:15 +01:00
|
|
|
void BKE_copybuffer_copy_begin(struct Main *bmain_src);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Mark an ID to be copied. Should only be called after a call to #BKE_copybuffer_copy_begin.
|
|
|
|
*/
|
2021-11-12 10:17:15 +01:00
|
|
|
void BKE_copybuffer_copy_tag_ID(struct ID *id);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Finalize a copy operation into given .blend file 'buffer'.
|
|
|
|
*
|
|
|
|
* \param filename: Full path to the .blend file used as copy/paste buffer.
|
|
|
|
*
|
|
|
|
* \return true on success, false otherwise.
|
|
|
|
*/
|
2021-11-12 10:17:15 +01:00
|
|
|
bool BKE_copybuffer_copy_end(struct Main *bmain_src,
|
|
|
|
const char *filename,
|
|
|
|
struct ReportList *reports);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Paste data-blocks from the given .blend file 'buffer' (i.e. append them).
|
|
|
|
*
|
|
|
|
* Unlike #BKE_copybuffer_paste, it does not perform any instantiation of collections/objects/etc.
|
|
|
|
*
|
|
|
|
* \param libname: Full path to the .blend file used as copy/paste buffer.
|
|
|
|
* \param id_types_mask: Only directly link IDs of those types from the given .blend file buffer.
|
|
|
|
*
|
|
|
|
* \return true on success, false otherwise.
|
|
|
|
*/
|
2019-03-25 09:55:36 +01:00
|
|
|
bool BKE_copybuffer_read(struct Main *bmain_dst,
|
|
|
|
const char *libname,
|
|
|
|
struct ReportList *reports,
|
2022-01-07 01:38:08 +01:00
|
|
|
uint64_t id_types_mask);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Paste data-blocks from the given .blend file 'buffer' (i.e. append them).
|
|
|
|
*
|
|
|
|
* Similar to #BKE_copybuffer_read, but also handles instantiation of collections/objects/etc.
|
|
|
|
*
|
|
|
|
* \param libname: Full path to the .blend file used as copy/paste buffer.
|
|
|
|
* \param flag: A combination of #eBLOLibLinkFlags and ##eFileSel_Params_Flag to control
|
|
|
|
* link/append behavior.
|
|
|
|
* \note Ignores #FILE_LINK flag, since it always appends IDs.
|
|
|
|
* \param id_types_mask: Only directly link IDs of those types from the given .blend file buffer.
|
|
|
|
*
|
|
|
|
* \return Number of IDs directly pasted from the buffer
|
|
|
|
* (does not includes indirectly linked ones).
|
|
|
|
*/
|
2019-03-25 09:55:36 +01:00
|
|
|
int BKE_copybuffer_paste(struct bContext *C,
|
|
|
|
const char *libname,
|
2022-01-07 01:38:08 +01:00
|
|
|
int flag,
|
2019-03-25 09:55:36 +01:00
|
|
|
struct ReportList *reports,
|
2022-01-07 01:38:08 +01:00
|
|
|
uint64_t id_types_mask);
|
2016-04-24 14:42:41 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|