Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r--source/blender/python/api2_2x/Armature.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index 997dc4135c1..0abd4e8d777 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -94,7 +94,7 @@ static PyObject *M_Armature_Get(PyObject *self, PyObject *args)
armature_iter = G.main->armature.first;
- /* Use the name to search for the armature requested. */
+ /* Use the name to search for the armature requested. */
if (name) { /* (name) - Search armature by name */
wanted_armature = NULL;
@@ -121,9 +121,9 @@ static PyObject *M_Armature_Get(PyObject *self, PyObject *args)
else
{
- /* Return a list of all armatures in the scene */
+ /* Return a list of with armatures in the scene */
int index = 0;
- PyObject *armlist, *pystr;
+ PyObject *armlist, *pyobj;
armlist = PyList_New (BLI_countlist (&(G.main->armature)));
@@ -132,13 +132,13 @@ static PyObject *M_Armature_Get(PyObject *self, PyObject *args)
"couldn't create PyList"));
while (armature_iter) {
- pystr = PyString_FromString (armature_iter->id.name+2);
+ pyobj = M_ArmatureCreatePyObject (armature_iter);
- if (!pystr)
+ if (!pyobj)
return (PythonReturnErrorObject (PyExc_MemoryError,
"couldn't create PyString"));
- PyList_SET_ITEM (armlist, index, pystr);
+ PyList_SET_ITEM (armlist, index, pyobj);
armature_iter = armature_iter->id.next;
index++;
@@ -345,12 +345,10 @@ static PyObject *ArmatureRepr (C_Armature *self)
/*****************************************************************************/
static int ArmatureCmp (C_Armature *a, C_Armature *b)
{
- if (a<b) return -1;
- else if (a==b) return 0;
- else return 1;
+ bArmature *pa = a->armature, *pb = b->armature;
+ return (pa == pb) ? 0:-1;
}
-
/*****************************************************************************/
/* Function: M_ArmatureCreatePyObject */
/* Description: This function will create a new BlenArmature from an */