This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenkernel/BKE_blender_copybuffer.h
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

76 lines
2.3 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
*/
#include "BLI_sys_types.h"
#ifdef __cplusplus
extern "C" {
#endif
struct ID;
struct Main;
struct ReportList;
struct bContext;
/* Copy-buffer (wrapper for BKE_blendfile_write_partial). */
/**
* Initialize a copy operation.
*/
void BKE_copybuffer_copy_begin(struct Main *bmain_src);
/**
* Mark an ID to be copied. Should only be called after a call to #BKE_copybuffer_copy_begin.
*/
void BKE_copybuffer_copy_tag_ID(struct ID *id);
/**
* 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.
*/
bool BKE_copybuffer_copy_end(struct Main *bmain_src,
const char *filename,
struct ReportList *reports);
/**
* 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.
*/
bool BKE_copybuffer_read(struct Main *bmain_dst,
const char *libname,
struct ReportList *reports,
uint64_t id_types_mask);
/**
* 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).
*/
int BKE_copybuffer_paste(struct bContext *C,
const char *libname,
int flag,
struct ReportList *reports,
uint64_t id_types_mask);
#ifdef __cplusplus
}
#endif