Page 1 of 2

MakeClothes Traceback error

PostPosted: Sat Apr 25, 2020 5:33 pm
by Danewilliams
I just made something new in Blender with MakeClothes, but every time I press the makeclothes button I get a traceback error. What should I do?

Re: MakeClothes Traceback error

PostPosted: Sat Apr 25, 2020 5:46 pm
by loki1950
Very hard to read error messages on a screen shot making the report almost useless try going to the blender console then copy/pasting the trace back to a text file then posting here.

Enjoy the Choice :)

Re: MakeClothes Traceback error

PostPosted: Sat Apr 25, 2020 6:14 pm
by Danewilliams
Traceback (most recent call last):
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\makeclothes\operators\createclothes.py", line 85, in execute
(b, hint) = mc.make()
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\makeclothes\core_makeclothes_functionality.py", line 179, in make
self.findBestFaces()
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\makeclothes\core_makeclothes_functionality.py", line 277, in findBestFaces
for polygon in self.humanmesh.vertPolygons[vertIdx]:
KeyError: -1

location: <unknown location>:-1

Re: MakeClothes Traceback error

PostPosted: Sun Apr 26, 2020 3:45 am
by loki1950
@punkduck @Aranuvir Your code guys ;)

Enjoy the Choice :)

Re: MakeClothes Traceback error

PostPosted: Sun Apr 26, 2020 7:14 am
by Aranuvir
I think I'll have to ask Punkduck here. If I understand the error correctly some vertex indices get negative values, which shouldn't happen. @Danewilliams: As a basic workaround get the latest version of MakeClothes. I'm not sure, if we update the downloads from tuxfamily automatically. Therefore I'd recommend to download directly from github. Then run check human and check clothes, too.

Re: MakeClothes Traceback error

PostPosted: Sun Apr 26, 2020 10:51 am
by punkduck
Hi

I am not sure if we already checked everything what can go wrong, although my friend Elv and myself are using the new tool very often.

It looks like you created group(s) on human and clothes. But no vertices are assigned to the group for the human ... but I am not sure. Could that be the reason?

Greetings
punkduck

Re: MakeClothes Traceback error

PostPosted: Tue Apr 28, 2020 4:14 pm
by Danewilliams
Maybe that is the reason, but I'm afraid I can't tell. If it is the reason, could you please tell me how to fix it? This error is really annoying.
Can you tell from this image?

Re: MakeClothes Traceback error

PostPosted: Tue Apr 28, 2020 7:58 pm
by punkduck
Hi there

According to the line numbers of the traceback it is an early version released approx. in December. I added code after that to work with so-called rigid-groups. When testing it I forgot to assign at least 3 vertices in one case. And I got a similar error.


So I already added code to avoid this error. If the following error would still happen it would be line 322 today, not line 277

Code: Select all
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\makeclothes\core_makeclothes_functionality.py", line 277, in findBestFaces
for polygon in self.humanmesh.vertPolygons[vertIdx]:
KeyError: -1


So we have to make sure you use a newer version.

Just to understand the problem:

Blender tries to find the nearest vertex for each vertex of your piece of cloth on the human (or helpers, if you use them). To avoid problems when using helper and body and for more flexibility we don't use the whole geometry of the human. So you have to create at least one group on both objects with vertices assigned.

So "body" must be a group on your human and your clothes then (I would call this group head btw ;) ) . Select the vertices of the head on the human and assign them to "body". Make sure this group on the human is not empty. It must contain at least 3 vertices, but in your case take the whole head except the ears and the inside of the mouth + at least one loop outside of the mask ...

If the error now will appear again with the new line number then I have to fix something. I guess in this case I will need the blend file itself ... because this -1 is a result from the blender internal find_n function of the KD-tree and I don't have an idea what still can go wrong ( :ugeek: )

Re: MakeClothes Traceback error

PostPosted: Wed Apr 29, 2020 4:21 am
by Danewilliams
punkduck wrote:Hi there

According to the line numbers of the traceback it is an early version released approx. in December. I added code after that to work with so-called rigid-groups. When testing it I forgot to assign at least 3 vertices in one case. And I got a similar error.


So I already added code to avoid this error. If the following error would still happen it would be line 322 today, not line 277

Code: Select all
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\makeclothes\core_makeclothes_functionality.py", line 277, in findBestFaces
for polygon in self.humanmesh.vertPolygons[vertIdx]:
KeyError: -1


So we have to make sure you use a newer version.

Just to understand the problem:

Blender tries to find the nearest vertex for each vertex of your piece of cloth on the human (or helpers, if you use them). To avoid problems when using helper and body and for more flexibility we don't use the whole geometry of the human. So you have to create at least one group on both objects with vertices assigned.

So "body" must be a group on your human and your clothes then (I would call this group head btw ;) ) . Select the vertices of the head on the human and assign them to "body". Make sure this group on the human is not empty. It must contain at least 3 vertices, but in your case take the whole head except the ears and the inside of the mouth + at least one loop outside of the mask ...

If the error now will appear again with the new line number then I have to fix something. I guess in this case I will need the blend file itself ... because this -1 is a result from the blender internal find_n function of the KD-tree and I don't have an idea what still can go wrong ( :ugeek: )


I use MakeClothes 2.
What should I do?
Please, be specific.
Thank you.

Re: MakeClothes Traceback error

PostPosted: Wed Apr 29, 2020 3:37 pm
by loki1950
Use the latest code the code you are using is old and has since been replaced. Get it directly from the GitHub repo that is always the latest code.

Enjoy the Choice :)