[Bf-python] ID Properties and python hook scripts
Joe Eagar
joeedh at gmail.com
Tue Oct 10 21:31:20 CEST 2006
Hi. I was thinking about ID properties and stuff, and I realized we're
going to need a way to register trusted scripts. Some sort of generic
system that'd work for scripts drawing custom ID properties guis and
also normal scripts.
Basically, a trusted registered script can do these things:
* It can register a function to call whenever a .blend is loaded (e.g. a
init/re-init function).
* It can register space handler scripts and scriptlinks, which are in
their own class that can't be disabled (though I think an option to
disable the whole trusted script system might be a good idea if people
want it :) )
* It can register a clean-up function that gets called when a different
.blend is loaded.
The trusted script system would also be extendable, so for example ID
properties could use it to handle custom-gui scripts for ID properties
(and wa-hoo! finally panels will have to be wrapped for this to all
work! fun!).
My ideas for implementation, is that all trusted scripts are
prebytecompiled (with some way to get them to recompile themselves, not
sure how). The system would store the list of registered trusted
scripts in a special .B.scripts.
The reasons ID properties custom guis needs this, is that obviously you
don't want your renderman material settings to disappear whenever you
disable scriptlinks :)
Joe
More information about the Bf-python
mailing list