[Bf-python] Layer handling inconsistant

Campbell Barton cbarton at metavr.com
Tue Apr 19 00:49:21 CEST 2005


Stephen Swaney wrote:

>On Mon, Apr 18, 2005 at 10:53:44AM -0400, Gilbert, Joseph wrote:
>  
>
>>ob.layer takes a single int as input. It looks like you want to set the ob.layer to a list of ints returned by viewLayer(). I think the best way to implement this is to have ob.setattr to parse a sequence instead of an "int" value. (see vector() in mathutils) That way ob.layer will accept a single int or a list of values. This approach would allow you to do ob.layer = ViewLayer().
>>    
>>
>
>I would rather see overloaded argument lists like this than flags to
>change the return type of a method.
>
>  
>
I dont think its ideal for have ob.layer accepting both formats of 
layers is ideal.
What if they want to see of the object is equel to the view layers?

if ob.layer != Window.ViewLayer(): # Would Not work

would need to do

oldlayer = ob.layer
ob.layer = Window.ViewLayer()
visLayer = ob.layer
ob.layer = oldlayer
if oldLayer != visLayer: # This would work.
    .....

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20050419/2c3f337c/attachment.html>


More information about the Bf-python mailing list