Creating a clothes library: some technical aspects

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

Moderator: joepal

Creating a clothes library: some technical aspects

Postby duststorm » Fri Jan 27, 2012 3:01 pm

Hi all,

I'm creating a set of casual clothes for clothing my makehuman characters. If people are interested I'm willing to share them, for example to be included in MH. The purpose is to create a library of people and interchangeable clothes (with different textures or color/pattern variations) to quickly create crowds of people. Much like, for example, RocketBox people packages.
The library would include things like jeans, t-shirt, shirt and others both for males and females.

Here's a preview of what I'm working on now. The texturing is not done yet:
jeans_preview.jpg
Preview in Blender


Now, to make these really useful for MH users, the clothes have to scale together with the exported MH mesh. I'm looking to create reusable .mhclo files but I have some questions concerning this:
- At the moment, are loosely fitting clothes supported?
For example the jeans is not tight fitting. It's male jeans that fits loosely around the legs (which actually makes it easier to fit it on more models without intersections). If I would create a .mhclo file of my jeans and export it with a MH model, will it fit tightly around the body or will it respect the relative distance to the legs?

- The model is created from the low poly trousers mesh, subdivided and wrinkles are sculpted in. Can I distribute those?
Or will it only be possible to bake the ambient occlusion map on the texture and supply a normal map? At the moment I have the jeans in blender with a "Multires" modifier applied. The cool thing about this is, I can still modify the low resolution mesh, and the subdivided smoothed mesh will follow accordingly, leaving all the sculpted details intact.

- Finally: are there special things I need to be aware of to make it work?
I know the clothes need to have a UV map identical to the MH base mesh, but apart from that..
For example, I'm starting from the exported clothes meshes and modify those. Can I remove or add vertices to those?
Also, I'm working on a MH to blender 2.6 export which came from MakeHuman 3124 nightly. Did anything change that would break it for newer versions of MH?
Last edited by duststorm on Sat Feb 04, 2012 8:41 pm, edited 1 time in total.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Creating a clothes library: some questions

Postby duststorm » Fri Jan 27, 2012 3:05 pm

*duplicate post* (sorry for that)
Last edited by duststorm on Fri Jan 27, 2012 9:18 pm, edited 1 time in total.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby robertltux » Fri Jan 27, 2012 5:50 pm

duststorm wrote:Hi all,

- The model is created from the low poly trousers mesh, subdivided and wrinkles are sculpted in. Can I distribute those?
Or will it only be possible to bake the ambient occlusion map on the texture and supply a normal map? At the moment I have the jeans in blender with a "Multires" modifier applied. The cool thing about this is, I can still modify the low resolution mesh, and the subdivided smoothed mesh will follow accordingly, leaving all the sculpted details intact.

- Finally: are there special things I need to be aware of to make it work?
I know the clothes need to have a UV map identical to the MH base mesh, but apart from that..
For example, I'm starting from the exported clothes meshes and modify those. Can I remove or add vertices to those?
Also, I'm working on a MH to blender 2.6 export which came from MakeHuman 3124 nightly. Did anything change that would break it for newer versions of MH?


actually the UV map does not have to match the human mesh (but i would use a white card for your mask file)
have you sorted out how to run the MakeClothes blender plugin??
robertltux
 

Re: Creating a clothes library: some questions

Postby duststorm » Sat Jan 28, 2012 11:46 pm

I have the model and textures pretty much finished, so I tried running the MakeClothes script.
Unfortunately I ended up with an error. Here is the full output:
Code: Select all
Unvertex diamonds in <bpy_struct, Object("IkkeMesh")>
Creating directory /home/duststorm/jeans
Creating clothes file /home/duststorm/jeans/jeans.mhclo
0 3799 0.0313920467578342 Left 0 105
10 3767 0.0765935606996539 Left 0 105
20 4517 0.07829916000671833 Left 0 105
30 1626 0.14957660306463125 Left 0 105
40 1633 0.3636143171770729 Left 0 105
50 1719 0.4745001134707287 Left 0 105
60 1781 0.10138913901788506 Left 0 105
70 1876 0.38749207224785553 Left 0 105
80 1797 0.3667748605641418 Left 0 105
90 1690 0.28768516094459134 Left 0 105
100 2995 0.5413499226998636 Left 0 105
110 2125 0.296934932670237 Left 0 105
120 2117 0.2991301898965777 Left 0 105
130 1862 0.4747597379622612 Left 0 105
140 4323 0.14040788814211394 Right 1 106
150 1641 0.08864416425209673 Left 0 105
160 3906 0.16340706517205691 Right 1 106
170 4121 0.08340642462927639 Right 1 106
180 3917 0.12450873190903604 Right 1 106
190 2978 0.13983110963529055 Left 0 105
200 4183 0.21961526731871678 Right 1 106
210 7589 0.23111605225422355 Right 1 106
220 1935 0.4176312457620601 Left 0 105
230 1708 0.4875706100870423 Left 0 105
240 1724 0.3210925270594584 Left 0 105
250 4149 0.2933273808365977 Right 1 106
Setting up face table
Finding weights
Finding best weights
Optimal triangles not found for the following verts
41
53
54
55
56
57
58
59
86
101
130
201
Done
No file /home/duststorm/makehuman/proxy_header.txt
No file /home/duststorm/documents/makehuman/proxy_header.txt
No file /proxy_header.txt
Array iterator out of range: Mesh_vertices_lookup_int (index 8697)
Traceback (most recent call last):
  File "/home/duststorm/Blender-MH-tests/ikke_sculpt2.blend/make_clothes.py", line 2225, in execute
  File "/home/duststorm/Blender-MH-tests/ikke_sculpt2.blend/make_clothes.py", line 1247, in makeClothes
  File "/home/duststorm/Blender-MH-tests/ikke_sculpt2.blend/make_clothes.py", line 507, in printClothes
  File "/home/duststorm/Blender-MH-tests/ikke_sculpt2.blend/make_clothes.py", line 649, in printScale
