28#include "RNA_prototypes.hh"
45# pragma clang diagnostic push
46# pragma clang diagnostic ignored "-Wcast-function-type"
48# pragma GCC diagnostic push
49# pragma GCC diagnostic ignored "-Wcast-function-type"
61# pragma clang diagnostic pop
63# pragma GCC diagnostic pop
69 Py_VISIT(
self->data_rna);
75 Py_CLEAR(
self->data_rna);
81 PyObject_GC_UnTrack(
self);
82 Py_CLEAR(
self->data_rna);
83 PyObject_GC_Del(
self);
86 PyVarObject_HEAD_INIT(
nullptr, 0)
87 "bpy_rna_data_context",
105 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
139 bpy_rna_data_context_load_doc,
140 ".. method:: temp_data(*, filepath=None)\n"
142 " A context manager that temporarily creates blender file data.\n"
144 " :arg filepath: The file path for the newly temporary data. "
145 "When None, the path of the currently open file is used.\n"
146 " :type filepath: str | bytes | None\n"
148 " :return: Blend file data which is freed once the context exists.\n"
149 " :rtype: :class:`bpy.types.BlendData`\n");
154 static const char *_keywords[] = {
"filepath",
nullptr};
155 static _PyArg_Parser _parser = {
163 if (!_PyArg_ParseTupleAndKeywordsFast(
174 return (PyObject *)
ret;
187 PyObject_GC_Track(
self);
189 return (PyObject *)
self->data_rna;
195 self->data_rna->ptr->invalidate();
201# pragma clang diagnostic push
202# pragma clang diagnostic ignored "-Wcast-function-type"
204# pragma GCC diagnostic push
205# pragma GCC diagnostic ignored "-Wcast-function-type"
212 METH_STATIC | METH_VARARGS | METH_KEYWORDS,
213 bpy_rna_data_context_load_doc,
218# pragma clang diagnostic pop
220# pragma GCC diagnostic pop
void BKE_main_free(Main *bmain)
char * STRNCPY(char(&dst)[N], const char *src)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
int BPY_rna_data_context_type_ready()
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")
static PyObject * bpy_rna_data_context_enter(BPy_DataContext *self)
static int bpy_rna_data_context_clear(BPy_DataContext *self)
static PyTypeObject bpy_rna_data_context_Type
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)
PyMethodDef BPY_rna_data_context_method_def
static PyObject * bpy_rna_data_temp_data(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_rna_data_context_dealloc(BPy_DataContext *self)
static PyMethodDef bpy_rna_data_context_methods[]
int PyC_ParseUnicodeAsBytesAndSize_OrNone(PyObject *o, void *p)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PyObject_HEAD BPy_StructRNA * data_rna