[Bf-committers] UI alignement changes in r59434

Bastien Montagne montagne29 at wanadoo.fr
Sun Sep 29 14:23:24 CEST 2013

Reverting now would certainly be even worse imho, we would have to check 
all places to be sure this would not create more issues, and the reason 
why I did this change (i.e. "search" UI of UILists) would break again. 
Not something to do in bcon4!

Further more, I see absolutely no logic in saying that implicit 
inheritance of such property makes more sense, this was a bug of the 
UILayout code in the first place, because the "align" property of the 
layout itself was never inherited, however the behavior of the code made 
it look as such (only when set to true), with no way to disable it. 
Further more, this behavior was not documented anywhere, afaik.

I don't think we should keep a buggy behavior on the mere reason it has 
been (ab)used as a feature.

Finally, to my knowledge, it is impossible for RNA functions to know 
whether a parameter was explicitly set or is on default value (unlike 
e.g. with operators), so suggested behavior is not possible. And anyway, 
if we wanted to do that, we should absolutely not revert previous 
commits, but rather edit again interface_layout.c to make it *really* 
inherit parent layout's align property.

Imho this would not be worth it, it would introduce a behavior in the 
API not easy to understand, and not standard anywhere in Blender afaik. 
Introducing a parameter which behavior depends on the state of another 
parameter is not a good idea when it can be easily avoided... Especially 
in our UI code, which is already full of twists and tweaks!

I do understand editing big files is not funny, but this is the fate 
when using an API from an app like Blender... Doc though may be an issue 
here, as this change does not actually modifies the API, it just fixes 
its behavior, will check that.


On 29/09/2013 13:54, Thomas Dinges wrote:
> Hi everyone,
> A few weeks ago the behaviour for UI alignement changed:
> https://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59434
> I alreaddy raised concerns back then, but didn't push hard enough, as I
> was unsure myself.
> Well, the main problem here is, that it breakes UIs. For Blender itself,
> various fixes were needed after that commit.
> Let's have an example:
> Before the change, this code was fine:
> col = layout.column(align=True)
> rol = col.row()
> row.prop()
> row.prop()
> As the mother layout (col) was aligned, the sublayouts were too. Now we
> need to specify align=True in the sublayout too, otherwise it's lost.
> rol = col.row(align=True)
> I think we should solve this in the other way. Basically, revert to the
> former behaviour, but allow people to disable the alignement in sublayouts.
> col = layout.column(align=True)
> rol = col.row(align=False)
> row.prop()
> row.prop()
> This would not break the API, and would be more intutitive as well imo.
> I just talked to Jens in IRC, the Luxrender Addon suffers a lot from
> this change, and we both did not find an easy solution to change it
> (easy = not change hundreds of lines manually).
> I am sure more Addons have this problem.  Also I don't see this obvious
> Py API Breackage mentioned anywhere?
> http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.69
> Can we please revert to the former state, and if possible add the
> align=False override possibility?
> Best regards,
> Thomas
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list