diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-03-11 19:25:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-03-11 19:25:17 +0300 |
commit | e0c77c0f14f6ad3a742ab7b556ccb46b1ef4fbdf (patch) | |
tree | d3795bc43f7fa7cecf49471a4a72e827a2b24e78 /source/blender/python/api2_2x/Armature.c | |
parent | f84c02429ebc03faca8413d08540fa04d2461b93 (diff) |
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
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 8 |
1 files changed, 2 insertions, 6 deletions
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; } |