Creating a clothes library: some technical aspects

If your topic doesn't fit anywhere else, put it here.

Moderator: joepal

Re: Creating a clothes library: some technical aspects

Postby duststorm » Mon Feb 20, 2012 6:21 pm

I tried to make a better fitting version of the jeans that doesn't disappear into the body.

To do this, I opened the file in Blender and viewed the jeans together with a duplicate of the human base model, of which I deleted the skirt helper to give me a reference.
Additionally I created another duplicate of the human character without any helpers, also for reference. I place them on separate layers so I can make them visible or invisible when wanted.

Then I went into edit mode, changed the edit mode to "normal" space. I could then select vertices or faces, press two times "z" to move them outwards along their normals. The picture illustrates this.
fitting_fixup.jpg
Normal space editing for fitting clothes to helper mesh.

I did this first with the low resolution original jeans mesh, but because of it's low detail it was not possible to avoid any face intersections. So I just made sure all vertices were outside the pants helper mesh.
Then I went to subdivision level 2 of the jeans, and repeated the process. You can't edit the subdivided levels directly with the "multires" modifier, but there's a way around it:
- duplicate your mesh (with multires modifier)
- on the duplicate, apply the multires modifier at the wanted level (the level is set on the "preview" slider)
- edit this mesh
- now with this mesh selected, shift+right click the original mesh, that still has the multires modifier in it's stack
- Set the preview slider at the same level as the one applied to the edited mesh
- Now press the "Reshape" button. The changes you made to the edited mesh are applied to that detail level of the mesh
Note that you can only move vertices or faces, you cannot add or delete them. The reshape button just copies the vertex locations.

Got the idea from http://www.3dbuzz.com/vbforum/showthrea ... s-versions

However, the result was no joy. The jeans fits well now and doesn't intersect much anymore, but there's some nasty fitting artifacts now.
I don't know what the cause is. Thomas, I read some commit where you "fixed matching, don't understand how it even worked before". I believe my previous fits were done before this commit. Could this be the cause?
Let's have a look at the results:
fitting_comparison.jpg
Comparison between my old fit and new one

The right one is the old jeans I made, which is downloadable. It intersected with the body, but the topology of the jeans itself was kept pretty much intact.
Note how the smoothness and curve of the crotch area is destroyed. The back is a mess too. The area around the top of the jeans always was a little of a problem, but now the edges are really jagged, which is very noticeable in the texturing.
There are also lots of distorted bumps and holes.
Also note how the middle area between the legs, vertices that were added to the Mid vertgroup, is sticking out downward a lot.
The old fit was done on both helpers and body, the new one only on the helpers. I also tried fitting on both body and helpers again, but it's bad too. It's a little better in the crotch area, which is smoother, but there's lots of strange bumps too, and the upper edges are even more jagged.

Fitting the original low resolution also illustrates the problem where the smooth curve at the crotch is gone and changed with a dark shadow:
fitting_crotch.jpg


There could of course be some other reasons why it didn't work as it should. I used the default vertex grouping using auto groups, with Mid, left and right both on human mesh and clothes.
I corrected vert grouping of the jeans a bit manually to only include the edgeloop going through the middle.
The old version was made with only left and right groups.

