Armature and weight painting issues

Tech support and suggestions forum. If you only have a basic question on how to get started, please use the "newbies" forum in the community section.

Moderator: joepal

Re: Armature and weight painting issues

Postby punkduck » Wed Apr 05, 2017 10:29 pm

I totally agree.

I just uploaded this pose and the back of the knees look weird.

http://www.makehumancommunity.org/sites/default/files/poses/1665/1980681319/tennis_serve_example.jpg

I sometimes experimented with extra bones ... but if weight painting fixes this issue it would be really great. When I started with weight painting I made things worse ... :oops:

data/rigs/<rigname>.mhskel is the skeleton and default_weight.mhw are the weights. But how these files have been generated? No idea.
User avatar
punkduck
 
Posts: 1260
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Armature and weight painting issues

Postby jujube » Wed Apr 05, 2017 10:43 pm

For anyone who missed it: I updated my post at the end of page 1 with the (partial?) answer. It turns out the weights are stored in plaintext in data/rigs/default_weights.mhw.

edit: And you can put in the new weights by hand, it would just take a really long time.
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Armature and weight painting issues

Postby wolgade » Thu Apr 06, 2017 1:23 am

An easier approach would be https://bitbucket.org/MakeHuman/makehuman-utils. This stuff lacks documention.
wolgade
 
Posts: 798
Joined: Wed Jan 30, 2013 6:50 pm

Re: Armature and weight painting issues

Postby blindsaypatten » Thu Apr 06, 2017 6:21 pm

I'm hoping someone can explain how to use the utility that wolgade has found.

As far as weights go, this is how I understand it using the knee as an example. On the front of the knee you want a large overlap with a smooth weighting so that as the knee bends the vertices on the front of the knee will stretch out somewhat evenly to cover the now larger area, keeping the vertices relatively evenly distributed. On the back of the knee, where the vertices should be moving toward and into a crease, an overlapping weighting doesn't produce anything like you want. If you use two disjoint areas on either side of a crease line you will get a sharp crease that the vertices on either side will disappear into. While those vertices should really compress on the surface with a shallow crease there is no way to do that with a single joint and weight painting, and we really aren't too concerned with what vertices are doing once they have disappeared into the crease. I think that to do better you need to use shape keys.

Here's an example of disjoint areas of influence for the two sides of the knee joint:
KneeAreaWeights.png

and here is the sharp crease that results:
KneeSharpCrease.png


This is just to show the concept, I didn't put any work into the transition between the creasing back and the front area.

I think this is a definite improvement over the current default painting. I don't know if the crease causes any difficulty for clothing, from what I've observed clothing seems to deal with the creases around the hip joints so I'm hopeful it will be okay here too.

The knee and elbow are relatively easy to deal with as they only bend through 90 degrees so one side is always stretching and the other compressing. Wrists are more complex because they can move +/- 90 degrees so the top and the bottom of the wrist play opposite roles depending on position. To work well just with painting you probably need to use more than one joint with drivers to bend one for positive bends and the other for negative bends, or something along those lines. Shoulders are a bit of a nightmare due to all the degrees of freedom.
blindsaypatten
 
Posts: 586
Joined: Tue Mar 14, 2017 11:16 pm

Re: Armature and weight painting issues

Postby jujube » Thu Apr 06, 2017 8:34 pm

Looking at the code, it seems to be a blender add-on, located in "View3d > properties".

edit: Started testing "weighting" - it is in fact a blender addon. It's not very impressive when only a rig is selected, but when an object is selected, a LOT of stuff appears in the tab.

Testing the export vertex groups function: The default save location caused an error, I had to change it. It looks like it has the data MH needs*, it's just formatted wrong, so currently when I replace default_weights, makehuman doesn't load.

*Or, that's what I thought at first, but actually the original file is much larger.
Attachments
addon.PNG
it works!!
error.PNG
it gets this far when you copy the header from the original default_weights.mhw
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Armature and weight painting issues

