diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface1D.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface1D.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/source/blender/freestyle/intern/python/Interface1D.cpp b/source/blender/freestyle/intern/python/Interface1D.cpp index 7511401198b..27bb71b2f50 100644 --- a/source/blender/freestyle/intern/python/Interface1D.cpp +++ b/source/blender/freestyle/intern/python/Interface1D.cpp @@ -9,7 +9,7 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// /*--------------- Python API function prototypes for Interface1D instance -----------*/ -static PyObject * Interface1D___new__(PyTypeObject *type, PyObject *args, PyObject *kwds); +static int Interface1D___init__(BPy_Interface1D *self, PyObject *args, PyObject *kwds); static void Interface1D___dealloc__(BPy_Interface1D *self); static PyObject * Interface1D___repr__(BPy_Interface1D *self); @@ -70,7 +70,7 @@ PyTypeObject Interface1D_Type = { NULL, /* PyBufferProcs *tp_as_buffer; */ /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ NULL, /* char *tp_doc; Documentation string */ /*** Assigned meaning in release 2.0 ***/ @@ -101,9 +101,9 @@ PyTypeObject Interface1D_Type = { NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrsetfunc tp_descr_set; */ 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ + (initproc)Interface1D___init__, /* initproc tp_init; */ NULL, /* allocfunc tp_alloc; */ - (newfunc)Interface1D___new__, /* newfunc tp_new; */ + PyType_GenericNew, /* newfunc tp_new; */ /* Low-level free-memory routine */ NULL, /* freefunc tp_free; */ @@ -135,16 +135,10 @@ PyMODINIT_FUNC Interface1D_Init( PyObject *module ) //------------------------INSTANCE METHODS ---------------------------------- -PyObject * Interface1D___new__(PyTypeObject *type, PyObject *args, PyObject *kwds) +int Interface1D___init__(BPy_Interface1D *self, PyObject *args, PyObject *kwds) { - BPy_Interface1D *self; - - self = (BPy_Interface1D *)type->tp_alloc(type, 0); - if (self != NULL) { - self->if1D = new Interface1D(); - } - - return (PyObject *)self; + self->if1D = new Interface1D(); + return 0; } void Interface1D___dealloc__(BPy_Interface1D* self) |