Page 2 of 2

Re: Makeclothes .npz file problem. [SOLVED]

PostPosted: Sat Nov 24, 2018 8:07 pm
by Thomasmg81
MargaretToigo wrote:MakeClothes is very picky about what it will and will not process and you'll get error messages if your vertex groups aren't set up correctly, if you have mixed quads with tris (you can have all of one or the other, but not both together), if you have stray verts, or if there are ngons.

So, if MakeClothes made .mhclo and .obj files, that part worked. The .npz and .mhpxy files are made by MakeHuman when the clothing item is chosen to fit on a human.

If MakeHuman is not generating these files, check the log as there is a lot of useful information in there. And if you don't understand it, copy/paste the relevant entries and someone here will probably be able to explain what it means.

Oftentimes, the only thing that needs to be changed is the max_pole setting in the .mhclo file -- it's plain text so all you need is a text editor -- which is almost always set to 4. I have found that setting it to 8 resolves the issue of assets not compiling most of the time.

Looking at the screen grab, it appears that the clothing mesh is all quads, although there could be verts in there with more than four poles.

Once again because it bears repeating: check the logs.


When i'm using blender i am meticulous regarding double vertices, loose geometry etc i know what a pain it is. I've tried going over the model with a fine toothed comb, i've tried selecting vertices by trait, deleting any loose vertices etc and i've also been meticulous ensuring each individual vertice has been assigned to a vertex group.
Thats the reason i included the .blend file in the attachment i hoped somebody might be able to find whatever it is i'm missing.

Re: Makeclothes .npz file problem.

PostPosted: Sat Nov 24, 2018 10:07 pm
by MargaretToigo
Thomasmg81 wrote:When i'm using blender i am meticulous regarding double vertices, loose geometry etc i know what a pain it is. I've tried going over the model with a fine toothed comb, i've tried selecting vertices by trait, deleting any loose vertices etc and i've also been meticulous ensuring each individual vertice has been assigned to a vertex group.
Thats the reason i included the .blend file in the attachment i hoped somebody might be able to find whatever it is i'm missing.


If MakeClothes produces .mhclo and .obj files, then your problem is not doubles or loose geometry as those conditions will cause MakeClothes to return an error message without making the .mhclo and .obj files.

I looked at your .blend and after a cursory inspection I just clicked on MakeClothes to see what would happen and it made the .mhclo and .obj files, but would not compile in MakeHuman. This was the relevant log...

Code: Select all
Unable to load obj file: C:/Users/MRT1963/Documents/makehuman/v1/data/clothes/mens_ninja_bottoms/mens_ninja_bottoms.obj
Traceback (most recent call last):
  File "core\files3d.py", line 206, in loadMesh
  File "core\files3d.py", line 165, in loadTextMesh
  File "shared\wavefront.py", line 148, in loadObjFile
  File "core\module3d.py", line 642, in setFaces
  File "core\module3d.py", line 712, in _update_faces
RuntimeError: Incompatible mesh topology.
Failed to index faces of mesh mens_ninja_bottoms.obj, you are probably loading a mesh with mixed nb of verts per face (do not mix tris and quads). Or your mesh has too many faces attached to one vertex (the maximum is 6-poles). In the second case, either increase MAX_FACES for this mesh, or improve the mesh topology. Original error message: (<type 'exceptions.ValueError'>) could not broadcast input array from shape (7) into shape (6)
Failed to load C:/Users/MRT1963/Documents/makehuman/v1/data/clothes/mens_ninja_bottoms/mens_ninja_bottoms.obj


This almost always means that max_pole is set too low. I loaded the .mhclo into a text editor and saw that max_pole was set to 6. I changed it to 8, saved the file, clicked on the icon, and lo and behold, it worked...

Screen Shot 2018-11-24 at 4.25.29 PM.png
mens_ninja_bottoms in makeHuman, max_pole set to 8


And yes, I see that the log up there reads that "Or your mesh has too many faces attached to one vertex (the maximum is 6-poles)" and I don't know why it says that because I've seen max_pole set much higher than that.

Re: Makeclothes .npz file problem.

PostPosted: Sat Nov 24, 2018 11:29 pm
by Thomasmg81
Thank you very much Margaret, it is working for me now as well.

Sorry, i have one last question, can you explain to me what max pole is?

Is this a method declaring maximum number of polys?


This fix is very hard to find. Can i suggest an admin makes it more readilly accessible?

Re: Makeclothes .npz file problem.

PostPosted: Sun Nov 25, 2018 3:02 am
by loki1950
It's the maximum number of faces that meet at one vertex(pole).

Enjoy the Choice :)

Re: Makeclothes .npz file problem.

PostPosted: Sun Nov 25, 2018 5:22 am
by Thomasmg81
loki1950 wrote:It's the maximum number of faces that meet at one vertex(pole).

Enjoy the Choice :)



Thanks for the clarification.

For me its not enough to understand what i did incorrectly, but also to understand whats happening when its working correctly.

Re: Makeclothes .npz file problem.

PostPosted: Sun Nov 25, 2018 10:53 pm
by MargaretToigo
Thomasmg81 wrote:For me its not enough to understand what i did incorrectly, but also to understand whats happening when its working correctly.


Actually, you didn't do anything incorrectly. Your ninja pants are rather well made. What probably got MakeClothes all confused were the little tie-offs on the back of the pants legs -- a nice touch of detail, BTW.

Those tie-offs are bunch of vertices, close together. It's hard to tell just looking and selecting various edge loops (to see where they go), whether there are any verts in there with more than six poles, but when you have a lot of vertices close together, you sometimes have to increase max_pole to get the clothing item to compile in MakeHuman. I don't really know why this is, it's just what I've experienced.

Whenever something goes through MakeClothes and makes the .mhclo and .obj files, but won't compile in MakeHuman, the very first thing I try is increasing max_pole, which resolves the issue most of the time. This should be considered as part of the process of making clothing items for MakeHuman because as you add more details to an article of clothing -- this is essential if you're going for realism -- the process itself also becomes more complex.

Re: Makeclothes .npz file problem.

PostPosted: Mon Nov 26, 2018 11:19 am
by Aranuvir
The max_pole thingy was addressed 1.5 years ago and should be fixed with the recent alpha release, though MH will still show a warning if max_pole is exceeded, but it should work. If anyone could test? Attention: The default output folder was changed to v1py3 for that version!
Furthermore, I think to remember there were situations were MC created incomplete mhclo/obj files. If an asset does not load it could be a good habit to check the consoles for error messages and delete all files of the newly created asset, before running MC again.

Re: Makeclothes .npz file problem.

PostPosted: Mon Nov 26, 2018 3:00 pm
by wolgade
Aranuvir wrote:MH will still show a warning if max_pole is exceeded, but it should work. If anyone could test?

I tested with the alpha version provided by the PPA (Ubuntu 18.04) and a simple filled circle (16-pole). Worked.

Re: Makeclothes .npz file problem.

PostPosted: Mon Nov 26, 2018 3:04 pm
by Aranuvir
wolgade wrote:I tested with the alpha version provided by the PPA (Ubuntu 18.04) and a simple filled circle (16-pole). Worked.

Great. That's good to know. Thanks for testing. :D