<!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">
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>
</body>
</html>