[Bf-python] Python bug with user counts
Joe Eagar
joeedh at gmail.com
Mon Jan 22 21:11:46 CET 2007
Willian Padovani Germano wrote:
> Hi,
>
> Ken Hughes wrote:
> My vote: from what I know / recall, it's better to revert to the old
> way: wrapped objects not having their id.us incremented automatically.
> To avoid accessing deleted objects we can either add a id.py_us var
> (toggle or counter) to prevent deleting them or add checks everywhere
> in BPy to always make sure the object still exists, similar to what is
> done for scenes and texts.
>
Not very many ID types ever get deallocated; I can only think of objects
and texts (and I guess scenes? maybe screens too?) myself. So as long
as all the global namespaces are cleared on file load (e.g. all
Blender.* modules (including Blender) and the Registry dict). it
shouldn't be necessary to do very much checking.
However, I don't know how feasible it'd be to clear the modules
namespaces, I guess you'd have to re-initilize them after every file load.
Joe
More information about the Bf-python
mailing list