No subject


Fri Aug 18 06:37:21 CEST 2017


Object.New() in conjunction with Lamp.New(), for example, so maybe not much
will be broken. This would break, case anyone used it:

ob = Object.New(type)
data = ob.getData()  # should return None until ob gets linked to real data.

PS: Manuel: that problem with the name is an old 'bug', I'll fix it.

--
Willian, wgermano at ig.com.br

----- Original Message -----
From: <models at paposo.com>
To: <bf-python at blender.org>
Sent: Saturday, September 13, 2003 1:07 PM
Subject: [Bf-python] Object.link


> Heres a problem with Object.link i ran into.
> Take this script for example:
>
> import Blender
> object = Blender.Object.New('Mesh', 'myObject')
> mesh = Blender.NMesh.New()
>
> //add verts to mesh... blah, blah
>
> object.link(mesh)
>
> If you hit F9 you'll see there were two meshes created and 1 of them is
> linked to 'myObject'.  The problem is that Object.New creates a default
mesh
> by calling add_mesh().  This returns a real mesh with the default name of
> 'mesh' linked to the object.  NMesh.New() does not create real mesh.  When
> object.link is called with a python mesh parameter the following occurs:
> 1.NMesh_FromPyObject is called which returns a new mesh (by again calling
> add_mesh()) based on the python mesh passed.
> 2.The object's data pointer is set to point at the new mesh.
>     self->object->data = data;
>
> So, what happens in the end is that two meshes were created. A default one
> during object creation, and a new one representing the python mesh.  The
> object gets linked to the new one from the python mesh but it doesn't axe
> the old one, so you have a floating unlinked mesh.
>
> I think that the old data should probably be freed and removed from the
> global mesh list when the new link occurs.
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://www.blender.org/mailman/listinfo/bf-python
>




More information about the Bf-python mailing list