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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user