[Bf-funboard] toolbox
Ton Roosendaal
bf-funboard@blender.org
Fri, 24 Oct 2003 12:51:13 +0200
Hi,
Off topic, but first check this for fun:
http://www.blender.org/docs/ton/subsurf.html
I've been working on display of Meshes, in 'object mode' or editmode.
Works all a lot better! Please restrict feedback on improvements for
this until after the 2.30 (pre) release of next week conference time.
Not because I dont want feedback, but just because I cant handle it now!
The topic:
http://www.blender.org/bf/tb.jpg
I worked at a generic and very easy menu 'script' system, that can be
completely constructed by a non-coder as well. Plus of course
dynamically by Python. In the end of this mail you can find the full
code for the entire Add menu. It includes support for icons and
mentioning hotkeys as well.
I coded a little engine that interprets the data, and feeds that to the
current Blender UI system. The sample code below actually creates
*working* menus.
Three things:
1. The current UI system only has standard pulldowns and buttons menus
possible. I will restrict my work now in creating a basic working
structure, which still will have its limitations. But it can
efficiently replace the old toolbox, will do the context switching, and
dynamically build a structure as the 'script' indicates.
2. Anyone now - OK you have to compile code :) - can design menu
structures at 'information design' level. Documentation how the system
works will become available soon.
3. Anyone now, but that will take some coding experience, can write
their own engine to feed the data with. This can be a complete radial
menu, or something based at designs as Thorsten proposed. Thorsten's
concepts have nice features I'd like to work at as well... but cant do
that now.
Please consider this a first step. It is an experiment, we to see more
experiments like this in coming period, and gradually will improve it
all.
I'll make sure binaries with this are available today or tomorrow.
-Ton-
static TBitem addmenu_mesh[]= {
{ 0, "Plane", 0, NULL},
{ 0, "Cube", 1, NULL},
{ 0, "Circle", 2, NULL},
{ 0, "UVsphere", 3, NULL},
{ 0, "Icosphere", 4, NULL},
{ 0, "Cylinder", 5, NULL},
{ 0, "Tube", 6, NULL},
{ 0, "Cone", 7, NULL},
{ 0, "Grid", 8, NULL},
{ 0, "Monkey", 9, NULL},
{ -1, "", UI_RIGHT|UI_CENTRE, do_info_add_meshmenu}};
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", UI_LEFT|UI_CENTRE, do_info_add_curvemenu}};
static TBitem addmenu_surf[]= {
{ 0, "NURBS Curve", 0, NULL},
{ 0, "NURBS Circle", 1, NULL},
{ 0, "NURBS Surface", 2, NULL},
{ 0, "NURBS Tube", 3, NULL},
{ 0, "NURBS Sphere", 4, NULL},
{ 0, "NURBS Donut", 5, NULL},
{ -1, "", UI_RIGHT|UI_CENTRE, do_info_add_surfacemenu}};
static TBitem addmenu_meta[]= {
{ 0, "Meta Ball", 0, NULL},
{ 0, "Meta Tube", 1, NULL},
{ 0, "Meta Plane", 2, NULL},
{ 0, "Meta Ellipsoid", 3, NULL},
{ 0, "Meta Cube", 4, NULL},
{ -1, "", UI_RIGHT|UI_CENTRE, do_info_add_metamenu}};
static TBitem addmenu_ob[]= {
{ 0, "Lattice", 9, NULL},
{ 0, "Armature", 8, NULL},
{ 0, "Lamp", 7, NULL},
{ 0, "Text", 4, NULL},
{ 0, "Camera", 6, NULL},
{ 0, "Empty", 5, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "MBall", 3, addmenu_meta},
{ 0, "Surface", 2, addmenu_surf},
{ 0, "Curve", 1, addmenu_curve},
{ 0, "Mesh", 0, addmenu_mesh},
{ -1, "end", UI_TOP, do_info_addmenu}};
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton@blender.org
http://www.blender.org