Script organization

I have a script that is called on every frame change. But I also need some initialisation (set constants and so on).
As these scripts are called every frame, I can’t make my initialisations in them. So I have to define my intialisations in another script.
So I tried to write a second script, called onLoad.
But how do I make the values defined in this second script known by the one called every frame ?
Or am I organizing my scripts in the wrong way ?
Thanks in advance

I don’t know if there are blender-wide globals for scripts. I’m afraid there are not

The workaround I’d do in your place is to have the onLoad script write a text buffer (easy) within Blender (Take my BMG Blender Mechanical Gears script. Script BMGs does this)

Once the text buffer is there your OnFrameChange script can read it!

Possibly you can write a Python fragment and execute it?


Thank you Stefano
Where can I see your BMG Blender Mechanical Gears script ?

LInk was here on forum, that’s why I didn’t include it :wink:


try the Registry module :

a test: