diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-12-27 08:04:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-12-27 08:04:20 +0300 |
commit | 9afe662c125fec5cf62b3976bf32194838f0d740 (patch) | |
tree | 97fc847b9379eef836801dcafad0cd92e38cb371 /source/blender/python/api2_2x/World.c | |
parent | ed2f161c72722b90a1c4e15f998ca678b79e94b0 (diff) |
renameing datablocks was imposing a name limit on the python side.
This isnt needed because the limit is alredy being set by rename_id()
some other minor changed- use None returning maro
Diffstat (limited to 'source/blender/python/api2_2x/World.c')
-rw-r--r-- | source/blender/python/api2_2x/World.c | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 742a70c21b4..e4fb48ed20d 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -382,10 +382,9 @@ static PyObject *M_World_Get( PyObject * self, PyObject * args ) static PyObject *M_World_GetCurrent( PyObject * self ) { BPy_World *w = NULL; - if( !G.scene->world ) { - Py_INCREF( Py_None ); - return Py_None; - } + if( !G.scene->world ) + Py_RETURN_NONE; + w = ( BPy_World * ) PyObject_NEW( BPy_World, &World_Type ); w->world = G.scene->world; return ( PyObject * ) w; @@ -436,8 +435,7 @@ static PyObject *World_setRange( BPy_World * self, PyObject * args ) return ( EXPP_ReturnPyObjError ( PyExc_TypeError, "expected a float argument" ) ); self->world->range = range; - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -445,10 +443,8 @@ static PyObject *World_getIpo( BPy_World * self ) { struct Ipo *ipo = self->world->ipo; - if( !ipo ) { - Py_INCREF( Py_None ); - return Py_None; - } + if( !ipo ) + Py_RETURN_NONE; return Ipo_CreatePyObject( ipo ); } @@ -484,8 +480,7 @@ static PyObject *World_setIpo( BPy_World * self, PyObject * args ) self->world->ipo = ipo; - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } static PyObject *World_clearIpo( BPy_World * self ) @@ -530,15 +525,12 @@ static PyObject *World_getName( BPy_World * self ) static PyObject *World_setName( BPy_World * self, PyObject * args ) { char *name = 0; - char buf[21]; if( !PyArg_ParseTuple( args, "s", &name ) ) return ( EXPP_ReturnPyObjError ( PyExc_TypeError, "expected string argument" ) ); - snprintf( buf, sizeof( buf ), "%s", name ); - rename_id( &self->world->id, buf ); + rename_id( &self->world->id, name ); - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -577,8 +569,7 @@ static PyObject *World_setSkytype( BPy_World * self, PyObject * args ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, "expected int argument" ) ); self->world->skytype = (short)skytype; - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -614,8 +605,7 @@ static PyObject *World_setMode( BPy_World * self, PyObject * args ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, "expected int argument" ) ); self->world->mode = (short)mode; - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -663,8 +653,7 @@ static PyObject *World_setMistype( BPy_World * self, PyObject * args ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, "expected int argument" ) ); self->world->mistype = (short)mistype; - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -693,8 +682,7 @@ static PyObject *World_setHor( BPy_World * self, PyObject * args ) self->world->horr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) ); self->world->horg = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) ); self->world->horb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) ); - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -720,8 +708,7 @@ static PyObject *World_setZen( BPy_World * self, PyObject * args ) self->world->zenr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) ); self->world->zeng = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) ); self->world->zenb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) ); - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -755,8 +742,7 @@ static PyObject *World_setAmb( BPy_World * self, PyObject * args ) self->world->ambr = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 0 ) ); self->world->ambg = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) ); self->world->ambb = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) ); - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -800,8 +786,7 @@ static PyObject *World_setStar( BPy_World * self, PyObject * args ) (float)PyFloat_AsDouble( PyList_GetItem( listargs, 5 ) ); self->world->starcolnoise = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 6 ) ); - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } @@ -842,8 +827,7 @@ static PyObject *World_setMist( BPy_World * self, PyObject * args ) (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) ); self->world->misthi = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) ); - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } /* world.addScriptLink */ @@ -896,8 +880,7 @@ static PyObject *World_setCurrent( BPy_World * self ) G.scene->world->id.us--; world->id.us++; G.scene->world = world; - Py_INCREF( Py_None ); - return Py_None; + Py_RETURN_NONE; } /* world.__copy__ */ @@ -1179,5 +1162,5 @@ static PyObject *World_insertIpoKey( BPy_World * self, PyObject * args ) EXPP_allqueue(REDRAWACTION, 0); EXPP_allqueue(REDRAWNLA, 0); - return EXPP_incr_ret( Py_None ); + Py_RETURN_NONE; } |