[Bf-python] Memory bug in Bpy api

Toni Alatalo antont at kyperjokki.fi
Wed Jan 18 17:20:09 CET 2006


On Wednesday 18 January 2006 14:46, Willian Padovani Germano wrote:
> To solve the problem of vars created in modules being persistent, simply
> *do not use modules to store new data* -- do not do this:

as he already explained, shortwave / bobby parker did not intend to do that. 
the fact that the state of his script (specifically the path to the shaders) 
was restored after the rerun was an unwanted side-effect from the fact that 
the modules are kept. i thought that was a bug so made that little math-using 
thing to demonstrate.

he has a ShaderEditorGUI.py on the disk, which has globals (on the level of 
that module) for variables like that ShaderPath. this is imported as a module 
by the script that is run in blender. an event handler in the same file is 
used to receive calls from bpy UI widgets and set those values.

so if we indeed want to keep this behaviour, reload() is a fix for the cases 
where such automagic persistence of user given vals is unwanted, but in this 
case it crashes :/

> Willian

~Toni



More information about the Bf-python mailing list