[Bf-python] Re: erasing textures, materials, objects

Willian Padovani Germano wgermano at ig.com.br
Wed Apr 7 06:05:51 CEST 2004


Hi Nicolas,

----- Original Message -----
From: "nicolas bonnand" <nicolas.bonnand at wanadoo.fr>
To: <bf-python at blender.org>
Sent: Tuesday, April 06, 2004 5:09 PM
Subject: [Bf-python] Re: erasing textures, materials, objects


> Since erasing doesn't exist what are the "best practices" when
manipulating
>  lots of meshes/materials/textures ?

Careful planning.  But if you really need to create lots of structs at
the same time, think of it as if you were doing it in Blender by hand --
means you have a complex, huge scene, the .blend file will be huge and
you should add ways for your script users to control how many objects
they want.  After your script ends, all its Python memory will go away,
unless we have memory leaks, which are bugs, of course.

If you need one temp object at a time, create it once and reuse it later
(make your script check if a temp object -- give it a well defined,
exclusive name -- is already available from a previous execution).  If
you need many in parallel, try to do the same: create them once, reuse
later.

> (As far as meshes are concerned, does it help to set the vertices and
> the faces of old meshes to [] ? )

Definitely.  Strip your objects of *all* useless data before finishing
the script.

> By the way, are there limits for:

Yes, there are limits, more than enough for "normal" usage, but a
reckless script can surely fill all available space too fast, you're
right to care about it.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list