made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.

also updated the Bpy.py epydocs
This commit is contained in:
2007-03-11 16:25:17 +00:00
parent f84c02429e
commit e0c77c0f14
38 changed files with 143 additions and 160 deletions

View File

@@ -1317,7 +1317,7 @@ static PyGetSetDef Curve_getseters[] = {
static PyObject *M_Curve_New( PyObject * self, PyObject * args )
{
char buf[24];
char *name = NULL;
char *name = "Curve";
BPy_Curve *pycurve; /* for Curve Data object wrapper in Python */
Curve *blcurve = 0; /* for actual Curve Data we create in Blender */
@@ -1326,7 +1326,7 @@ static PyObject *M_Curve_New( PyObject * self, PyObject * args )
( PyExc_TypeError,
"expected string argument or no argument" ) );
blcurve = add_curve( OB_CURVE ); /* first create the Curve Data in Blender */
blcurve = add_curve( name, OB_CURVE ); /* first create the Curve Data in Blender */
if( blcurve == NULL ) /* bail out if add_curve() failed */
return ( EXPP_ReturnPyObjError
@@ -1344,11 +1344,7 @@ static PyObject *M_Curve_New( PyObject * self, PyObject * args )
"couldn't create Curve Data object" ) );
pycurve->curve = blcurve; /* link Python curve wrapper to Blender Curve */
if( name ) {
PyOS_snprintf( buf, sizeof( buf ), "%s", name );
rename_id( &blcurve->id, buf );
}
return ( PyObject * ) pycurve;
}