[Bf-python] purging datablocks via python

Gilbert, Joseph T. jgilbert at tigr.ORG
Tue Jan 17 22:50:29 CET 2006


Blender does not purge unlinked data. It saves everything in G.main
until blender exits. This is part of blender's data model.  If you add
100 mesh datablocks they will exist until blender exits. 


-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Martin
Poirier
Sent: Tuesday, January 17, 2006 4:22 PM
To: Blender Foundation Python list
Subject: Re: [Bf-python] purging datablocks via python



--- Tom M <letterrip at gmail.com> wrote:

> Hi,
> 
> a script author mentioned the following,
> 
> [QUOTE]Honestly, the only major Blender Python issue
> plaguing me is
> the lack of ability to purge the Library properly. 
> No matter what
> code I add to the script to try to get Blender to
> cleanup old unused
> Datablocks (I _have_ to create alot of temporary
> objects in my
> script), the _only_ way to get rid of the data is to
> save, close
> blender, reopen the file, save, close, & reopen. 
> The filesize of the
> .blend for our project drops from 800 MB to 75MB
> after doing
> this.[/QUOTE]

Even Blender itself doesn't purge datablocks, so I
doubt this will every get in the API.

> This is probably something for 2.42 but, is there a
> workaround?  I
> seem to recall mention of a way to hackishly do this
> via python...

Save and reload

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.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