From e0c77c0f14f6ad3a742ab7b556ccb46b1ef4fbdf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 Mar 2007 16:25:17 +0000 Subject: 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 --- source/blender/python/api2_2x/Text.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source/blender/python/api2_2x/Text.c') diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c index 5aae39fb336..d06cd963687 100644 --- a/source/blender/python/api2_2x/Text.c +++ b/source/blender/python/api2_2x/Text.c @@ -143,7 +143,7 @@ static PyObject *Text_repr( BPy_Text * self ); /*****************************************************************************/ static PyObject *M_Text_New( PyObject * self, PyObject * args) { - char *name = NULL; + char *name = "Text"; char buf[21]; int follow = 0; Text *bl_text; /* blender text object */ @@ -153,7 +153,7 @@ static PyObject *M_Text_New( PyObject * self, PyObject * args) return EXPP_ReturnPyObjError( PyExc_AttributeError, "expected string and int arguments (or nothing)" ); - bl_text = add_empty_text( ); + bl_text = add_empty_text( name ); if( bl_text ) { /* do not set user count because Text is already linked */ @@ -170,11 +170,6 @@ static PyObject *M_Text_New( PyObject * self, PyObject * args) if( follow ) bl_text->flags |= EXPP_TEXT_MODE_FOLLOW; - if( name ) { - PyOS_snprintf( buf, sizeof( buf ), "%s", name ); - rename_id( &bl_text->id, buf ); - } - return py_text; } -- cgit v1.2.3