Blender
V3.3
|
#include <Python.h>
#include <stddef.h>
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "bpy_rna.h"
#include "bpy_rna_data.h"
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 *kwds) |
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 or NoneType\n" "\n" " :return: Blend file data which is freed once the context exists.\n" " :rtype: :class:`bpy.types.BlendData`\n") | |
static PyObject * | bpy_rna_data_temp_data (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
static PyObject * | bpy_rna_data_context_exit (BPy_DataContext *self, PyObject *UNUSED(args)) |
int | BPY_rna_data_context_type_ready (void) |
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.c.
|
static |
Definition at line 51 of file bpy_rna_data.c.
References self.
|
static |
Definition at line 57 of file bpy_rna_data.c.
References self.
|
static |
Definition at line 178 of file bpy_rna_data.c.
References BKE_main_new(), NULL, ptr, pyrna_struct_CreatePyObject(), and RNA_pointer_create().
|
static |
|
static |
Definition at line 191 of file bpy_rna_data.c.
References BKE_main_free(), RNA_POINTER_INVALIDATE, and self.
|
static |
Definition at line 45 of file bpy_rna_data.c.
References self.
int BPY_rna_data_context_type_ready | ( | void | ) |
Definition at line 205 of file bpy_rna_data.c.
References bpy_rna_data_context_Type.
Referenced by BPy_init_modules().
|
static |
|
static |
Definition at line 155 of file bpy_rna_data.c.
References bpy_rna_data_context_Type, G_MAIN, NULL, ret, and STRNCPY.
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 or NoneType\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 198 of file bpy_rna_data.c.
Referenced by BPY_rna_types_extend_capi().
|
static |
Definition at line 39 of file bpy_rna_data.c.
|
static |
Definition at line 64 of file bpy_rna_data.c.
Referenced by BPY_rna_data_context_type_ready(), and bpy_rna_data_temp_data().