[Bf-python] data corruption

Campbell Barton cbarton at metavr.com
Fri Nov 18 16:13:39 CET 2005


There is another problem-
I have a situation where most objects have 2 or 3 users (from multiple 
exports)
Now there are some objects that only have 1 user- These objects dont 
respond to
ob.sel = 1

Object.GetSelected() will not return them. however they are in 
Scene.GetCurrent().getChildren()

- Cam


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
>
>   


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241




More information about the Bf-python mailing list