[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12678] branches/imgbrowser-elubie/source/ blender: Doing some more buttons stuff again - intermediate commit working on texture panels
Daniel
danielpgb_vasquez at hotmail.com
Thu Nov 29 22:56:04 CET 2007
Hi!
I must say that the Python solution would be interesting for some points:
The Layout system could be a Python module that wraps the already
existing Draw and maybe BGL modules.
Then, it might be possible to have the UI scripts running in the button
panel.
Cons: need to expose the bound functions to python I guess. (the
functions called by the UI I mean)
need to modify the button windows to support python description.
need to recode the complete entire button window in python.
Pros: The layout engine would be done in Python, which should be fast
enough, no?
Developing in python is faster I think. Smaller code/test cycles?
Syntax closer to that of Swing or wxPython.
Based on existing modules...
Here's my try at it:
######################
#a UI example... syntax is a draft. One can prefer
#the inheritance model (class WorldButtons(BDashBoard): ....)
#That would probably make sytax clearer.
WorldButtons = BDashBoard(BWorldButtons)
#Dashboards are the different button screens in the button window.
#They already have sizer properties (since panels move and get sized in
them. Two options:
# -- pre-defined dashboards = special scripts called by C
declared button
# windows. BWorldButtons is a constant to tesll Blender
that this script
# defines the WorldButtons window. Should be singletons?
# -- dynamic dashboards. allows for adding new dashboards to
blender?
AmbientOcc = BPanel("Ambient Occlusion") # a floating panel
AmbOccSizer = BStackSizer(BHor) #A Horizontal Stack of widgets.
...
SampleSelec = BSlider(1, 16, setAmbOccSamples) # creates a slider with
min, max, and bound function
AmbOccSizer.add(SampleSelect)
...
AmbientOcc.addSizer(AmbOccSizer)
WorldButtons.addPanel(AmbientOcc)s
######################
That's the way I'd see things, but it's late and I'm really tired so I
may not see things straight!
Hope this is useful for the discussion! If it's already too far away
from the immediate objectives, well, no problem :) I'm used to it.
Dani
More information about the Bf-committers
mailing list