Bottom line is, I fixed one problem, and got a lot more in return :(.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby duststorm » Wed Feb 22, 2012 12:34 pm

Apparently part of the previous post was false alarm. I don't know what happened exactly, but I remembered that the blend file with the jeans contained an older MH export. So I made a fresh export and fitted the jeans to that and some of my problems went away.
Did some vertices change order or something?

Maybe the clothes script should check against MHX export version and warn when it differs. Is there a way of storing a version parameter within the blend file to keep track of what version was used? It might help with debugging problems later.

So it's better now, but there are still some problems:
I made sure that I didn't fit to separate meshes, so I assigned left, right and mid only to the red helper (for pants and shirts).

When using the "Mid" vertex group on the jeans I always get this strange bulge going downward in the middle of the crotch.
mh_midfitting_errors.jpg
Strange middle section in the crotch when using mid vertex group for fitting


Without the "Mid" group assigned to the jeans it's better:
mh_nonmidfit_errors.jpg
Without mid group fitting

crotch_errors.jpg

But still some errors.
These two screens are on the standard unchanged mesh you start with in MH.

These errors become larger with some morphs, for example when sliding "height" and "weight" sliders all the way to the left.
This could also be caused by morphs (of helpers?) that are not perfect yet. The crotch area of the human model still behaves a little strange in these extreme morphs anyway.

So on the whole it works like before. The problems with the crotch area could be because I fit to helpers now, before I fitted to body+helpers. The human mesh contains a lot more faces there than the helpers, which could be the reason why this worked better before.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby duststorm » Wed Feb 22, 2012 3:48 pm

Another question I was wondering about:
There are also some minor issues when fitting. Basically slightly displaced vertices which break from the topology of the model. This causes some obvious artefacts in the textures, but is ofcourse less important.
topo_errors.jpg
Topo errors created when fitting. Because of bad triangles?

Are these caused by fitting to so-called "bad triangles"?
Could there be a solution to (manually?) improve their offset positions?
Maybe there is a solution in (dynamically) catmull-clark subdividing the helper meshes if no good fitting can be found? Or will this not solve the problem?



This is related to the problem in the previous post:
I think this is the reason why the crotch area is badly matched.
cause_of_matching_errors.jpg
Possible cause of bad clothes matching of crotch area

Orange mesh is the jeans, the black one is the helper that it's matched against.
The number of polygons is a lot higher.
I wonder if there is a way of matching it relatively to the helpers so that it also gives a certain importance to keeping the same shapes (relative positions of each vertex in the clothes to their neighbours)
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby duststorm » Wed Feb 22, 2012 4:44 pm

Ok, I'm really stupid. :)
The "minor" issues are really non-issues. The small errors in topo are also in blender... at the right subdiviion levels.
They are caused by the sculpted folds, and are the best approximations at that subdivision level. Matching works like it should there.
The reason I didn't notice it earlier was because in Blender I mostly viewed the model at full resolution.
A golden advice, don't use blender's pinch/magnify brush when sculpting (it destroys your topo). Or at least UV unwrap after sculpting.

So the only problem is the crotch area. I believe one of the causes is that it doesn't follow the helpers too well.
The other cause is that at subdivision level 2 there is a lot more geometry there in the jeans than there is in the helpers, even though the other areas have similar resolutions. It's just a difference in topology.
Question is how to solve it. Only export low resolutions to MH or is there a workaround?

Here's a detailed comparison of the situation. Until now I've been trying with the medium (LOD2) version. I will try to see what happens with the LOD1 version.
crotch_topo_comparison.jpg
Comparing jeans topo at different LOD levels with helper topo



I did a test with LOD1, as expected, it works better. When not using the Mid group and fitting to helpers only. It's still not perfect though.
When fitting it to both body and all helpers it's better.
However, the old version of the fitting was still better. For one reason or another it kept the topology much better than now.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby ThomasL » Wed Feb 22, 2012 7:46 pm

Hi duststorm. You have really been busy.

My claim that it could not have worked before was premature. The algorithm projects a clothing vert onto a body triangle, and assigns weights based on the distances between the image and the triangle corners. However, it turned out that I made a second projection of the image triangle to the horizontal plane. Fortunately this extra projection did not change the relation between distances and hence not the weights. In practice, the only difference is that the old algo broke down if a clothing face is perfectly vertical. Which happened to me when a modelled a simple skirt starting from a vertical cylinder.

The crotch area is really tricky, because it is covered with lots of very small faces. Did you try to give your character genitalia? The male version will definitely break every kind of trousers, and female genitalia give problems too. You may choose vertex group to avoid associating trousers with the genital region, but this will lead to a very tilted projection and new problems. I don't know what to do with it.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some technical aspects

Postby duststorm » Wed Feb 22, 2012 10:12 pm

About the genitalia, I think we should just make it work with the default (slider in the middle) doll-type.
Since clothes will be added they probably don't have much use, and indeed it's near impossible to make it work.

Otherwise, the helpers can really help out here. If precaution is taken that they bulge correctly around the genitalia all clothes can just be fit on those.
I've never tried actually changing the genitalia slider in MH, but I'm pretty sure it will screw things up, especially if jeans are matched to the body vertices.
I actually only tested matching to body verts because that is what I did before, and I didn't have the problem at that time (the old version of the jeans fits well without the problems at the crotch area, strangely enough). I believe the reason why it works better is simply because there are more faces to match to.

I think what we should ask ourselves is: is there a way to improve matching when triangle count in a certain area is higher than the helper mesh and/or it's shape doesn't follow the helpers closely?
If not, should be alter the helper mesh or add another one (or at least for the crotch part) with more detail and that closes less tightly at the crotch to make regular pants fitting work better?
Or are there other alternatives? Like manually tweaking fits, ...

The crotch area is the difficult point for a jeans, and actually most types of pants for that matter. The current helper works for bathing suits and underwear, but not much more. But it's actually still a pretty standard case. If we can solve this one we might have a good chance of tackling harder cases too.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby ThomasL » Thu Feb 23, 2012 5:10 am

Forget my previous comment. The only pants I made was before the helpers were introduced, and I didn't realize that they should fix the topology of the crotch area.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some technical aspects

Postby duststorm » Thu Feb 23, 2012 11:55 am

I just wonder if all types of clothes that deviate from the helpers will require new helpers or that we can work around this obstacle.

Thomas, do you have an idea what made fitting the jeans with a recent makeClothes script do weird things when a MHX export of about a month old (saved in a blend file) was used? Did vertex orders or positions change a bit or something else?
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby Maia1003 » Thu Mar 01, 2012 9:54 pm

Hi,

Thank you all for this great job.

I am a newbie in makehuman, and I must confess that I already tried to follow the Tailor's guide to try to make the Socks, but I failed. I have to go back to re-do it again, I don't know where I missed something.

So, I am really impressed about the fact that you have finished this "jeans" project.
But, when I copied all the "jeans" directory to makehuman/data/clothes, though I have the new jeans on the Library/Clothes tab, I can't actually select it and put on a character: could you tell me what wrong could I do ?
Thank you for your help,

Cheers,
Maia
Maia1003
 
Posts: 27
Joined: Thu Mar 01, 2012 9:42 pm

Re: Creating a clothes library: some technical aspects

Postby duststorm » Mon Mar 05, 2012 11:43 am

What version of makehuman are you using?

Just double click it in the library, your view should change to the human again and he should be clothed.
What happens in your case?
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

PreviousNext

Return to General discussions about makehuman

Who is online

Users browsing this forum: No registered users and 1 guest