Problem with attaching vertices to armature

Hi guys,

(Huge apologies for posting this in the News and Discussion section!!!)

I know this is probably a silly question, but I’m having a lot of trouble setting up a mesh to deform with an armature object. Here is the only way I know:

(1) select the mesh object
(2) Shift-select the armature object
(3) ctrl-p to set the armature object as the parent of the mesh object, and select “Armature”, then “Create from the closest bones”.

However, when I go into the pose mode, only some of the vertices would deform with the bones, there are a few vertices that just won’t move. See the following pictures to get an idea:

Before posing the bones:

http://img250.imageshack.us/img250/722/262985441lw.jpg

http://img253.imageshack.us/img253/9172/273368279hl.jpg

During posing the bones:

http://img241.imageshack.us/img241/8910/470525044my.jpg

http://img440.imageshack.us/img440/2710/528481485zv.jpg

As you can see in the last two images, 2 of the top 4 vertices just wouldn’t move with the top bone. Here is the blender file that I used: www.csse.unimelb.edu.au/~jingy/download/problem.blend , please have a look if you need.

What am I doing wrong here? :confused:

Thanks a lot.

You need to Subdivide the Mesh so it has edgeloops for at least each bone to deform at.

The new way to deform a Mesh with an Armature is to add an Armature Modifier to the Mesh, then Assign Vertex Groups. That “From Closest Bone” option creates Vertex Groups but doesn’t do a good job of Assigning Verts.

%<

Would I still need to subdivide the mesh if I use the “new way”? The thing is that the real mesh that I want to use already has like 10000 polygons, and I’m running a statically compiled blender and this model is already killing my machine.

So how do you add an Armature modifier to the mesh?

Thanks so much for replying. :slight_smile:

Edit: I see that there is an “Add modifier” menu in the Editing panel of mesh, I can select the armature option – which will me a subpanel in which I canmanually type in the name of the armature object, but when I click the “apply” button of this subpanel, the entire subpanel disappears and I don’t know what I did has made any differences. So could you please tell me the exact procedure for doing this?

It’s also weird that I have an old blender file which has the same armature and mesh, but the mesh’s size and relative position to the armature is slightly different from the one I’m currently using. The mesh in the old one deforms pretty much perfectly with the armature, wheras in the current one, most of the vertices just won’t move.

The one that works can be accessed here:

http://www.csse.unimelb.edu.au/~jingy/download/working.blend.gz

picture:

http://img412.imageshack.us/img412/8677/777544165um.jpg

The one that doesn’t work can be accessed here:

http://www.csse.unimelb.edu.au/~jingy/download/not_working.blend.gz

picture:

http://img244.imageshack.us/img244/6951/596294015aj.jpg

For the life of me, I just cannot figure out why the deformation works with one model but not the other – they are so similar!! Please have a look if you have time. Thanks so much!!

hi guys, any help please?

You did the “New way” correctly until you got to the “Apply”. For Modifiers ‘Apply’ actually means ‘Apply current deformation permanently to the Mesh’. Seldom do you want to do that with an armature.

Both the old and new ways work and there are only small differences between the two. The necessary subdivision I mentioned applied only to the example you posted in the first pic.

To solve your problem RMB-Select your Mesh, goto WeightPaint mode (Ctrl-Tab) and Shft-Leftclick the mesh on the left leg. Choose a Vertex Group and if the Verts in that group ARE assigned to it they should show up red. If not then paint them red (but only the verts that ‘belong’ to that bone. Rinse and repeat for the other bones. For toes and such it will be easier to select the Vertex Groups in F9 buttons in Edit mode, and select and Assign them there.

%<

Thanks a lot Fligh, but I just don’t understand why assigning the vertices to the closest bone would work in working.blend, but not in not_working.blend. I mean these two are practically identical. I didn’t do the weightpainting thing at all for the working one. The only difference I can think of is that I created the old one with blender 2.37 or something like that. I just don’t understand why blender wouldn’t assign every vertex to the bone closest to it. Could this be a bug in the new blender?

Edit: I just took the working one, removed the parent-child relationship between the mesh and the armature and redid it – it’s now also messed up … I guess for some reason the old one contained the correct vertex groups.

I made a quick tutorial to explain the basic process, hope it helps:

http://www.freewebs.com/mystery0000/QuickTutorial.zip

:spin:

Mystery

No, it’s one of the differences between the old (pre 2.4) and new (post 2.4) methods. In 2.3 versions if you Parented with “From Closest Bone” it created Vertex Groups and Assigned the Verts correctly. Post 2.4 it Creates VG’s properly but either doesn’t assign Verts at all or makes a mess of it.
One way to ‘force’ it to work is to up the Dist value of each Bone in the Armature and Bones tab, or, to choose Envelope display mode and in Pose mode use Alt-S on each bone to get the influence to ‘reach’ the Verts. Much easier painting or Assigning in Edit mode with the Vertex Groups. I think the difference between pre and post 2.4 had something to do with the introduction of Envelopes.

%<

Thanks a lot Mystery, that’s a really really good tutorial! It will be my last resort for sure. However, call me lazy if you want, since my mesh is already very very detailed, is there an automatic way to just assign the vertices to their closest bones? I know I might be able to do this through python scripting, but surely there is an automatic way?

Thanks a lot Fligh for that explanation of the differences between post 2.4 and pre 2.4. Now I know there isn’t an easy way. I will see if I can mop up a script to do this automatically.

Edit: I just played around with the deformDist attibue of Editbone a bit and it seem to work to a certain extent (not perfect though), so I think a python script that either calculates the most appropriate deformDist for each bone, or just assigns the correct vertices to the right groups should be the way to go. I will give it a go some time later.

Since it’s an organic model I would personally use envelopes, you can find some information about them here: http://www.blender3d.org/cms/Armature_Envelopes.647.0.html

Instead of manually selecting the vertices that will be effected by the bone, the envelope ‘space’ determines which vertices are effected. It can be a pain to set up sometimes but I think that’s the best automatic way.

Mystery

See the Envelope Assignment script under Animation in the Scripts window. Never used it but if it doesnt do the job it might be a foundation for your own script.

%<

You guys are life savers, I really really appreciate all the help. I don’t think the Envelope Assignment script works for me – it doesn’t use armature at all.

The envelop method looks rather cool, but I don’t think I can do it through python programming (I can be very wrong about this, but I just cannot find any API about it).

The project I’m working requires a drag-n-drop interface of putting 3D objects into a blender scene – just like setting up a movie stage. These drag-n-dropables include human meshes with matching armature models, multi-mesh furniture and rooms. All these models have to be independently stored on the disk so that they can be loaded into any blender scene, and they are associated with other information totally independent of blender. Therefore I cannot just create a single human mesh with the armature and envelops and store it in a single blender file. I’ve no idea how to import a individual objects from a different blender file into an existing blender scene through python.