IndexError: bpy_prop_collection[index]: index 8697 out of range, size 8271


It goes out of bounds at vertex index 8697. When I click the "print vertex numbers" it confirms that there are only 8270 (I think) as it prints out this:
Code: Select all
...
8266
8268
8269
8270
End verts


Any quick hints to guide me through? Is the thing about not finding proxy_header.txt a problem? I did not find any info on this file, nor did I find such a file anywhere on my harddrive.
I have followed the tailoring guide and removed all parents/modifiers from MH and jeans mesh (I clicked the eye icon to hide them in viewport). Actually I also tried removing them, without any luck.
I'm using Blender 2.6 on Ubuntu linux 10.4 if that helps any.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby robertltux » Sun Jan 29, 2012 9:52 pm

duststorm wrote:I have the model and textures pretty much finished, so I tried running the MakeClothes script.


Any quick hints to guide me through? Is the thing about not finding proxy_header.txt a problem? I did not find any info on this file, nor did I find such a file anywhere on my harddrive.
I have followed the tailoring guide and removed all parents/modifiers from MH and jeans mesh (I clicked the eye icon to hide them in viewport). Actually I also tried removing them, without any luck.
I'm using Blender 2.6 on Ubuntu linux 10.4 if that helps any.


i don't know about the proxy_header.txt thing and most of my attempts have been using meshes that are subsets of the human mesh. Perhaps one of the MH team can shed light on this file (im also missing that file). Just as a sanity check could you try grabbing the OBJ from an existing clothing item and running the Makeclothes script with that??
robertltux
 

Re: Creating a clothes library: some questions

Postby ThomasL » Mon Jan 30, 2012 3:43 am

Hi duststorm,

The immediate cause of the problem is the verts that define the boundary box of the relevant body part, defined at the bottom of the Make Clothes panel. Specifically, if MakeClothesBodyPart = Head the X2 vert 8697 trigger the error.

The boundary box is used to change the scale of offsets. Clothes conform to the body, but there can be some space between the skin and the cloth. This distance is scaled to make it look good on both dwarfs and giants.

However, this is the symptom. The real cause is that there is something wrong with your human mesh; it has too few verts. The human must be an MH mesh exported with helper geometry, which has around 18528 verts. It also works with an old MH mesh with 15340 verts. It is important that the joint diamonds are there. If the diamonds are deleted, the vertex numbers change and the mhclo file becomes garbage.

I really don't understand how you can have a human mesh with 8271 verts. It is too much for a proxy. Have you deleted some verts manually?

Anyway, I added a test for mesh size to make_clothes, to get a better error message.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 10:12 am

ThomasL wrote:However, this is the symptom. The real cause is that there is something wrong with your human mesh; it has too few verts. The human must be an MH mesh exported with helper geometry

Thanks for pointing me to this problem! Ofcourse! I'm stupid ;)
I edited the MH mesh and placed another head (from a 3D scan) on it. No wonder it misses vertices.

So, just to be clear: for MakeClothes to work, you need an unchanged MH mesh (with helper geometry). Your clothes mesh, however, can have an arbitrary number of vertices (so you don't, for example, need to reuse the exported sample clothes -- or at least you can add or remove vertices from them)

What I will do is import my jeans in a blender file with a clean MH character exported from MH and try again.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby ThomasL » Mon Jan 30, 2012 12:18 pm

duststorm wrote:So, just to be clear: for MakeClothes to work, you need an unchanged MH mesh (with helper geometry). Your clothes mesh, however, can have an arbitrary number of vertices (so you don't, for example, need to reuse the exported sample clothes -- or at least you can add or remove vertices from them)


Correct. Makeclothes associates each clothing vert with a human mesh triangle, i.e. a triplet of human verts. To correctly identify these human verts, their vertex numbers must remain intact. There are no restrictions on clothes meshes.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 2:42 pm

Very good news.
I did it! First some screens:
extremes_fitting_lowres.jpg
Fitting low res jeans to different MH models in MH


It works pretty well, and fitting does quite a good job even on extremes.
The jeans stays nicely away from the legs and even the crotch area, where you might expect some problems, behaves quite well. Note that I made these screens using the Ascottk proxy in MakeHuman, because I don't seem to be able to get clothes to show on top of the high resolution mesh (this is a general problem I have with all clothes).

The .mhclo might still be tweaked a little, as for example I'm having a few visible texture seams due to deformation.
errors.jpg
Noticeable texture seams


This is only the low resolution version. I'm still making the high resolution version, which takes ages since it has 60.000 quads!
For general usage you would probably prefer a low or medium resolution version with a normal map applied.

For those who want to experiment themselves, I've attached a clothes package for makehuman. It has the same name as the original jeans, so it will replace them. I should probably have chosen a different name for it.
I have not yet included a normal map with the lighting information for the folds, but I don't know whether MH already has a shader capable of doing that, and how I would attach it to clothes. Anyway if you're exporting to another application you would be interested in having the normal map.

The supplied textures are scaled down, as I'm having trouble sharing the originals due to their size.
Attachments
jeans.zip
Jeans low res clothes package for MH
(392.89 KiB) Downloaded 692 times
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby Manuel » Mon Jan 30, 2012 3:24 pm

Very good indeed!
Do you like a makehuman blog access in order to post some articles about your progress?

Best,

Manuel
Manuel
 

Next

Return to General discussions about makehuman

Who is online

Users browsing this forum: No registered users and 1 guest

cron