|
Blender V4.3
|
#include <Python.h>#include <cstddef>#include "../generic/py_capi_utils.hh"#include "../generic/python_compat.hh"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_global.hh"#include "BKE_main.hh"#include "RNA_access.hh"#include "RNA_prototypes.hh"#include "bpy_rna.hh"#include "bpy_rna_data.hh"Go to the source code of this file.
Classes | |
| struct | BPy_DataContext |
Functions | |
| static PyObject * | bpy_rna_data_temp_data (PyObject *self, PyObject *args, PyObject *kw) |
| static PyObject * | bpy_rna_data_context_enter (BPy_DataContext *self) |
| static PyObject * | bpy_rna_data_context_exit (BPy_DataContext *self, PyObject *args) |
| static int | bpy_rna_data_context_traverse (BPy_DataContext *self, visitproc visit, void *arg) |
| static int | bpy_rna_data_context_clear (BPy_DataContext *self) |
| static void | bpy_rna_data_context_dealloc (BPy_DataContext *self) |
| PyDoc_STRVAR (bpy_rna_data_context_load_doc, ".. method:: temp_data(filepath=None)\n" "\n" " A context manager that temporarily creates blender file data.\n" "\n" " :arg filepath: The file path for the newly temporary data. " "When None, the path of the currently open file is used.\n" " :type filepath: str | bytes | None\n" "\n" " :return: Blend file data which is freed once the context exists.\n" " :rtype: :class:`bpy.types.BlendData`\n") | |
| int | BPY_rna_data_context_type_ready () |
Variables | |
| static PyMethodDef | bpy_rna_data_context_methods [] |
| static PyTypeObject | bpy_rna_data_context_Type |
| PyMethodDef | BPY_rna_data_context_method_def |
This file defines the API to support temporarily creating Main data. The only use case for this is currently to support temporarily loading data-blocks which can be freed, without them polluting the current G_MAIN.
This is exposed via a context manager bpy.types.BlendData.temp_data(...) which returns a new bpy.types.BlendData that is freed once the context manager exits.
Definition in file bpy_rna_data.cc.
|
static |
Definition at line 65 of file bpy_rna_data.cc.
References self.
|
static |
Definition at line 71 of file bpy_rna_data.cc.
References self.
|
static |
Definition at line 170 of file bpy_rna_data.cc.
References BKE_main_new(), BLI_assert, ptr, pyrna_struct_CreatePyObject(), RNA_pointer_create(), and self.
|
static |
Definition at line 183 of file bpy_rna_data.cc.
References BKE_main_free(), RNA_POINTER_INVALIDATE, and self.
|
static |
Definition at line 59 of file bpy_rna_data.cc.
References self.
| int BPY_rna_data_context_type_ready | ( | void | ) |
Definition at line 206 of file bpy_rna_data.cc.
References bpy_rna_data_context_Type.
Referenced by BPy_init_modules().
|
static |
Definition at line 143 of file bpy_rna_data.cc.
References bpy_rna_data_context_Type, G_MAIN, PY_ARG_PARSER_HEAD_COMPAT, PyC_ParseUnicodeAsBytesAndSize_OrNone(), ret, STRNCPY, PyC_UnicodeAsBytesAndSize_Data::value, and PyC_UnicodeAsBytesAndSize_Data::value_coerce.
| PyDoc_STRVAR | ( | bpy_rna_data_context_load_doc | , |
| ".. method:: temp_data(filepath=None)\n" "\n" " A context manager that temporarily creates blender file data.\n" "\n" " :arg filepath: The file path for the newly temporary data. " "When | None, | ||
| the path of the currently open file is used.\n" " :type filepath:str|bytes|None\n" "\n" " :return:Blend file data which is freed once the context exists.\n" " :rtype::class:`bpy.types.BlendData`\n" | ) |
| PyMethodDef BPY_rna_data_context_method_def |
Definition at line 195 of file bpy_rna_data.cc.
Referenced by BPY_rna_types_extend_capi().
|
static |
Definition at line 49 of file bpy_rna_data.cc.
|
static |
Definition at line 77 of file bpy_rna_data.cc.
Referenced by BPY_rna_data_context_type_ready(), and bpy_rna_data_temp_data().