[Bf-committers] Declarative UI Experiment

Campbell Barton ideasman42 at gmail.com
Tue Aug 10 05:34:57 CEST 2010

As I feared the 'XML' topic came up, and without replying to each
statement made above lets just say its a very different direction to
the one we have been going in and I can understand resistance.

The original spec for 2.5 was that we would have a UI layout defined in python,
So here are 2 examples of python defined declarative UI's which could
fairly easily co-exist with what we have now.

- basically a python version of the XML panel

- this is python also but relies on having some custom classes defined
which would expand themselves into the data structure above. Its nice
in that it is much easier to read/write, but its also not pure python.

- original XML for reference.

For those who gave the proposal a -1, what about one of the 2 methods above?

2010/8/10 José Romero <jose.cyborg at gmail.com>:
> El Tue, 10 Aug 2010 13:38:22 +1200
> Doug Ollivier <doug at flipdesign.co.nz> escribió:
>> Just to reply to this topic in general.
>> Are we all being "coders here" can we step back from the challenge
>> and ask the question, what is the problem that needs to be overcome?
>> rather than trying to debate languages to replace what has been built
>> *Problem*
>> Python (or any coding language) is somewhat abstracted from the
>> interface as an output.
> Personally, i find Python more readable than XML most of the time in
> real use cases. The only advantage XML would offer over Python would be
> security (since any sane XML parser should be completely immune to code
> injection)
>> *Factors*
>> A) Artists, myself included, are not coders but do want to contribute
>> to the Blender effort and to customise their layouts.
>> B) Python Scripting for a simple interface layout still fits within
>> the realms of coding and thus is daunting for a beginner, but for a
>> complex challenge is an appropriate and powerful solution.
> To me, "coding" requires writing an algorithm, using declarative syntax
> is not more or less "coding" than writing XML.
> Actually, i think the middle ground would be, make a GUI tool for
> "drawing buttons" artists can use to drag and drop their panels as
> their please, that autogenerates python code that can be used right
> away. The other users of custom GUIs, core and extension developers,
> they already are using Python anyway.
>> *User Centred Solution*
>>  From a User Perspective, would it not be ideal to have a GUI editor
>> that pulls blocks together and writes the code?
>>  From a Coders Perspective, would it not be ideal to have Python code
>> as the master/raw document?
>> The above list creates the design brief, the solution should tick all
>> those boxes.  The XML solution by the sounds of it is a fantastic
>> step in the right direction for one of the user groups (The group I
>> fit into), but seems to frustrate the others.
>> Can Pyhton code be generated online via a web app, or a cross
>> platform GUI? i.e actually drag and drop buttons or similar?
> Yes, of course it can, and very well, see wxGlade
> (http://wxglade.sourceforge.net/), it generates well formed (and
> relatively pretty) Python from a GUI. The code uses the wxPython
> module/toolkit to generate the UI.
>> This is a great challenge to overcome.
> Indeed it is :)
>> Doug Ollivier   BDes (Hons)
>> Industrial Designer
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

- Campbell

More information about the Bf-committers mailing list