[Bf-python] Re: Request for adding a proposed new feature

Martin Poirier theeth at yahoo.com
Wed Dec 20 20:40:53 CET 2006


--- Ken Hughes <khughes at pacific.edu> wrote:

> Willian Padovani Germano wrote:
> > Ken Hughes wrote:
> >> (2) I was looking into adding the "delete=True"
> support this morning 
> >> when I remembered that it doesn't matter whether
> the objects are 
> >> created by Object.New(), Object.Get() or
> scn.objects: since they're 
> >> all BPy_Objects all objects get their user count
> incremented, so the 
> >> nice new scene.objects API isn't going to fix
> that problem :-(
> > 
> > Well, there was a time when BPY didn't mess with
> Blender reference 
> > counts (id->user), maybe that was wiser. If needed
> we could use the fake 
> > user or add some other hook to preserve data while
> it's being referenced 
> > by Python. Anyway, this is a topic that deserves
> proper discussion, with 
> > pros and cons, I'm not sure I remember all the
> issues right now.
> 
> Agreed.  IIRC the main argument for making Python a
> user is that scripts 
> could be working on objects when they are suddenly
> deleted in the 
> Blender GUI, and then the script would fail.  I
> believe that was before 
> the fakeUser support was added, although I don't
> really know what that 
> does.  I think Michael Reimpell was one of the
> proponents of adding 
> this; maybe he's still lurking here and can give
> some insight.

Fake users means Blender won't deallocate the data
when the user count reaches zero.

Action blocks have fake users turned on by default,
others can be manually turned on in the UI.

I don't think fake user is a real solution though,
because there's no way to prevent the user from remove
the fake user and unlinking the object while a script
is running. Having Python as a real user of the
datablocks is the safest solution, IMHO. Moreover,
it's just like Python refcounting, so BPy codes should
have gotten used to that by now. :)

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Bf-python mailing list