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:
authorWillian Padovani Germano <wpgermano@gmail.com>2003-06-12 08:51:50 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2003-06-12 08:51:50 +0400
commit6cc45538efefe1062aa0bc0909903af3db5d338d (patch)
tree64cb07ec5761c70f06ac15c2d4633dd9602cbcb0 /source/blender/python/api2_2x/Armature.c
parented6885d72891c63c39bb63a0eb936b454fef753c (diff)
* Small changes in many files:
- Trying to fix linking problems in OSX; - Making module .Get functions behave like the ones in Blender 2.25 - 2.27 (Guignot pointed the incompatibility); - Included more types to Blender.Types; - Found by luck and corrected two bugs that were making Blender crash; - Added/updated some simple functions.
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 */