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/Armature.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/blender/python/api2_2x/Armature.c') diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index 409a0b90643..49c7c6639d4 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -988,7 +988,7 @@ static PyObject *Armature_new(PyTypeObject *type, PyObject *args, PyObject *kwds BPy_Armature *py_armature = NULL; bArmature *bl_armature; - bl_armature = add_armature(); + bl_armature = add_armature("Armature"); if(bl_armature) { bl_armature->id.us = 0; // return count to 0 - add_armature() inc'd it @@ -1246,13 +1246,12 @@ static PyObject *M_Armature_New(PyObject * self, PyObject * args) char *name = "Armature"; struct bArmature *armature; BPy_Armature *obj; - char buf[21]; if( !PyArg_ParseTuple( args, "|s", &name ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected nothing or a string as argument" ); - armature= add_armature(); + armature= add_armature(name); armature->id.us = 0; obj = (BPy_Armature *)Armature_CreatePyObject(armature); /*new*/ @@ -1260,9 +1259,6 @@ static PyObject *M_Armature_New(PyObject * self, PyObject * args) return EXPP_ReturnPyObjError( PyExc_RuntimeError, "PyObject_New() failed" ); - PyOS_snprintf( buf, sizeof( buf ), "%s", name ); - rename_id( &armature->id, buf ); - obj->armature = armature; return (PyObject *)obj; } -- cgit v1.2.3