Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/mathutils/mathutils_Vector.c
| Show First 20 Lines • Show All 3,259 Lines • ▼ Show 20 Lines | #endif | ||||
| NULL, /* descrsetfunc tp_descr_set; */ | NULL, /* descrsetfunc tp_descr_set; */ | ||||
| 0, /* long tp_dictoffset; */ | 0, /* long tp_dictoffset; */ | ||||
| NULL, /* initproc tp_init; */ | NULL, /* initproc tp_init; */ | ||||
| NULL, /* allocfunc tp_alloc; */ | NULL, /* allocfunc tp_alloc; */ | ||||
| Vector_new, /* newfunc tp_new; */ | Vector_new, /* newfunc tp_new; */ | ||||
| /* Low-level free-memory routine */ | /* Low-level free-memory routine */ | ||||
| NULL, /* freefunc tp_free; */ | NULL, /* freefunc tp_free; */ | ||||
| /* For PyObject_IS_GC */ | /* For PyObject_IS_GC */ | ||||
| NULL, /* inquiry tp_is_gc; */ | (inquiry)BaseMathObject_is_gc, /* inquiry tp_is_gc; */ | ||||
| NULL, /* PyObject *tp_bases; */ | NULL, /* PyObject *tp_bases; */ | ||||
| /* method resolution order */ | /* method resolution order */ | ||||
| NULL, /* PyObject *tp_mro; */ | NULL, /* PyObject *tp_mro; */ | ||||
| NULL, /* PyObject *tp_cache; */ | NULL, /* PyObject *tp_cache; */ | ||||
| NULL, /* PyObject *tp_subclasses; */ | NULL, /* PyObject *tp_subclasses; */ | ||||
| NULL, /* PyObject *tp_weaklist; */ | NULL, /* PyObject *tp_weaklist; */ | ||||
| NULL, | NULL, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
| PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype) | PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype) | ||||
| { | { | ||||
| VectorObject *self = (VectorObject *)Vector_CreatePyObject(NULL, vec_num, NULL); | VectorObject *self = (VectorObject *)Vector_CreatePyObject(NULL, vec_num, NULL); | ||||
| if (self) { | if (self) { | ||||
| Py_INCREF(cb_user); | Py_INCREF(cb_user); | ||||
| self->cb_user = cb_user; | self->cb_user = cb_user; | ||||
| self->cb_type = cb_type; | self->cb_type = cb_type; | ||||
| self->cb_subtype = cb_subtype; | self->cb_subtype = cb_subtype; | ||||
| BLI_assert(!PyObject_GC_IsTracked((PyObject *)self)); | |||||
| PyObject_GC_Track(self); | PyObject_GC_Track(self); | ||||
| } | } | ||||
| return (PyObject *)self; | return (PyObject *)self; | ||||
| } | } | ||||
| PyObject *Vector_CreatePyObject_alloc(float *vec, const int vec_num, PyTypeObject *base_type) | PyObject *Vector_CreatePyObject_alloc(float *vec, const int vec_num, PyTypeObject *base_type) | ||||
| { | { | ||||
| Show All 10 Lines | |||||