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

Willian Padovani Germano wgermano at ig.com.br
Sat Aug 30 06:00:55 CEST 2003


Hi, Joseph

From: "Gilbert, Joseph" <jgilbert at tigr.org>
> That's what I was thinking too!! So, although, I know im not a developer
or
> anything, I am working on this now. (have mercy) :o

Blender is the second (first big) project I contribute to.  After the first
few contributions you gain confidence and that makes a *huge* difference.
You suddenly feel like "a developer" : ).  It's like getting a licence to
drive.

> I was thinking something like this:
> -Select group by name/index,
> -Adding/removing a named group,
> -Adding/removing a list of vertex points to/from a group,
> -Returning a list of vertices (dVerts) from a group.

That's a good idea, that goes beyond the current plan, very nice.

> I added group selection to nmesh, but it wasn't complete because you need
> to enter editmode through python first.

BTW, I hope to write an EMesh module soon.  It will be like NMesh, but will
give access to the current editmesh (edit mode "on") and so to info like
selected vertices and faces.  If you have problems, maybe this module will
be a better place at least for part of your additions.

> My dilemma is that this (or someof it) might be more appropriate as part
of
> the object module than the nmesh module because although deform verts are
> part of the mesh data(and it's associated object) the deform groups are
part
> of the object the mesh is linked to.

It can be kept at the NMesh (or EMesh) modules anyway, like
getVertexInfluences is.  Just check if the mesh is already linked to an obj
and, case not, warn the script writer that the mesh must be linked first.
Didn't try, but this would probably work.

But yes, you can also put this on the Object module, where you then have to
check that the object is of type mesh and, if so, go on getting/changing the
grouping info.  Conceptually, though, we'd better not have functions that
mess directly with vertices in the Object module, but rather in NMesh or
EMesh.

Looking at your code ... yes, you check the obj type, of course.  This way
of selecting groups is like nothing else in the current API.  It really
looks like something for the future EMesh module.  Nice work, you're
swimming well in the Blender sauce : ).

Simply getting the group a vertex belongs to looks like something for NMesh,
probably as an optional addition to .getVertexInfluences(vindex), like:
.getVertexInfluences(vindex, "getgroup") to also return the group name.
That
would be the simplest, fastest solution (compared to something like a member
var in NMVert: vertex.group).  The rest of your ideas seem more at home in
Emesh, I'll try to start work on this module soon.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list