[Bf-committers] Declarative UI Experiment

Campbell Barton ideasman42 at gmail.com
Tue Aug 10 21:28:50 CEST 2010


On Wed, Aug 11, 2010 at 3:47 AM, Elia Sarti <vekoon at gmail.com> wrote:
> I'll try to draft out a proposal/demo tonight.
>
>
> Campbell Barton wrote, on 08/10/2010 05:48 PM:
>> [...]
>>
>> You mention how we could have 1 much more limited way to build UI's,
>> Id need to see some example of this to understand.
>>
>> [...]
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

One interesting thing about the python code thats effectively
declarative (has no conditionals) is that you can extract this into a
declarative format.

We just have to run all the draw() functions without blender and
`fake` the blender api enough so that the execution of the code builds
up the declaration data.

This could be useful to automate converting to markup, but on the
other hand means one of the main advantages with using a markup
language is moot, since we could have draw() functions converted to
XML for editing with a graphical application and then back into python
code (assuming they don't contain conditionals ofcourse).

Heres blenders scripts/ui/*.py extracted into a valid XML by a fake
blender environment constructed for the purpose.

http://www.pasteall.org/14935/xml

The layout tags have a fake ID attribute <module.class>, to identify
them in the list.

-- 
- Campbell


More information about the Bf-committers mailing list