Postby blindsaypatten » Sat Apr 08, 2017 6:21 am

jujube wrote:Looking at the code, it seems to be a blender add-on, located in "View3d > properties".

edit: Started testing "weighting" - it is in fact a blender addon. It's not very impressive when only a rig is selected, but when an object is selected, a LOT of stuff appears in the tab.

Testing the export vertex groups function: The default save location caused an error, I had to change it. It looks like it has the data MH needs*, it's just formatted wrong, so currently when I replace default_weights, makehuman doesn't load.

*Or, that's what I thought at first, but actually the original file is much larger.


Success!

You need to export a character with topology of None and the Default skeleton, and then import it into Blender.
Do what you want to the weight painting.
In the toolbar set the filename and tick the As Weight File box, then click the Export vertex groups button
The resulting file has the vertex weights but with some formatting differences. First there are no newlines, it is all just one big line. I added a newline after each vertex,weight pair.
It doesn't have the header information at the top so I replaced the leading [[ with the header information, which uses { instead of [ which I don't know if it matters. I changed the final set of ]s to match with the end of the defaults file.
Each vertex group in the generated file is surrounded by a [ ] pair but they aren't in the default file so I removed those.
The result is a new default weights file that MakeHuman will read during startup - on all previous attempts MakeHuman wouldn't start up.
I noticed that there were some subtle differences here and there, the generated file sometimes had 6 decimal points while the defaults file always had 4, and there were some vertices with near-zero weights that didn't appear in the generated file.
I tested that changes to the weight painting do get reflected in the generated file, but I haven't tested the round trip of exporting a character after changing the default weights to make sure the changes take.

The original file is much larger because it has a ton of indentation white space in it.

I've attached the generated file after I made the outlined changes. Oops, no I haven't the forum won't allow .mhw or .txt file extensions

I think we are now in a position to produce an improved weight painting and install it locally.
blindsaypatten
 
Posts: 586
Joined: Tue Mar 14, 2017 11:16 pm

Re: Armature and weight painting issues

Postby wolgade » Sat Apr 08, 2017 11:20 am

blindsaypatten wrote:Success!

Cool! And many thanks for your explanation on how you did it. You did nothing less but add some documentation for a tool that desperately needed it. Why not copy and paste it to the wiki?

blindsaypatten wrote:I've attached the generated file after I made the outlined changes. Oops, no I haven't the forum won't allow .mhw or .txt file extensions

It allows zip files.
wolgade
 
Posts: 798
Joined: Wed Jan 30, 2013 6:50 pm

Re: Armature and weight painting issues

Postby Aranuvir » Sat Apr 08, 2017 11:34 am

The best approach for weight painting is:

  1. Install all makehuman-utils
  2. Load a base mesh with helpers via MakeClothes or MakeTarget
  3. Import the default skeleton via Import/MakeHuman rigging
  4. Do your weight painting, don't forget to paint the helpers, too
  5. export via Export/MakeHuman rigging to an different location
This should create a new weight map, usable in MH, when renamed correctly

Attention: the exported skeleton will NOT(!) be usable, unless it was fixed by hand: viewtopic.php?f=3&t=13256&p=33801#p33801
Aranuvir
 
Posts: 1317
Joined: Sun Oct 12, 2014 2:12 pm

Re: Armature and weight painting issues

Postby wolgade » Sat Apr 08, 2017 12:09 pm

Aranuvir wrote:The best approach for weight painting is:

Just to make sure that this fact doesn't get lost: Blindsaypatten already did the weight painting and managed to generate a corrected file that works. Unfortunately it can't be uploaded to the forum. Let's provide some help to get the fix tested.
wolgade
 
Posts: 798
Joined: Wed Jan 30, 2013 6:50 pm

Re: Armature and weight painting issues

Postby joepal » Sat Apr 08, 2017 12:43 pm

I have now allowed the .txt and .mhw extensions for attachments in forum posts.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4625
Joined: Wed Jun 04, 2008 11:20 am

PreviousNext

Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 2 guests