[Bf-python] data corruption

Toni Alatalo antont at kyperjokki.fi
Fri Nov 18 16:34:27 CET 2005


On Friday 18 November 2005 16:13, Campbell Barton wrote:
> There is another problem-

can not confirm:

> I have a situation where most objects have 2 or 3 users (from multiple

i added two scenes with linking objects, so had 3 users for all the default 
objects

> Now there are some objects that only have 1 user- These objects dont

.. and deleted Cube from the other scenes, so it only has one user, while 
Camera and Lamp still have 3.

> Object.GetSelected() will not return them. however they are in

it always works correctly for me on this Linux box.

what platform & versions are you on?

> - Cam

~Toni

>
> Martin Poirier wrote:
> > --- Campbell Barton <cbarton at metavr.com> wrote:
> >> Its not quite right now.
> >> Im exporting the scene and then it draws the objects
> >> with a Cyan Dot.
> >> (multi user object)
> >> Even when the export is finished. - This never
> >> happened before.
> >
> > Is you object referenced with a global variable?
> > In that case, the python interpreter wouldn't collect
> > it after the script finishes running because the BPY
> > interpreter keeps the global dict between runs (or at
> > least, it used to).
> >
> > So, it would never decrement the user because python
> > is sill using it.
> >
> > It's not a bug, it's just safe.
> >
> > Assuming I am correct, the proper way to fix it would
> > be to encapsulate your export code in a function. Not
> > storing anything other than constants, classes and
> > functions in the global name space is good practice on
> > the long run.
> >
> > Martin
> >
> >
> >
> > __________________________________
> > Yahoo! FareChase: Search multiple travel sites in one click.
> > http://farechase.yahoo.com
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at projects.blender.org
> > http://projects.blender.org/mailman/listinfo/bf-python



More information about the Bf-python mailing list