[Bf-python] typo in epydocs

Gilbert, Joseph jgilbert at tigr.ORG
Thu Jul 28 22:57:26 CEST 2005


You could make 'Layer' a python object which is an inner class of Object
and add it to the Object struct. You can then override it's
tp_richcompare function to take sequences for comparison.  That way you
could do object.layer == 1,3,4,5,6 which would in reality be
object.__getattr__(layer).__cmp__(self(layer), tuple(1,3,4,5,6)).
(or something like that :) )

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Joseph
Eagar
Sent: Thursday, July 28, 2005 3:50 PM
To: Blender Foundation Python list
Subject: Re: [Bf-python] typo in epydocs

Stephen Swaney wrote:

>On Thu, Jul 28, 2005 at 09:19:48PM +1000, Campbell Barton wrote:
>
>  
>
>>Problem is -
>>Layer != Layers
>>
>>Layers is correct, Layer is incorrect.
>>
>>    
>>
>
>Ah, now I get it.  Your eyes are better than mine late at night.
>Just a little bit of legacy code in the doc.  Easy to fix!
>
>Thanks.
>
>  
>
One idea would be to have .layer also accept strings, like say "1,4,6" 
Unfortunately this would like require making a LayerMask object, so I 
don't know if it's feasable. . .

you could, for example, say if ob.layer == "1, 4, 5", and it would parse

the string down into the constituent bitmasks.  Hm.  You know, I could 
do it. . .but I'm not familiar with the updated coding style your all 
working on.

joeedh

_______________________________________________
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