[Bf-committers] Integration of scripts in the UI

Willian Padovani Germano bf-committers@blender.org
Sat, 6 Sep 2003 00:45:58 -0300


Hi,

Ok, thinking more and looking at the sources, I believe now I know how to
add a registering mechanism +- like this:

1) Each script wanting to get in should have an Init() method that would set
its options for the gui:
- name
- Menu / submenu / ... path, also Context
- tooltip
- callback (it's possible to register more than one, one for each menu
entry, like Main(), Help(), Configure(), for example, or Export_All(),
Export_Selected() )
- shortcut (better mess with this later, after the ui changes)

2) We look for these Init's upon startup, save all this info in a python
dictionary and only re-register if the time-stamp of the dir (didn't test,
just guessing this should work, if not we do something else) is newer than
last recorded time-stamp.

3) Each relevant menu ends with a function to look if there are registered
python entries for that menu and, if so, add them there.

This should be easy and flexible enough to stay even if things start
changing considerably.

--
Willian, wgermano@ig.com.br