[Bf-python] Problems

maci_ray maci_ray at yahoo.de
Thu Jul 31 07:41:44 CEST 2003


 --- Willian Padovani Germano <wgermano at ig.com.br> schrieb: > On Wed,
2003-07-30 at 09:22, maci_ray wrote:
> > The idea is to have in a script a section called RegisterMe or a class
> > with a method RegisterMe. When called it calls back BPY and registers
> > itself to the menu. On every start of blender (preferably) or every open
> > of the menu, the RegisterMe Method of the found scripts are
> > searched/called.
> > 
> > So the script could decid itself where to appear; without any extra 
> > description files.
> > 
> > Maci_Ray.
> 
> This is similar to one of the possibilities we'll consider: have a
> header as the first line in each "well behaved" script, something like:
> 
> # [Importer] "Format X" v1-0a b2.28
> 
> So, the fields above are:
> 
> # Cathegory | menu entry name | version | minimal Blender version
> 
> just an example, of course.
> 
> That's simpler and faster than a Register mechanism, specially because
> maybe the menu will be recreated (and so the scripts/ dir scanned over
> and over) everytime the menu is redrawn.

But the header mechanism has the drawback, that with one header line, only
one menu entry could be established. Imagine a .py-File with more functions.

Programm code registering has the advantage that you haven't to check
yourself for correctness. Python will tell you. Just expose a python
registering framework.

> For maximum speed, Blender would scan the dir once on startup, put all
> header info in a file there -- like menu.txt or whatever -- and use
> directly this file to generate the menu everytime it was needed.  Of
> course, there'd be a command in the scripts menu to force scanning again
> the scripts/ dir without having to re-start Blender.

I think a full scan at start and then only further scans on demand will do.
Just a weird idea: Build MD5 checksums of the read files. If changed or new
files found, do reregister. Maybe this is so fast, that it can be done on
every redraw.

> Another Register mechanism (menu command in Blender) is also a 
> possibility for "overkill" user-friendliness: the user selects a script
> file and Blender takes care of moving it to the scripts dir.

Maybe that is really overkill. Next can be a script repository, with
preinterpreted scripts ;-)).

> If Blender gets really fancy in the future, it might go itself download
> scripts in an online repository, looking for updates and new stuff ; )
> ...

Oh no. Not that you have to connect to internet for use me way...

Maci_Ray.


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de



More information about the Bf-python mailing list