[Bf-committers] re: Python and layers

Campbell Barton cbarton at metavr.com
Mon Oct 9 17:54:34 CEST 2006


Ken Hughes wrote:
> Alexander Ewering wrote:
>>
>> On Tue, 10 Oct 2006, Campbell Barton wrote:
>>
>>> Thanks Matt, this makes more sense now.
>>> Im not sure what the solution should be..
>>>
>>> scn1.Layers= scn2.Layers should never raise an error IMHO. so maybe 
>>> let the user effect the next 12 bits?
>>>
>>> That or allow the users to set it but  dont apply the setting of the 
>>> last 12 bits.
>>> that means after scn1.Layers != scn2.Layers  which could be 
>>> confusing :/.
>>
>> If there is a way to "recode" the "=", "==" and "!=" operators in 
>> python (??),
>> they should all be recoded (for the scn.Layers case) to affect *and*
>> compare just the lower 20 bits. Then, all is well, and nothing in 
>> Blender
>> needs to be modified, + no potential crasher functionality is exposed to
>> Python coders.
>
> So if the other bits are not "layer" bits, why not just mask what is 
> return from the getter and similarly "OR" those bits in the setter?
>
> Ken

Sounds good to me,
Matt, making ~ behave is good but probably should also set the bits 
correctly on loading (DO version) since its possible an old file's ~ 
gives a messed up layer bits.
 - Cam


More information about the Bf-committers mailing list