[Bf-python] Problems

Peter Amstutz tetron at interreality.org
Thu Jul 31 20:08:22 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 31 Jul 2003, [iso-8859-1] maci_ray wrote:

> 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.

So allow multiple header lines.  Perhaps the header line could specify the
entry function related to that menu item?  If you wanted to get even more
clever, you could describe the script's parameters and have Blender
automatically ask the user for those parameters and pass them into the
start function.  (Emacs has something like this, and we're really trying
to make Blender the Emacs of 3D editing, right? :-)

> 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.

MD5 requires reading in the entire file to build a checksum.  Better to
just rely on the OS file modification times (that's what they're there
for!)  As I mentioned in a previous mail, using fstat() on the directory
to check its modification time allows you to immediately tell if something
has changed, at which point you can do a re-scan to detect what files have
been changed/added/removed.  I like the idea of declaring headers because
it is extremely easy to scan through the file looking for the header
line(s).

[   Peter Amstutz   ][ amstutz at cs.umass.edu ][ tetron at interreality.org  ]
[Lead Programmer][Interreality Project][Virtual Reality for the Internet]
[ VOS: Next Generation Internet Communication][ http://interreality.org ]
[ http://interreality.org/~tetron ][ pgpkey:  pgpkeys.mit.edu  18C21DF7 ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/KVseaeHUyhjCHfcRAn8EAKCEmW6j08lUwRrbiqObcFbK1MpIVgCdHbBd
kNW7cmTbphNwFGPmlqANKsk=
=INIs
-----END PGP SIGNATURE-----




More information about the Bf-python mailing list