Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_rna_data.c
| Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | |||||
| static PyObject *bpy_rna_data_context_enter(BPy_DataContext *self) | static PyObject *bpy_rna_data_context_enter(BPy_DataContext *self) | ||||
| { | { | ||||
| Main *bmain_temp = BKE_main_new(); | Main *bmain_temp = BKE_main_new(); | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| RNA_pointer_create(NULL, &RNA_BlendData, bmain_temp, &ptr); | RNA_pointer_create(NULL, &RNA_BlendData, bmain_temp, &ptr); | ||||
| self->data_rna = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr); | self->data_rna = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr); | ||||
| BLI_assert(!PyObject_GC_IsTracked((PyObject *)self)); | |||||
| PyObject_GC_Track(self); | PyObject_GC_Track(self); | ||||
| return (PyObject *)self->data_rna; | return (PyObject *)self->data_rna; | ||||
| } | } | ||||
| static PyObject *bpy_rna_data_context_exit(BPy_DataContext *self, PyObject *UNUSED(args)) | static PyObject *bpy_rna_data_context_exit(BPy_DataContext *self, PyObject *UNUSED(args)) | ||||
| { | { | ||||
| BKE_main_free(self->data_rna->ptr.data); | BKE_main_free(self->data_rna->ptr.data); | ||||
| Show All 19 Lines | |||||