29#include "RNA_prototypes.hh"
48# pragma clang diagnostic push
49# pragma clang diagnostic ignored "-Wcast-function-type"
51# pragma GCC diagnostic push
52# pragma GCC diagnostic ignored "-Wcast-function-type"
64# pragma clang diagnostic pop
66# pragma GCC diagnostic pop
84 PyObject_GC_UnTrack(self);
86 PyObject_GC_Del(self);
89 PyVarObject_HEAD_INIT(
nullptr, 0)
90 "bpy_rna_data_context",
108 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
142 bpy_rna_data_context_load_doc,
143 ".. staticmethod:: temp_data(*, filepath=None)\n"
145 " A context manager that temporarily creates blender file data.\n"
147 " :param filepath: The file path for the newly temporary data. "
148 "When None, the path of the currently open file is used.\n"
149 " :type filepath: str | bytes | None\n"
151 " :return: Blend file data which is freed once the context exits.\n"
152 " :rtype: :class:`bpy.types.BlendData`\n");
157 static const char *_keywords[] = {
"filepath",
nullptr};
158 static _PyArg_Parser _parser = {
165 if (!_PyArg_ParseTupleAndKeywordsFast(
172 ret->data_rna =
nullptr;
177 return reinterpret_cast<PyObject *
>(
ret);
183 PyErr_SetString(PyExc_RuntimeError,
"Context manager already entered");
194 BLI_assert(!PyObject_GC_IsTracked((PyObject *)self));
195 PyObject_GC_Track(self);
197 return Py_NewRef(
reinterpret_cast<PyObject *
>(self->
data_rna));
204 PyErr_SetString(PyExc_RuntimeError,
"Context manager not entered");
208 PyErr_SetString(PyExc_RuntimeError,
"Context manager already exited");
219# pragma clang diagnostic push
220# pragma clang diagnostic ignored "-Wcast-function-type"
222# pragma GCC diagnostic push
223# pragma GCC diagnostic ignored "-Wcast-function-type"
230 METH_STATIC | METH_VARARGS | METH_KEYWORDS,
231 bpy_rna_data_context_load_doc,
236# pragma clang diagnostic pop
238# pragma GCC diagnostic pop
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static PyObject * bpy_rna_data_context_exit(BPy_DataContext *self, PyObject *args)
char * STRNCPY(char(&dst)[N], const char *src)
static int bpy_rna_data_context_clear(BPy_DataContext *self)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static PyTypeObject bpy_rna_data_context_Type
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
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 PyMethodDef bpy_rna_data_context_methods[]
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static PyObject * bpy_rna_data_context_enter(BPy_DataContext *self)
void BKE_main_free(Main *bmain)
static void bpy_rna_data_context_dealloc(BPy_DataContext *self)
int PyC_ParseUnicodeAsBytesAndSize_OrNone(PyObject *o, void *p)
int BPY_rna_data_context_type_ready()
header-only compatibility defines.
PyObject_HEAD BPy_StructRNA * data_rna
PyObject_HEAD std::optional< PointerRNA > ptr