Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-12-27 08:04:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2006-12-27 08:04:20 +0300
commit9afe662c125fec5cf62b3976bf32194838f0d740 (patch)
tree97fc847b9379eef836801dcafad0cd92e38cb371 /source/blender/python/api2_2x/Lattice.c
parented2f161c72722b90a1c4e15f998ca678b79e94b0 (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/Lattice.c')
-rw-r--r--source/blender/python/api2_2x/Lattice.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/source/blender/python/api2_2x/Lattice.c b/source/blender/python/api2_2x/Lattice.c
index 297da2edd8d..0837773b8a2 100644
--- a/source/blender/python/api2_2x/Lattice.c
+++ b/source/blender/python/api2_2x/Lattice.c
@@ -255,7 +255,6 @@ int Lattice_CheckPyObject( PyObject * pyobj )
static PyObject *M_Lattice_New( PyObject * self, PyObject * args )
{
char *name = NULL;
- char buf[21];
Lattice *bl_Lattice; // blender Lattice object
PyObject *py_Lattice; // python wrapper
@@ -275,10 +274,8 @@ static PyObject *M_Lattice_New( PyObject * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't create Lattice Object wrapper" );
- if( name ) {
- PyOS_snprintf( buf, sizeof( buf ), "%s", name );
- rename_id( &bl_Lattice->id, buf );
- }
+ if( name )
+ rename_id( &bl_Lattice->id, name );
return py_Lattice;
}
@@ -393,18 +390,14 @@ static PyObject *Lattice_getName( BPy_Lattice * self )
static PyObject *Lattice_setName( BPy_Lattice * self, PyObject * args )
{
char *name;
- char buf[21];
if( !PyArg_ParseTuple( args, "s", &name ) )
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
"expected string argument" ) );
- PyOS_snprintf( buf, sizeof( buf ), "%s", name );
-
- rename_id( &self->Lattice->id, buf );
+ rename_id( &self->Lattice->id, name );
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Lattice_setPartitions( BPy_Lattice * self, PyObject * args )
@@ -426,8 +419,7 @@ static PyObject *Lattice_setPartitions( BPy_Lattice * self, PyObject * args )
resizelattice(bl_Lattice, x, y, z, NULL);
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Lattice_getPartitions( BPy_Lattice * self )
@@ -446,9 +438,8 @@ static PyObject *Lattice_getKey( BPy_Lattice * self )
if (key)
return Key_CreatePyObject(key);
- else {
- return EXPP_incr_ret(Py_None);
- }
+ else
+ Py_RETURN_NONE;
}
static PyObject *Lattice_getKeyTypes( BPy_Lattice * self )
@@ -538,8 +529,7 @@ static PyObject *Lattice_setKeyTypes( BPy_Lattice * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"type must be LINEAR, CARDINAL OR BSPLINE" );
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Lattice_setMode( BPy_Lattice * self, PyObject * args )
@@ -561,8 +551,7 @@ static PyObject *Lattice_setMode( BPy_Lattice * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"type must be either GRID or OUTSIDE" );
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Lattice_getMode( BPy_Lattice * self )
@@ -639,8 +628,7 @@ static PyObject *Lattice_setPoint( BPy_Lattice * self, PyObject * args )
bpoint->vec[x] = tempInt;
}
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Lattice_getPoint( BPy_Lattice * self, PyObject * args )
@@ -714,8 +702,7 @@ static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
if( frame > 0 )
G.scene->r.cfra = (int)oldfra;
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Lattice_copy( BPy_Lattice * self )