diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-03-16 14:38:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-03-16 14:38:02 +0300 |
commit | bc1fdcd858cc1064fd4b03dac5cc058f22e2b02d (patch) | |
tree | 0205cceea8dbc978db1b7289027268bc3a3035e3 /source/blender/python/api2_2x/NMesh.c | |
parent | c5f4a0a1b063716982d7e50c872894d39b0dea7c (diff) |
type initialization updates, and refcount fix for lamp, reverted some changes to NMesh
Diffstat (limited to 'source/blender/python/api2_2x/NMesh.c')
-rw-r--r-- | source/blender/python/api2_2x/NMesh.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c index 8e25f0e160e..48964a77d07 100644 --- a/source/blender/python/api2_2x/NMesh.c +++ b/source/blender/python/api2_2x/NMesh.c @@ -398,6 +398,11 @@ static int check_NMeshLists( BPy_NMesh *nmesh ) /* Mesh Color Object */ /*****************************/ +static void NMCol_dealloc( PyObject * self ) +{ + PyObject_DEL( self ); +} + static BPy_NMCol *newcol( char r, char g, char b, char a ) { BPy_NMCol *mc = ( BPy_NMCol * ) PyObject_NEW( BPy_NMCol, &NMCol_Type ); @@ -476,7 +481,7 @@ PyTypeObject NMCol_Type = { sizeof( BPy_NMCol ), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ - NULL, /* tp_dealloc */ + ( destructor ) NMCol_dealloc, /* tp_dealloc */ ( printfunc ) 0, /* tp_print */ ( getattrfunc ) NMCol_getattr, /* tp_getattr */ ( setattrfunc ) NMCol_setattr, /* tp_setattr */ @@ -832,6 +837,11 @@ static PyObject *M_NMesh_Vert( PyObject * self, PyObject * args ) return ( PyObject * ) newvert( co ); } +static void NMVert_dealloc( PyObject * self ) +{ + PyObject_DEL( self ); +} + static PyObject *NMVert_getattr( PyObject * self, char *name ) { BPy_NMVert *mv = ( BPy_NMVert * ) self; @@ -983,7 +993,7 @@ PyTypeObject NMVert_Type = { sizeof( BPy_NMVert ), /*tp_basicsize */ 0, /*tp_itemsize */ /* methods */ - NULL, /*tp_dealloc */ + ( destructor ) NMVert_dealloc, /*tp_dealloc */ ( printfunc ) 0, /*tp_print */ ( getattrfunc ) NMVert_getattr, /*tp_getattr */ ( setattrfunc ) NMVert_setattr, /*tp_setattr */ @@ -3347,6 +3357,11 @@ PyObject *NMesh_CreatePyObject( Mesh * me, Object * ob ) return ( PyObject * ) nmesh; } +int NMesh_CheckPyObject( PyObject * pyobj ) +{ + return ( pyobj->ob_type == &NMesh_Type ); +} + Mesh *NMesh_FromPyObject( PyObject * pyobj, Object * ob ) { if( pyobj->ob_type == &NMesh_Type ) { |