29#include "RNA_prototypes.hh"
44#if (defined(__GNUC__) && !defined(__clang__))
45# pragma GCC diagnostic push
46# pragma GCC diagnostic ignored "-Wcast-function-type"
55#if (defined(__GNUC__) && !defined(__clang__))
56# pragma GCC diagnostic pop
61 Py_VISIT(
self->data_rna);
67 Py_CLEAR(
self->data_rna);
73 PyObject_GC_UnTrack(
self);
74 Py_CLEAR(
self->data_rna);
75 PyObject_GC_Del(
self);
78 PyVarObject_HEAD_INIT(
nullptr, 0)
79 "bpy_rna_data_context",
97 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
131 bpy_rna_data_context_load_doc,
132 ".. method:: temp_data(filepath=None)\n"
134 " A context manager that temporarily creates blender file data.\n"
136 " :arg filepath: The file path for the newly temporary data. "
137 "When None, the path of the currently open file is used.\n"
138 " :type filepath: str | bytes | None\n"
140 " :return: Blend file data which is freed once the context exists.\n"
141 " :rtype: :class:`bpy.types.BlendData`\n");
147 static const char *_keywords[] = {
"filepath",
nullptr};
148 static _PyArg_Parser _parser = {
156 if (!_PyArg_ParseTupleAndKeywordsFast(
167 return (PyObject *)
ret;
178 PyObject_GC_Track(
self);
180 return (PyObject *)
self->data_rna;
190#if (defined(__GNUC__) && !defined(__clang__))
191# pragma GCC diagnostic push
192# pragma GCC diagnostic ignored "-Wcast-function-type"
198 METH_STATIC | METH_VARARGS | METH_KEYWORDS,
199 bpy_rna_data_context_load_doc,
202#if (defined(__GNUC__) && !defined(__clang__))
203# pragma GCC diagnostic pop
Main * BKE_main_new(void)
void BKE_main_free(Main *bmain)
#define STRNCPY(dst, src)
#define RNA_POINTER_INVALIDATE(ptr)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
int BPY_rna_data_context_type_ready()
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
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_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(ID *id, StructRNA *type, void *data)
PyObject_HEAD BPy_StructRNA * data_rna