bpy.architects team mailing list archive
-
bpy.architects team
-
Mailing list archive
-
Message #00000
Greetings, user interface library, filter layers, python windows
Hi,
First of all thanks to Stani for inviting me to this mailing list. I
have been working on Blender since 2005. During my time I have
contributed in various ways including documentation, translation and
coding work. Since 2008 I have been using Blender professionally in a
university project (1).
Next I'm going to cover following things: 1. possible integration of
user interface library in AR 2. filter layers concept script 3. Python
window type for Blender. The parts kind of depend on each other but
feel free to skip ahead if it seems too long winded. :)
On 2007 I took my first steps towards developing a sketching
application (2). It was a bit bigger project than I initially thought
but it's fun to work on something like this on longer term. One of the
main products of the project was Scocca (3), a user interface library.
It's still very much in progress. Nevertheless the Blender part of it
might make a decent addition to AR on its own.
The current user interface code pretty much wraps the Draw module of
Blender. It also provides a solid collection of utilities, such as
YAML UI parser, to speed up user interface development. Probably the
biggest gain is the way binding of events gets cleaned up. After
initial port the library can be developed further based on needs in
true open source fashion.
One of the main cases that I used during the development of the
Blender part of Scocca was my filter layers concept first represented
at the Blender Conference 2008 (1). Essentially Blender's layer system
is used to show relevant information on the 3D viewport(s). It is a
tool to manage complexity. Unfortunately it is quite limited as it is.
Organizing layers manually takes way too much effort. Filter layers
provide a mean to solve this problem. In this line of thought a layer
represents a collection of filtered set of objects (filtered against
all objects!). So at the simplest level the objects of a given layer
are chosen by the filter clause.
I implemented a simple proof of concept earlier showing the main
advantages of the approach. Next I am planning to integrate bquery (4)
so that it can be used as filter clause. Basically the script should
provide following functionalities at least for now:
1. layer names
2. layer filters
3. renderability/selectability/visibility toggles per layer (see
Blender's outliner! Contradiction (both on and off) is the interesting
case here. :))
4. means to select/deselect layers (synchronized with Blender's layers)
5. save/restore layers
The current proof of concept implements most of these so it's mostly a
matter of adapting the code to use bquery (not hard as all that needs
to be done is to make sure the clause provided by the user gets
evaluated properly). Let me know if I missed some crucial requirement.
:)
As you may well know the usability of Python scripts in Blender is a
bit debatable. It takes always some time to set them up. :) For me it
would be quite essential to be able to use windows defined by Python
(on the simplest level it's just an instance of a scripts window with
a menu entry and a mean to bind it the menu!). Besides filter layers
script described above custom Python window types would be useful for
many other purposes, including property editors, scene browsers and
such, too. Custom windows would also make it more fun to use Python
scripts in Blender as it should be possible to set up scripts to open
as windows this way. (Okay this brings forth the problem of too many
windows! Perhaps there should be a separate menu for Python
windows/scripts?)
I am not exactly sure what they have in mind for 2.50 (coming out
hopefully this year :) ) but implementing Python windows for 2.48/2.49
might be an interesting option. This is true especially because I
doubt I can use 2.50 as my work continues on the August again. This is
something I am willing to take a look at during the June when I am
going to have plenty of free time. Perhaps it's easy to hack in. :)
Anyway here are my initial thoughts. As mentioned if it's alright to
port the user interface part from Scocca to AR, let me know and I will
proceed with it. After a successful port it will be easier to develop
it further as there is something more concrete to discuss and look at.
Also if the Python window concept seems interesting to you, feel free
to help out figuring out proper specifications (ie. what does it need
to do in order to be useful?).
Sincerely,
Juho "bebraw" Vepsäläinen
(1) http://www.blender.org/community/blender-conference/blender-conference-2008/proceedings/
presentation at top right
(2) http://cassopidev.blogspot.com/
(3) https://launchpad.net/scocca
(4) See ar.blender.bquery at http://ar.stani.be/ for more information.
Essentially it's an implementation of jQuery's (http://jquery.com/)
selector syntax for Blender objects.