[Bf-python] Python bug with user counts
Willian Padovani Germano
wgermano at superig.com.br
Mon Jan 22 18:20:42 CET 2007
Hi,
Ken Hughes wrote:
> So should we remove the current "Python is a user" code until we come up
> with something safer?
Sincerely I'm not sure. On one hand it seems to be a better idea, but
I've been away from frequent BPy coding for quite some time -- slowly
coming back -- so I'm not sure I have a clear vision about all
implications, in particular regarding more recent code and areas I have
less experience with. It may be too late to do it for this release, but
it's surely something we must fix.
Anyway, if all bpy coders agree about it and can't find a reason to
justify keeping the "Python is a user" policy, then it may be possible
to do it earlier, since we'll have opinions from people working in all
areas of BPy.
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.
--
Willian
More information about the Bf-python
mailing list