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 Aranuvir » Sat Apr 08, 2017 12:56 pm

wolgade wrote: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.

Obviously there where some glitches: My proposal does not produce an output that needs to be tweaked by hand (in regard of the weight map). A quick round trip of importing and exporting the default rig showed no differences in the weight maps (except some negligible metadata like the version string)
And I am not sure if weight painting should be done on an exported base mesh, which already has 8 modifiers, shape keys or whatever applied (chances a great I will lose the discussion here). Furthermore, it is hard to tell from reading the post if the helpers where painted, too. Usually, the helpers are not imported with the mesh, when not explicitly selected. A quick test showed me a difference of 1MB of file size with and without the helpers....

My initial comment was just intended to be a proposal. Feel free to follow it, or ignore it.
Aranuvir
 
Posts: 1314
Joined: Sun Oct 12, 2014 2:12 pm

Re: Armature and weight painting issues

Postby brkurt » Sat Apr 08, 2017 2:29 pm

blindsaypatten wrote: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.


To solve this problem easily, you need to add two extra bones to the leg: kneecap and calf (or patella and gastrocnemius, if you prefer). The default rig is not set up for such fine movement, and most likely you will need to use a level one multiple resolution to get the fine points right. :geek:
brkurt
 
Posts: 1100
Joined: Sun Feb 17, 2008 8:49 pm

Re: Armature and weight painting issues

Postby wolgade » Sat Apr 08, 2017 4:35 pm

Aranuvir wrote:My initial comment was just intended to be a proposal. Feel free to follow it, or ignore it.

I didn't intend to be rude. If you got me this way, sorry. I was under the impression that you simply missed the fact that someone had success with a hardly documented tool. It would be a very bad idea to ignore people who take the time and try to improve MH.
wolgade
 
Posts: 795
Joined: Wed Jan 30, 2013 6:50 pm

Re: Armature and weight painting issues

Postby Aranuvir » Sat Apr 08, 2017 5:33 pm

wolgade wrote:I didn't intend to be rude. If you got me this way, sorry.

No problem :) . I think we have all the same intention: getting annoying bugs fixed.
I was under the impression that you simply missed the fact that someone had success with a hardly documented tool. It would be a very bad idea to ignore people who take the time and try to improve MH.

It wasn't my intention to ignore the results of blindsaypatten and I must admit the first words in my post sounded like "smart-arse". I do not have any deeper insights in the tools or code as any other user here in the forum and I'm neither a programmer nor a 3D-artist. I'm just trying to understand how things work by playing around with the tools and the code. Getting the weightings fixed is something I had on my wish list for a long time. But I'm not very skilled in this artistic job.
Aranuvir
 
Posts: 1314
Joined: Sun Oct 12, 2014 2:12 pm

Re: Armature and weight painting issues

Postby jujube » Sat Apr 08, 2017 6:16 pm

Aranuvir wrote: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


I tried out these steps. At first I got "the selected mesh is not parented with an armature". It turns out you have to select only the mesh.
Also note that the (correctly formatted) .mhw file is generated along with the .mhskel file.

But now I'm having trouble with what comes next.
By default, this error message appears in makehuman:
Code: Select all
Cannot find position for joint joint-upperarm01.L____tail
Cannot find position for joint joint-upperarm01.R____tail
Exception during event onFileSelected
Traceback (most recent call last):
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\events3d", line 211, in callEvent
  File "plugins/3_libraries_skeleton\skeletonlibrary.py", line 129, in onFileSelected
    gui3d.app.do(SkeletonAction(msg, self, self.selectedRig, filename))
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\mhmain", line 856, in do
  File "plugins/3_libraries_skeleton\skeletonlibrary.py", line 71, in do
    self.library.chooseSkeleton(self.after)
  File "plugins/3_libraries_skeleton\skeletonlibrary.py", line 206, in chooseSkeleton
    skel = skeleton.load(filename, self.human.meshData)
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 1447, in load
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 134, in fromFile
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 524, in build
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 848, in build
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 891, in get_normal
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 1285, in get_normal
  File "c:\jenkins\workspace\Windows_release_11x\buildscripts\win32\build\makehuman\out00-PYZ.pyz\skeleton", line 428, in getJointPosition
RuntimeError: Cannot get joint position, no reference vertices or joint name specified.


