<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
>From python object docs<br>
<br>
<b>The object layer. This value is a bitmask with one position set for
each of the 20 possible layers starting from the low order bit. The
easiest way to deal with these values in in hexadecimal notation.
Example:
</b>
<pre class="literalblock"><b> ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
</b></pre>
<br>
So ob.layer is a flag, and objects can Exist on Multiple layers (Try
moving to another layer with M pressing shift while selecting multiple
layers)<br>
<br>
The flag is what blender uses internally, I have become used to using
binary logic in python- and it seems you need to be when python
functions are returning flags.<br>
<br>
There realy needs to be a way to get the view flag of the active
layers, having the user generate the flag themself is realy dumb.<br>
- Cam<br>
<br>
<br>
<br>
Joseph Gilbert wrote:
<blockquote cite="mid4265BE78.3030005@paposo.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
Hehe.  Well ViewLayer() returns the list of visible layers and ob.layer
shows the layer the object is visible on (i didn't write either of
these <span class="moz-smiley-s14"><span> O:-)  </span></span>) You
can't do a ob.layer = ViewLayer(). Doesn't make sense. Objects need to
be on a single layer. (correct me here if i'm wrong). If what you want
is a test to see which layer is visible and move and object to it, you
need to test for ob.layer in the list returned by Window.ViewLayer().
Right? <br>
  <br>
if ob.layer in Window.ViewLayer():<br>
  ob.layer = Window.ViewLayer()[0]<br>
  <br>
or something should work right?<br>
  <br>
  <br>
Campbell Barton wrote:
  <blockquote cite="mid42643971.4090607@metavr.com" type="cite">
    <meta content="text/html;charset=ISO-8859-1"
 http-equiv="Content-Type">
    <title></title>
Stephen Swaney wrote:
    <blockquote cite="mid20050418112255.A23910@ratbyte" type="cite">
      <pre wrap="">On Mon, Apr 18, 2005 at 10:53:44AM -0400, Gilbert, Joseph wrote:
  </pre>
      <blockquote type="cite">
        <pre wrap="">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().
    </pre>
      </blockquote>
      <pre wrap=""><!---->
I would rather see overloaded argument lists like this than flags to
change the return type of a method.

  </pre>
    </blockquote>
I dont think its ideal for have ob.layer accepting both formats of
layers is ideal.<br>
What if they want to see of the object is equel to the view layers?<br>
    <br>
if ob.layer != Window.ViewLayer(): # Would Not work<br>
    <br>
would need to do<br>
    <br>
oldlayer = ob.layer<br>
ob.layer = Window.ViewLayer()<br>
visLayer = ob.layer<br>
ob.layer = oldlayer<br>
if oldLayer != visLayer: # This would work.<br>
    .....<br>
    <br>
    <pre wrap=""><hr size="4" width="90%">
_______________________________________________
Bf-python mailing list
<a class="moz-txt-link-abbreviated"
 href="mailto:Bf-python@projects.blender.org">Bf-python@projects.blender.org</a>
<a class="moz-txt-link-freetext"
 href="http://projects.blender.org/mailman/listinfo/bf-python">http://projects.blender.org/mailman/listinfo/bf-python</a>
  </pre>
  </blockquote>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Bf-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-python@projects.blender.org">Bf-python@projects.blender.org</a>
<a class="moz-txt-link-freetext" href="http://projects.blender.org/mailman/listinfo/bf-python">http://projects.blender.org/mailman/listinfo/bf-python</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    <a class="moz-txt-link-freetext" href="http://www.metavr.com">http://www.metavr.com</a>
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:cbarton@metavr.com">cbarton@metavr.com</a>
phone: AU (03) 5229 0241
</pre>
</body>
</html>