[Bf-committers] script links: enable/disable

Willian Padovani Germano wgermano at ig.com.br
Thu Apr 28 18:48:05 CEST 2005


Hi,

"Meeting Minutes April 25th 2005":

>1d) Python
>*IanWill will code an enable/disable script links button,
>implementation details to be discussed on mailing list 
>
Well, I want to add it, let's see if it gets approved : ).  Details:

"OnLoad" script links can be disabled with the "-y" command line option. 
State is saved in the global flags bitmask, G.f (relevant bit is called 
G_SCENESCRIPT).  This feature is useful both to fix scripts that hang 
the program, edit "run&quit" demos and to start Blender safely, when 
you're not confident about the .blend you're opening. But as Chris Want 
pointed weeks ago, "FrameChanged" script links also run on startup (they 
run on set_scene, so on all scene changes) and are not disabled by the 
"-y" flag.

The only way to disable script links in Blender's UI is to remove them 
one by one or at least leave their text fields empty.  This is obviously 
not adequate, even when automated by a script.  A general "disable 
script links" button (not "enable" because by default they've always 
been "on") in the script buttons win would be a better solution.

And for that I'd like to:
- expand the "-y" flag to disable all script links, not only scene 
"OnLoad" ones;
- add a "disable" button in the script buttons win to turn on/off 
G_SCENESCRIPT flag via UI;
- add a check for G.f & G_SCENESCRIPT before running any script link. 
The check can either be added to the top of the script links execution 
function or everywhere in Blender where it is called (to avoid the tiny 
overhead of calling the function for each link set).

Coding changes are small and trivial. Ok to do it?

Note: when new .blend's are loaded, we can check if script links are 
currently disabled. If so we turn them off in the new G.f, too.  
Otherwise the value saved in the loaded .blend will tell if they are on 
or off.

-- 
Willian



More information about the Bf-committers mailing list