[Bf-python] Object.link

models at paposo.com models at paposo.com
Sun Sep 14 02:19:29 CEST 2003


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.  The previous script now works if
you do this to object.c:

self->object->data = data;
    id_us_plus (id);
    if (oldid)
    {
        if (oldid->us > 0)
        {
            oldid->us--;
   if(oldid->us == 0)                        //****new if when users are
zero get rid of it
   {
    if(self->object->type == OB_CAMERA)
     free_libblock(&G.main->camera, oldid);
    else if(self->object->type == OB_LAMP)
     free_libblock(&G.main->lamp, oldid);
    else if(self->object->type == OB_MESH)
     free_libblock(&G.main->mesh, oldid);
    else if(self->object->type == OB_CURVE)
     free_libblock(&G.main->curve, oldid);
   }                                                //**end new if
        }
        else
        {
            return (PythonReturnErrorObject (PyExc_RuntimeError,
                "old object reference count below 0"));
        }
    }

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




More information about the Bf-python mailing list