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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-10-06 20:48:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-10-06 20:48:28 +0400
commitdda63a9dde8600f85e43bc4d654cbe80d07cab6e (patch)
tree76010b4123957872bba0dbcd399da90e590ddfff /source
parentaaaae785276e287d9a30a005d14af61524845d72 (diff)
added comparison function to many python types so you can do == and =!
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Armature.c22
-rw-r--r--source/blender/python/api2_2x/Constraint.c13
-rw-r--r--source/blender/python/api2_2x/Curve.c13
-rw-r--r--source/blender/python/api2_2x/Font.c3
-rwxr-xr-xsource/blender/python/api2_2x/Group.c9
-rw-r--r--source/blender/python/api2_2x/Image.c4
-rw-r--r--source/blender/python/api2_2x/Ipo.c12
-rw-r--r--source/blender/python/api2_2x/Ipocurve.c12
-rw-r--r--source/blender/python/api2_2x/Key.c9
-rw-r--r--source/blender/python/api2_2x/Lamp.c3
-rw-r--r--source/blender/python/api2_2x/Lattice.c10
-rw-r--r--source/blender/python/api2_2x/Material.c9
-rw-r--r--source/blender/python/api2_2x/Mesh.c7
-rw-r--r--source/blender/python/api2_2x/NLA.c11
-rw-r--r--source/blender/python/api2_2x/Object.c3
-rw-r--r--source/blender/python/api2_2x/Pose.c6
-rw-r--r--source/blender/python/api2_2x/Scene.c6
-rw-r--r--source/blender/python/api2_2x/Sound.c3
-rw-r--r--source/blender/python/api2_2x/Text.c3
-rw-r--r--source/blender/python/api2_2x/World.c3
-rw-r--r--source/blender/python/api2_2x/doc/Object.py2
21 files changed, 122 insertions, 41 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index c7886340dc7..fb8200c6c8e 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -1060,13 +1060,21 @@ AttributeError:
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
sArmatureBadArgs, " __init__: ", "Expects string(name)");
}
-//------------------------tp_richcompare
-//This method allows the object to use comparison operators
-//TODO: We need some armature comparisons
-static PyObject *Armature_richcmpr(BPy_Armature *self, PyObject *v, int op)
+
+
+/*****************************************************************************/
+/* Function: Armature_compare */
+/* Description: This is a callback function for the BPy_Armature type. It */
+/* compares two Armature_Type objects. Only the "==" and "!=" */
+/* comparisons are meaninful. Returns 0 for equality and -1 if */
+/* they don't point to the same Blender Object struct. */
+/* In Python it becomes 1 if they are equal, 0 otherwise. */
+/*****************************************************************************/
+static int Armature_compare( BPy_Armature * a, BPy_Armature * b )
{
- return EXPP_incr_ret(Py_None);
+ return ( a->armature == b->armature ) ? 0 : -1;
}
+
//------------------------tp_repr
//This is the string representation of the object
static PyObject *Armature_repr(BPy_Armature *self)
@@ -1093,7 +1101,7 @@ PyTypeObject Armature_Type = {
0, //tp_print
0, //tp_getattr
0, //tp_setattr
- 0, //tp_compare
+ (cmpfunc) Armature_compare, //tp_compare
(reprfunc) Armature_repr, //tp_repr
0, //tp_as_number
0, //tp_as_sequence
@@ -1108,7 +1116,7 @@ PyTypeObject Armature_Type = {
BPy_Armature_doc, //tp_doc
0, //tp_traverse
0, //tp_clear
- (richcmpfunc)Armature_richcmpr, //tp_richcompare
+ 0, //tp_richcompare
0, //tp_weaklistoffset
0, //tp_iter
0, //tp_iternext
diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c
index 357fb34f7e3..2657ed51a72 100644
--- a/source/blender/python/api2_2x/Constraint.c
+++ b/source/blender/python/api2_2x/Constraint.c
@@ -181,6 +181,7 @@ static PyMappingMethods Constraint_as_mapping = {
/*****************************************************************************/
static void Constraint_dealloc( BPy_Constraint * self );
static PyObject *Constraint_repr( BPy_Constraint * self );
+static int Constraint_compare( BPy_Constraint * a, BPy_Constraint * b );
/*****************************************************************************/
/* Python Constraint_Type structure definition: */
@@ -199,7 +200,7 @@ PyTypeObject Constraint_Type = {
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
+ ( cmpfunc ) Constraint_compare, /* cmpfunc tp_compare; */
( reprfunc ) Constraint_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
@@ -1276,6 +1277,16 @@ static void Constraint_dealloc( BPy_Constraint * self )
PyObject_DEL( self );
}
+
+/*****************************************************************************/
+/* Function: Constraint_compare */
+/* Description: This compares 2 constraint python types, == or != only. */
+/*****************************************************************************/
+static int Constraint_compare( BPy_Constraint * a, BPy_Constraint * b )
+{
+ return ( a->con == b->con ) ? 0 : -1;
+}
+
/*****************************************************************************/
/* Function: Constraint_repr */
/* Description: This is a callback function for the BPy_Constraint type. It */
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c
index 7d7ba84e585..9c25bd44a3d 100644
--- a/source/blender/python/api2_2x/Curve.c
+++ b/source/blender/python/api2_2x/Curve.c
@@ -241,6 +241,7 @@ static void CurveDeAlloc( BPy_Curve * msh );
/* static int CurvePrint (BPy_Curve *msh, FILE *fp, int flags); */
static int CurveSetAttr( BPy_Curve * msh, char *name, PyObject * v );
static PyObject *CurveGetAttr( BPy_Curve * msh, char *name );
+static int CurveCopmpare( BPy_Curve * a, BPy_Curve * b );
static PyObject *CurveRepr( BPy_Curve * msh );
static PySequenceMethods Curve_as_sequence = {
@@ -271,7 +272,7 @@ PyTypeObject Curve_Type = {
0, /* tp_print */
( getattrfunc ) CurveGetAttr, /* tp_getattr */
( setattrfunc ) CurveSetAttr, /* tp_setattr */
- 0, /* tp_compare */
+ ( cmpfunc ) CurveCopmpare, /* tp_compare */
( reprfunc ) CurveRepr, /* tp_repr */
/* methods for standard classes */
0, /* tp_as_number */
@@ -1663,6 +1664,16 @@ static int CurveSetAttr( BPy_Curve * self, char *name, PyObject * value )
/*****************************************************************************/
+/* Function: CurveCopmpare */
+/* Description: This compares 2 curve python types, == or != only. */
+/*****************************************************************************/
+static int CurveCopmpare( BPy_Curve * a, BPy_Curve * b )
+{
+ return ( a->curve == b->curve ) ? 0 : -1;
+}
+
+
+/*****************************************************************************/
/* Function: CurveRepr */
/* Description: This is a callback function for the BPy_Curve type. It */
/* builds a meaninful string to represent curve objects. */
diff --git a/source/blender/python/api2_2x/Font.c b/source/blender/python/api2_2x/Font.c
index 142ee038bff..b4f37332523 100644
--- a/source/blender/python/api2_2x/Font.c
+++ b/source/blender/python/api2_2x/Font.c
@@ -435,8 +435,7 @@ static PyObject *Font_repr( BPy_Font * self )
/*--------------- compare------------------------------------------*/
static int Font_compare( BPy_Font * a, BPy_Font * b )
{
- VFont *pa = a->font, *pb = b->font;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->font == b->font ) ? 0 : -1;
}
/*--------------- Font_CreatePyObject---------------------------------*/
diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c
index 805381e1912..7c5e230f9ce 100755
--- a/source/blender/python/api2_2x/Group.c
+++ b/source/blender/python/api2_2x/Group.c
@@ -491,8 +491,7 @@ PyObject *M_Group_Unlink( PyObject * self, PyObject * args )
unlink_group(group);
group->id.us= 0;
free_libblock( &G.main->group, group );
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -527,7 +526,7 @@ PyObject *Group_CreatePyObject( struct Group * grp )
BPy_Group *pygrp;
if( !grp )
- return EXPP_incr_ret( Py_None );
+ Py_RETURN_NONE;
pygrp =
( BPy_Group * ) PyObject_NEW( BPy_Group, &Group_Type );
@@ -746,7 +745,7 @@ static PyObject *GroupObSeq_add( BPy_GroupObSeq * self, PyObject *args )
add_to_group_wraper(self->bpygroup->group, blen_ob); /* this checks so as not to add the object into the group twice*/
- return EXPP_incr_ret( Py_None );
+ Py_RETURN_NONE;
}
@@ -776,7 +775,7 @@ static PyObject *GroupObSeq_remove( BPy_GroupObSeq * self, PyObject *args )
if (base)
base->flag &= ~OB_FROMGROUP;
}
- return EXPP_incr_ret( Py_None );
+ Py_RETURN_NONE;
}
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c
index bd3c76c1ee5..16e537e37d4 100644
--- a/source/blender/python/api2_2x/Image.c
+++ b/source/blender/python/api2_2x/Image.c
@@ -70,7 +70,6 @@ current image frame, some images change frame if they are a sequence */
static PyObject *M_Image_New( PyObject * self, PyObject * args );
static PyObject *M_Image_Get( PyObject * self, PyObject * args );
static PyObject *M_Image_GetCurrent( PyObject * self );
-static PyObject *M_Image_SetCurrent( PyObject * self, PyObject * args );
static PyObject *M_Image_Load( PyObject * self, PyObject * args );
@@ -1261,8 +1260,7 @@ static int Image_setAttr( BPy_Image * self, char *name, PyObject * value )
/*****************************************************************************/
static int Image_compare( BPy_Image * a, BPy_Image * b )
{
- Image *pa = a->image, *pb = b->image;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->image == b->image ) ? 0 : -1;
}
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c
index 1ad9f45ee0e..0ed1a84ed01 100644
--- a/source/blender/python/api2_2x/Ipo.c
+++ b/source/blender/python/api2_2x/Ipo.c
@@ -228,6 +228,7 @@ static PySequenceMethods Ipo_as_sequence = {
/*****************************************************************************/
static void Ipo_dealloc( BPy_Ipo * self );
//static int IpoPrint (BPy_Ipo *self, FILE *fp, int flags);
+static int Ipo_compare( BPy_Ipo * a, BPy_Ipo * b );
static PyObject *Ipo_repr( BPy_Ipo * self );
static PyObject *Ipo_getIter( BPy_Ipo * self );
static PyObject *Ipo_nextIter( BPy_Ipo * self );
@@ -365,7 +366,7 @@ PyTypeObject Ipo_Type = {
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
+ ( reprfunc ) Ipo_compare, /* cmpfunc tp_compare; */
( reprfunc ) Ipo_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
@@ -1303,6 +1304,15 @@ static void Ipo_dealloc( BPy_Ipo * self )
}
/*****************************************************************************/
+/* Function: Ipo_compare */
+/* Description: This compares 2 ipo python types, == or != only. */
+/*****************************************************************************/
+static int Ipo_compare( BPy_Ipo * a, BPy_Ipo * b )
+{
+ return ( a->ipo == b->ipo ) ? 0 : -1;
+}
+
+/*****************************************************************************/
/* Function: Ipo_repr */
/* Description: This is a callback function for the BPy_Ipo type. It */
/* builds a meaningful string to represent ipo objects. */
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c
index 4a7fe47db29..96111d7012c 100644
--- a/source/blender/python/api2_2x/Ipocurve.c
+++ b/source/blender/python/api2_2x/Ipocurve.c
@@ -175,6 +175,7 @@ static PyMappingMethods IpoCurve_as_mapping = {
/*****************************************************************************/
/* Python IpoCurve_Type callback function prototypes: */
/*****************************************************************************/
+static int IpoCurve_compare( C_IpoCurve * a, C_IpoCurve * b );
static PyObject *IpoCurve_repr( C_IpoCurve * self );
static void IpoCurve_dealloc( C_IpoCurve * self );
@@ -192,7 +193,7 @@ PyTypeObject IpoCurve_Type = {
0, /* tp_print */
( getattrfunc ) NULL, /* tp_getattr */
( setattrfunc ) NULL, /* tp_setattr */
- 0, /* tp_compare */
+ ( cmpfunc ) IpoCurve_compare, /* tp_compare */
( reprfunc ) IpoCurve_repr, /* tp_repr */
/* Method suites for standard classes */
@@ -647,6 +648,15 @@ static void IpoCurve_dealloc( C_IpoCurve * self )
}
/*****************************************************************************/
+/* Function: IpoCurve_compare */
+/* Description: This compares 2 python types, == or != only. */
+/*****************************************************************************/
+static int IpoCurve_compare( C_IpoCurve * a, C_IpoCurve * b )
+{
+ return ( a->ipocurve == b->ipocurve ) ? 0 : -1;
+}
+
+/*****************************************************************************/
/* Function: IpoCurve_repr */
/* Description: This is a callback function for the C_IpoCurve type. It */
/* builds a meaningful string to represent ipocurve objects. */
diff --git a/source/blender/python/api2_2x/Key.c b/source/blender/python/api2_2x/Key.c
index 32d7bc26191..0630fe6cf3e 100644
--- a/source/blender/python/api2_2x/Key.c
+++ b/source/blender/python/api2_2x/Key.c
@@ -61,6 +61,7 @@
static void Key_dealloc( PyObject * self );
static void KeyBlock_dealloc( PyObject * self );
+static int Key_compare( BPy_Key * a, BPy_Key * b );
static PyObject *Key_repr( BPy_Key * self );
static PyObject *Key_getBlocks( PyObject * self );
@@ -138,7 +139,7 @@ PyTypeObject Key_Type = {
( printfunc ) 0, /*tp_print */
( getattrfunc ) 0, /*tp_getattr */
( setattrfunc ) 0, /*tp_setattr */
- 0, /*tp_compare*/
+ ( cmpfunc) Key_compare, /*tp_compare*/
( reprfunc ) Key_repr, /* tp_repr */
/* Method suites for standard classes */
@@ -306,6 +307,12 @@ PyObject *Key_CreatePyObject( Key * k )
return ( PyObject * ) key;
}
+
+static int Key_compare( BPy_Key * a, BPy_Key * b )
+{
+ return ( a->key == b->key ) ? 0 : -1;
+}
+
static PyObject *Key_repr( BPy_Key * self )
{
return PyString_FromFormat( "[Key \"%s\"]", self->key->id.name + 2 );
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c
index 03bb7e2fe30..5d334abf398 100644
--- a/source/blender/python/api2_2x/Lamp.c
+++ b/source/blender/python/api2_2x/Lamp.c
@@ -1431,8 +1431,7 @@ static void Lamp_dealloc( BPy_Lamp * self )
/*****************************************************************************/
static int Lamp_compare( BPy_Lamp * a, BPy_Lamp * b )
{
- Lamp *pa = a->lamp, *pb = b->lamp;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->lamp == b->lamp ) ? 0 : -1;
}
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/Lattice.c b/source/blender/python/api2_2x/Lattice.c
index cceb536efd7..8ff6634ae57 100644
--- a/source/blender/python/api2_2x/Lattice.c
+++ b/source/blender/python/api2_2x/Lattice.c
@@ -193,6 +193,7 @@ static void Lattice_dealloc( BPy_Lattice * self );
static int Lattice_setAttr( BPy_Lattice * self, char *name, PyObject * v );
static PyObject *Lattice_getAttr( BPy_Lattice * self, char *name );
static PyObject *Lattice_repr( BPy_Lattice * self );
+static int Lattice_compare( BPy_Lattice * a, BPy_Lattice * b );
/*****************************************************************************/
/* Python Lattice_Type structure definition: */
@@ -208,7 +209,7 @@ PyTypeObject Lattice_Type = {
0, /* tp_print */
( getattrfunc ) Lattice_getAttr, /* tp_getattr */
( setattrfunc ) Lattice_setAttr, /* tp_setattr */
- 0, /* tp_compare */
+ ( cmpfunc ) Lattice_compare, /* tp_compare */
( reprfunc ) Lattice_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -927,6 +928,13 @@ static int Lattice_setAttr( BPy_Lattice * self, char *name, PyObject * value )
return 0; // normal exit
}
+
+static int Lattice_compare( BPy_Lattice * a, BPy_Lattice * b )
+{
+ return ( a->Lattice == b->Lattice ) ? 0 : -1;
+}
+
+
//***************************************************************************
// Function: Lattice_repr
// Description: This is a callback function for the BPy_Lattice type. It
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c
index 663a3cd45b5..0d4405483f2 100644
--- a/source/blender/python/api2_2x/Material.c
+++ b/source/blender/python/api2_2x/Material.c
@@ -1081,6 +1081,7 @@ static PyGetSetDef BPy_Material_getseters[] = {
/* Python Material_Type callback function prototypes: */
/*****************************************************************************/
static void Material_dealloc( BPy_Material * self );
+static int Material_compare( BPy_Material * a, BPy_Material * b);
static PyObject *Material_repr( BPy_Material * self );
/*****************************************************************************/
@@ -1100,7 +1101,7 @@ PyTypeObject Material_Type = {
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
+ ( cmpfunc ) Material_compare,/* cmpfunc tp_compare; */
( reprfunc ) Material_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
@@ -2501,6 +2502,12 @@ static PyObject *Material_copy( BPy_Material * self )
return ( PyObject * ) pymat;
}
+/* mat_a==mat_b or mat_a!=mat_b*/
+static int Material_compare( BPy_Material * a, BPy_Material * b )
+{
+ return ( a->material == b->material) ? 0 : -1;
+}
+
/*****************************************************************************/
/* Function: Material_repr */
/* Description: This is a callback function for the BPy_Material type. It */
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c
index bd8545aad3b..299c999e643 100644
--- a/source/blender/python/api2_2x/Mesh.c
+++ b/source/blender/python/api2_2x/Mesh.c
@@ -7361,6 +7361,11 @@ static void Mesh_dealloc( BPy_Mesh * self )
PyObject_DEL( self );
}
+static int Mesh_compare( BPy_Mesh * a, BPy_Mesh * b )
+{
+ return ( a->mesh == b->mesh ) ? 0 : -1;
+}
+
static PyObject *Mesh_repr( BPy_Mesh * self )
{
return PyString_FromFormat( "[Mesh \"%s\"]",
@@ -7472,7 +7477,7 @@ PyTypeObject Mesh_Type = {
NULL, /* printfunc tp_print; */
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
+ ( cmpfunc ) Mesh_compare, /* cmpfunc tp_compare; */
( reprfunc ) Mesh_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
index e7503ce9912..f729d2cf99b 100644
--- a/source/blender/python/api2_2x/NLA.c
+++ b/source/blender/python/api2_2x/NLA.c
@@ -124,8 +124,10 @@ static PyMethodDef BPy_Action_methods[] = {
static void Action_dealloc( BPy_Action * bone );
static PyObject *Action_getAttr( BPy_Action * bone, char *name );
static int Action_setAttr( BPy_Action * bone, char *name, PyObject * v );
+static int Action_compare( BPy_Action * a, BPy_Action * b );
static PyObject *Action_repr( BPy_Action * bone );
+
/*****************************************************************************/
/* Python TypeAction structure definition: */
/*****************************************************************************/
@@ -140,7 +142,7 @@ PyTypeObject Action_Type = {
0, /* tp_print */
( getattrfunc ) Action_getAttr, /* tp_getattr */
( setattrfunc ) Action_setAttr, /* tp_setattr */
- 0, /* tp_compare */
+ ( cmpfunc ) Action_compare, /* tp_compare */
( reprfunc ) Action_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -496,6 +498,13 @@ static int Action_setAttr( BPy_Action * self, char *name, PyObject * value )
}
/*----------------------------------------------------------------------*/
+static int Action_compare( BPy_Action * a, BPy_Action * b )
+{
+ return ( a->action == b->action ) ? 0 : -1;
+}
+
+
+/*----------------------------------------------------------------------*/
static PyObject *Action_repr( BPy_Action * self )
{
if( self->action )
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index c1ac3ef1c33..f26b5dd2b76 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -3061,8 +3061,7 @@ static void Object_dealloc( BPy_Object * obj )
/*****************************************************************************/
static int Object_compare( BPy_Object * a, BPy_Object * b )
{
- Object *pa = a->object, *pb = b->object;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->object == b->object ) ? 0 : -1;
}
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/Pose.c b/source/blender/python/api2_2x/Pose.c
index 6429696b864..39086a14881 100644
--- a/source/blender/python/api2_2x/Pose.c
+++ b/source/blender/python/api2_2x/Pose.c
@@ -332,6 +332,12 @@ static void Pose_dealloc(BPy_Pose *self)
Pose_Type.tp_free(self);
return;
}
+//------------------------tp_cmp
+//This compares 2 pose types
+static int Pose_compare(BPy_Pose *a, BPy_Pose *b )
+{
+ return ( a->pose== b->pose ) ? 0 : -1;
+}
//------------------------tp_repr
//This is the string representation of the object
static PyObject *Pose_repr(BPy_Pose *self)
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
index ae3ec459c5d..ed6eea6e4da 100644
--- a/source/blender/python/api2_2x/Scene.c
+++ b/source/blender/python/api2_2x/Scene.c
@@ -356,8 +356,7 @@ static int Scene_setAttr( BPy_Scene * self, char *name, PyObject * value )
/*-----------------------compare----------------------------------------*/
static int Scene_compare( BPy_Scene * a, BPy_Scene * b )
{
- Scene *pa = a->scene, *pb = b->scene;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->scene == b->scene ) ? 0 : -1;
}
/*----------------------repr--------------------------------------------*/
@@ -1548,8 +1547,7 @@ static void SceneObSeq_dealloc( BPy_SceneObSeq * self )
static int SceneObSeq_compare( BPy_SceneObSeq * a, BPy_SceneObSeq * b )
{
- Scene *pa = a->bpyscene->scene, *pb = b->bpyscene->scene;
- return ( pa == pb && a->mode == b->mode) ? 0 : -1;
+ return ( a->bpyscene->scene == b->bpyscene->scene && a->mode == b->mode) ? 0 : -1;
}
/*
diff --git a/source/blender/python/api2_2x/Sound.c b/source/blender/python/api2_2x/Sound.c
index 65680f63d7e..166645eb99c 100644
--- a/source/blender/python/api2_2x/Sound.c
+++ b/source/blender/python/api2_2x/Sound.c
@@ -632,8 +632,7 @@ static int Sound_setAttr( BPy_Sound * self, char *name, PyObject * value )
/*****************************************************************************/
static int Sound_compare( BPy_Sound * a, BPy_Sound * b )
{
- bSound *pa = a->sound, *pb = b->sound;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->sound == b->sound ) ? 0 : -1;
}
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c
index ab7a1561f58..b5a5f7cf21d 100644
--- a/source/blender/python/api2_2x/Text.c
+++ b/source/blender/python/api2_2x/Text.c
@@ -638,8 +638,7 @@ static int Text_setAttr( BPy_Text * self, char *name, PyObject * value )
/*****************************************************************************/
static int Text_compare( BPy_Text * a, BPy_Text * b )
{
- Text *pa = a->text, *pb = b->text;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->text == b->text ) ? 0 : -1;
}
/*****************************************************************************/
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c
index 6d097ba62e2..eaf2fb2fd93 100644
--- a/source/blender/python/api2_2x/World.c
+++ b/source/blender/python/api2_2x/World.c
@@ -1033,8 +1033,7 @@ static int World_SetAttr( BPy_World * self, char *name, PyObject * value )
static int World_Compare( BPy_World * a, BPy_World * b )
{
- World *pa = a->world, *pb = b->world;
- return ( pa == pb ) ? 0 : -1;
+ return ( a->world == b->world ) ? 0 : -1;
}
/**
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index aa190386db6..b22b87f5e13 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -465,7 +465,7 @@ class Object:
@type drawType: int
@ivar parentType: The object's parent type. Read-only.
See L{ParentTypes} constant dict for values.
- @type drawType: int
+ @type parentType: int
@ivar axis: Enable display of active object's center and axis.
Also see B{AXIS} bit in L{drawMode} attribute.
@type axis: boolean