Blender V4.3
bpy_library_write.cc File Reference
#include <Python.h>
#include <cstddef>
#include "MEM_guardedalloc.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_blendfile.hh"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_report.hh"
#include "BLO_writefile.hh"
#include "RNA_types.hh"
#include "bpy_capi_utils.hh"
#include "bpy_library.hh"
#include "bpy_rna.hh"
#include "../generic/py_capi_utils.hh"
#include "../generic/python_compat.hh"

Go to the source code of this file.

Functions

 PyDoc_STRVAR (bpy_lib_write_doc, ".. method:: write(filepath, datablocks, path_remap=False, fake_user=False, compress=False)\n" "\n" " Write data-blocks into a blend file.\n" "\n" " .. note::\n" "\n" " Indirectly referenced data-blocks will be expanded and written too.\n" "\n" " :arg filepath: The path to write the blend-file.\n" " :type filepath: str | bytes\n" " :arg datablocks: set of data-blocks.\n" " :type datablocks: set[:class:`bpy.types.ID`]\n" " :arg path_remap: Optionally remap paths when writing the file:\n" "\n" " - ``NONE`` No path manipulation (default).\n" " - ``RELATIVE`` Remap paths that are already relative to the new location.\n" " - ``RELATIVE_ALL`` Remap all paths to be relative to the new location.\n" " - ``ABSOLUTE`` Make all paths absolute on writing.\n" "\n" " :type path_remap: str\n" " :arg fake_user: When True, data-blocks will be written with fake-user flag enabled.\n" " :type fake_user: bool\n" " :arg compress: When True, write a compressed blend file.\n" " :type compress: bool\n")
 
static PyObject * bpy_lib_write (BPy_PropertyRNA *self, PyObject *args, PyObject *kw)
 

Variables

PyMethodDef BPY_library_write_method_def
 

Detailed Description

Python API for writing a set of data-blocks into a file. Useful for writing out asset-libraries, defines: bpy.data.libraries.write(...).

Definition in file bpy_library_write.cc.

Function Documentation

◆ bpy_lib_write()

◆ PyDoc_STRVAR()

PyDoc_STRVAR ( bpy_lib_write_doc ,
".. method:: write(filepath, datablocks, path_remap=False, fake_user=False, compress=False)\n" "\n" " Write data-blocks into a blend file.\n" "\n" " .. note::\n" "\n" " Indirectly referenced data-blocks will be expanded and written too.\n" "\n" " :arg filepath: The path to write the blend-file.\n" " :type filepath: str | bytes\n" " :arg datablocks: set of data-blocks.\n" " :type datablocks: set\n" " :arg path_remap: Optionally remap paths when writing the file:\n" "\n" " - ``NONE`` No path manipulation (default).\n" " - ``RELATIVE`` Remap paths that are already relative to the new location.\n" " - ``RELATIVE_ALL`` Remap all paths to be relative to the new location.\n" " - ``ABSOLUTE`` Make all paths absolute on writing.\n" "\n" " :type path_remap: str\n" " :arg fake_user: When True[:class:`bpy.types.ID`],
data-blocks will be written with fake-user flag enabled.\n" " :type fake_user:bool\n" " :arg compress:When True,
write a compressed blend file.\n" " :type compress:bool\n"  )

Variable Documentation

◆ BPY_library_write_method_def

PyMethodDef BPY_library_write_method_def
Initial value:
= {
"write",
(PyCFunction)bpy_lib_write,
METH_VARARGS | METH_KEYWORDS,
bpy_lib_write_doc,
}
static PyObject * bpy_lib_write(BPy_PropertyRNA *self, PyObject *args, PyObject *kw)

Definition at line 185 of file bpy_library_write.cc.

Referenced by BPY_rna_types_extend_capi().