Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When importing an object with my own script (Yes, I need one, no functional script exists) I want to import it with help of the bmesh-module. It seems to be the best choice for the job as it is as close as you can get to data-only and is kind of standalone (keeps the blender-data clean until everything is ready). There is one problem I am facing now: How do I give names to the vertexGroups? This is what I got so far:

import bmesh
mesh =
# add vertices
layer = # a new deform layer, why is this singleton??
for vert in mesh.verts:
    vert[layer][0] = 0.5 # assign a value of 0.5 to the first group
    # .... more groups

I suppose you know that Blender handles animation via vertex-groups so I have to make sure that the right vertex-group (index) has the correct name assigned to it.

Do I have to name the groups on the object itself? If yes, do I have to create the group beforehands (before mesh.to_mesh( Am I guaranteed that the order is kept?

share|improve this question
deform and vertex_groups are not related from my understanding, and there's no way to manipulate Vertex Groups through the bmesh module. – CoDEmanX May 9 '14 at 18:28… says just that :) – WorldSEnder May 9 '14 at 18:52
Thanks for the link! It's pretty confusing, so thanks again for asking this question! – CoDEmanX May 9 '14 at 20:34
up vote 3 down vote accepted

Vertex group names are stored in the object, not the mesh.

The order of groups just has to be aligned between the mesh and the object.

So yes, you have to name the group on the object.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.