added comparison function to many python types so you can do == and =!
This commit is contained in:
@@ -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 */
|
||||
@@ -495,6 +497,13 @@ static int Action_setAttr( BPy_Action * self, char *name, PyObject * value )
|
||||
return 0; /* normal exit */
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int Action_compare( BPy_Action * a, BPy_Action * b )
|
||||
{
|
||||
return ( a->action == b->action ) ? 0 : -1;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
static PyObject *Action_repr( BPy_Action * self )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user