[Bf-python] Layer setting problem
Martin Poirier
theeth at yahoo.com
Thu Nov 16 00:19:57 CET 2006
--- Campbell Barton <cbarton at metavr.com> wrote:
> At the moment ob1.Layers = ob2.Layers can raise an
> error if ob1 is in
> localView
> the simple solution is to mask off the last 8 bits
> when getting the
> layers, but this means a script running in Local
> view cant creat a new
> oject in that local view.
>
> Would an acceptable solution be to allow local view
> bits to be set by doing
> ob.Layer = layer & (G.vd->lay & 1<<21-1)
>
> The bad thing about this is that it assumes that the
> object is in the
> current scene. it could be bad for objects in other
> scenes however the
> worst thing is local bits will be set.
I also think that is much too close to the bare metal,
something which abstracts Blender's localview
implementation would be much better. Something like:
sce # Current scene
ob # Object you want to add to local view
sce.AddToLocalView(ob)
which would raise an error if the object is not
already in the scene.
Martin
____________________________________________________________________________________
Sponsored Link
Mortgage rates near 39yr lows.
$310k for $999/mo. Calculate new payment!
www.LowerMyBills.com/lre
More information about the Bf-python
mailing list