[Bf-committers] Blender Python changes

Thomas Dinges blender at dingto.org
Wed Oct 26 10:33:19 CEST 2016


This again shows the importance of testing the RC versions (or even 
earlier the testbuilds).


Am 26.10.2016 um 10:29 schrieb Bastien Montagne:
> But would have been much, much nicer to have
> that kind of topic raised *before* we release. Because now we for sure
> cannot do anything about it, which is rather frustrating for everybody.
>
> Regards,
> Bastien
>
> Le 26/10/2016 à 09:18, Kai Kostack a écrit :
>> Dear Blender devs,
>>
>> I'd like to provide some feedback about a recent change in BPY... OK, and share
>> some frustration about it. ;)
>>
>> Just until recently you could unlink a lot of datablock types via their
>> corresponding remove() methods without any problems. Now with Blender 2.78
>> someone has decided to change some of these methods in a way that they throw an
>> exception when there are still other users left on a default unlink attempt:
>> "RuntimeError: Error: Text 'export.txt' must have zero users to be removed,
>> found 1 (try with do_unlink=True parameter)"
>>
>> I thought, "Okaaay, just another parameter to add, no problem." - Why that
>> would be necessary, since you could have checked for other users anyway before
>> unlinking, was beyond me. - But then I realized that there are 27 datablock
>> types that use an updated remove() method while others remained unchanged. I
>> have like 100 scripts for Blender 2.76 at my disposal and ca. 30 of them have
>> at least one ".remove(" in the code. "Wow, that's a lot of scripts that might
>> have been broken by now", I thought. Note that you can't easily go over them
>> and add the parameter because not all remove methods of Blender would accept it
>> (not to mention general Python list removes). So I had to look up each and
>> every line with 'remove' in the API if they were changed or not. That was fun.
>>    
>> While the scripts will (probably) all work by now again, I got first complains
>> that some of my Add-ons wouldn't work with 2.77 builds anymore. Great. To make
>> a long story short, I have decided to implement BOTH ways of calling remove via
>> try & except now, just to make sure the code will work in both versions, 2.77
>> and 2.78.
>>    
>> I remember a statement along the lines that breaking things will be postponed
>> until 2.8 and that 2.7x should be kept in a working state. - This is not a call
>> to change it back, I just want to give you a glimpse of what seemingly appears
>> to be a clever and small change in design can mean to users, and that they
>> eventually have to include more and more workarounds and hacks just to
>> circumvent your 'clever design' to make things just work. Sometimes less is
>> more.
>>
>> With respect,
>>
>> -- Kai
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> https://lists.blender.org/mailman/listinfo/bf-committers
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers



More information about the Bf-committers mailing list