[Bf-python] Layer handling inconsistant

Gilbert, Joseph jgilbert at tigr.org
Mon Apr 18 16:37:54 CEST 2005


 
-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Campbell
Barton
Sent: Sunday, April 17, 2005 9:31 PM
To: Blender Foundation Python list
Subject: [Bf-python] Layer handling inconsistant
 
At the moment Window.ViewLayer() and object.later use a different type
of variables and therefor cant be interchanged.

ob.layer is a flag and Window.ViewLayer() is a list
There realy shouldent be any issues with
I want me new object to be on the current visible layers, or - change my
object to the visible layers.

At the moment I have got around this by converting  this list into a
flag.

    # Get the layer flag, this should realy be a part of blender.
    layerFlag = 0
    for l in Window.ViewLayer():
        layerFlag |= 2 ** l-1 # Get the flag of the layer index
    ob.layer = layerFlag

Mabe there needs to be a flag option for ViewLayer
Window.ViewLayer(flag=1)

Is this acceptable?
- Cam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20050418/0280547f/attachment.html>


More information about the Bf-python mailing list