24 #include "RNA_prototypes.h"
47 Py_VISIT(
self->data_rna);
53 Py_CLEAR(
self->data_rna);
59 PyObject_GC_UnTrack(
self);
60 Py_CLEAR(
self->data_rna);
61 PyObject_GC_Del(
self);
65 PyVarObject_HEAD_INIT(
NULL, 0)
"bpy_rna_data_context",
97 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
144 ".. method:: temp_data(filepath=None)\n"
146 " A context manager that temporarily creates blender file data.\n"
148 " :arg filepath: The file path for the newly temporary data. "
149 "When None, the path of the currently open file is used.\n"
150 " :type filepath: str or NoneType\n"
152 " :return: Blend file data which is freed once the context exists.\n"
153 " :rtype: :class:`bpy.types.BlendData`\n");
158 const char *filepath =
NULL;
159 static const char *_keywords[] = {
"filepath",
NULL};
160 static _PyArg_Parser _parser = {
167 if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, &filepath)) {
175 return (PyObject *)
ret;
186 PyObject_GC_Track(
self);
188 return (PyObject *)
self->data_rna;
201 METH_STATIC | METH_VARARGS | METH_KEYWORDS,
202 bpy_rna_data_context_load_doc,
struct Main * BKE_main_new(void)
void BKE_main_free(struct Main *mainvar)
#define STRNCPY(dst, src)
#define RNA_POINTER_INVALIDATE(ptr)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
static PyObject * bpy_rna_data_context_exit(BPy_DataContext *self, PyObject *args)
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 int bpy_rna_data_context_traverse(BPy_DataContext *self, visitproc visit, void *arg)
PyMethodDef BPY_rna_data_context_method_def
static void bpy_rna_data_context_dealloc(BPy_DataContext *self)
static PyMethodDef bpy_rna_data_context_methods[]
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 *self, PyObject *args, PyObject *kwds)
int BPY_rna_data_context_type_ready(void)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PyObject_HEAD BPy_StructRNA * data_rna