[Bf-python] Matrix comparison broken

Gilbert, Joseph T. jgilbert at tigr.ORG
Mon Nov 21 21:49:26 CET 2005


This is default behavior. A == B is by default an instance comparison.
We need to write overloaded comparison operators for the other math
classes.

The problem I see here is what the definition of equivalency is for a
matrix.
i.e. what does a == b supposed to evaluate? Do you mean they have the
exact same numbers? If so to what floating point extent. Is a matrix
equivalent when it describes the same transformation?

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Campbell
Barton
Sent: Monday, November 21, 2005 3:26 PM
Cc: Blender Foundation Python list
Subject: Re: [Bf-python] Matrix comparison broken

instance_a is instance_b - Alredy works for instance comparison,
shouldent we raise an error if its not supported?
It causes bugs to be written into new python code. - and scriptors need
to find out for themselves that its not supported.
or at least print an error message.

- Cam




Gilbert, Joseph T. wrote:
> Because matrix has no overloaded comparison operator like vector. 
> A == b is an instance comparison. It's equivalent to:
> instance_a == instance_b = False
>
>
> -----Original Message-----
> From: bf-python-bounces at projects.blender.org
> [mailto:bf-python-bounces at projects.blender.org] On Behalf Of Campbell
> Barton
> Sent: Monday, November 21, 2005 12:25 PM
> To: bf-python at blender.org
> Subject: [Bf-python] Matrix comparison broken
>
> Entered this into the command line, matrix's never return true when 
> comparing ATM-
> a = Mathutils.Matrix()
> b = Mathutils.Matrix()
> b == a
> False
>
>   


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241

_______________________________________________
Bf-python mailing list
Bf-python at projects.blender.org
http://projects.blender.org/mailman/listinfo/bf-python



More information about the Bf-python mailing list