[Bf-python] Vertex Influence for no-armatured objs

Willian Padovani Germano wgermano at ig.com.br
Sat Sep 13 20:30:04 CEST 2003


From: <models at paposo.com>
> > /* hack: to mark that (deformed) mesh is readonly, so the update
function
> >  * will not try to write it. */
> >   ((BPy_NMesh *)nmesh)->mesh = 0;
>
> This hack makes no sense to me.

NMesh.GetRaw and .GetRawFromObject are not equivalent, it's a feature that
they give you different data, in general.

When you use NMesh.GetFromObject(), you're grabbing the *dl* mesh.  As I
wrote in another email weeks ago, this display list mesh is already
transformed / deformed, ready for the final steps to put it on the screen.
The hack is then necessary to avoid an error: if you update this already
transformed mesh and send its data back to its original place, original
armatures and its transform matrix will still be there, though they have
already been applied to the verts of this mesh.  See?  You'd get the
transforms applied twice, quite a mess.

The reasoning behind NMesh.GetRawFromObject is that you may want to access
the already transformed verts.  But if you want to send that info back to
Blender, better create a new mesh for it.  That's the clean way, so it's
forced and done behind the scenes by the code.

For meshes created with .GetRawFromObject, the null pointer already solves
the issue you may be having.  It has to be linked to an Object before the
user can mess with its dverts.  That's part of the NMesh API: some things
demand that users first nmesh.update or NMesh.PutRaw their mesh.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list