[Bf-python] Object.link

Willian Padovani Germano wgermano at ig.com.br
Sun Sep 14 05:14:52 CEST 2003


From: <models at paposo.com>
> It does decrement it correctly, but the old mesh is still in main's list
of
> meshe's after the user count drops to 0.

Ah, ok, thanks.  As I told, Blender keeps these objects, even if their user
count is zero, it just doesn't save them to file (there's an option
somewhere to turn saving of 'user-less data' on).

>     if(self->object->type == OB_CAMERA)
>      free_libblock(&G.main->camera, oldid);

Better not go there, really.  Look at the Text module -- since those can be
freed, we have to check everywhere that the actual wrapped object is still
around.  The way things are now (wrapping doesn't increment the user count
of objects), following Blender's way is probably wiser.  If we started
freeing things not even the program frees, besides having to test pointers
against NULL in *every* method function, we might mess with expected
behaviors, besides entering a bad debugging trip that could last for
months...

> p.s. you've done a great job with nmesh. I have a tendency to question
> everything, but im really just a noob.  :)

No problem, these things should be understood : ).

My initial intention was to write a new Mesh module from scratch, but it was
decided that we had to hurry, so I ended up integrating some old ones
(NMesh, BGL and Draw).  This was a good decision, after all, I've learned a
lot working on these three.  The original programmers did a great job, we
can learn a lot from that code.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list