Replacing the nulls in the root plane with joint names just adds these joint names I used to the message:
Code: Select all
            "spine05",
            "pelvis.R",
            "pelvis.L"


When replacing the nulls with
Code: Select all
            "spine05____head",
            "pelvis.R____head",
            "pelvis.L____head"

It refused to load at all.
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Armature and weight painting issues

Postby Aranuvir » Sat Apr 08, 2017 7:02 pm

You should (hopefully) be able to reuse the weight map, as I said. When you want to fix the exported skeleton you are probably not done by fixing the root plane, but you will have to fix all the other planes, too. About 800 lines. If you intend to correct the default skeleton you can probably copy this part from the old skeleton. But there seem to be more differences in the skeleton files when doing the "round trip" as described above.

Just some little hints: for Windows user it could be helpful setting the line ending of their text editor to 'Unix' and using some kind of diff tools can be quite informative.
Aranuvir
 
Posts: 1314
Joined: Sun Oct 12, 2014 2:12 pm

Re: Armature and weight painting issues

Postby blindsaypatten » Sat Apr 08, 2017 10:17 pm

Aranuvir wrote: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


Great, this is a whole lot easier than what I stayed up to 3am to accomplish using the MH Weights tab.

I don't understand the part about helpers though. Are helpers more than the clothing that gets added? When I looked at the weights for the clothes they all seemed to have zero weight. So I tried loading the base mesh with helpers and the base mesh without helpers, and I got identical weights files when exported.

In case there was any confusion, I haven't actually produced an improved weight painting yet, I have just done some test runs with a couple of joints. I expect it will take a number of hours to do a decent new painting, and there was no way I was going to invest the time before knowing that I would be able to save the results in a usable format.

After painting one knee I've come to remember what frustrated me about trying to sculpt with Blender sculpt mode, a lot of the time I just want to say, give this set of vertices the same value, rather than try to push and pull (sculpt) or paint them into submission. For the knees the calve muscles are nice smooth surfaces, just assigning the same wait along selected sections of the horizontal contours would produce a lovely smooth painting. Blender probably has a way to do it, I just have no idea what it is. I guess I could select those vertices, set a huge radius and blur them into uniformity...

Anyway, using this method I have created a painting with an improved right knee and installed it as my default weights and all seems to be well.
blindsaypatten
 
Posts: 586
Joined: Tue Mar 14, 2017 11:16 pm

Re: Armature and weight painting issues

Postby jujube » Sat Apr 08, 2017 10:45 pm

blindsaypatten wrote:After painting one knee I've come to remember what frustrated me about trying to sculpt with Blender sculpt mode, a lot of the time I just want to say, give this set of vertices the same value, rather than try to push and pull (sculpt) or paint them into submission. For the knees the calve muscles are nice smooth surfaces, just assigning the same wait along selected sections of the horizontal contours would produce a lovely smooth painting. Blender probably has a way to do it, I just have no idea what it is. I guess I could select those vertices, set a huge radius and blur them into uniformity...


I think this is what you're talking about, I found this link showing how to do it this morning. http://blender.stackexchange.com/questi ... ainting-it
Also, it seems when you select a vertex group in edit mode, then go into weight painting and change it to the option shown in the link, everything becomes transparent except for the selected group. You can then select individual vertices in the group to assign weights to.

(I wish there was an equivalent for sculpt mode, though... right now in sculpt mode you can't really do the eyes for instance very well, the eyelashes are in the way.)
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Armature and weight painting issues

Postby Aranuvir » Sat Apr 08, 2017 11:03 pm

jujube wrote:(I wish there was an equivalent for sculpt mode, though... right now in sculpt mode you can't really do the eyes for instance very well, the eyelashes are in the way.)

https://wiki.blender.org/index.php/Dev: ... lpt_Hiding
Aranuvir
 
Posts: 1314
Joined: Sun Oct 12, 2014 2:12 pm

Re: Armature and weight painting issues

Postby wolgade » Sat Apr 08, 2017 11:46 pm

blindsaypatten wrote:a lot of the time I just want to say, give this set of vertices the same value,

This could be done in Edit Mode.
screen.jpg

1. Select the vertices
2: Choose the weight
3. Assign
wolgade
 
Posts: 795
Joined: Wed Jan 30, 2013 6:50 pm

PreviousNext

Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 1 guest