Creating texture/material presets for existing clothes

A place for unofficial tutorials posted by MH users

Moderator: joepal

Creating texture/material presets for existing clothes

Postby MatCreator » Sun Sep 26, 2021 9:57 pm

hello everyone, i hope you are all enjoying yourself and staying safe...

i finally made some progress with my understanding and creation of clothes, but seem to be having trouble applying and saving material presets.

with my first few runs of making clothes (i have stuff available for the community), i was importing my clothing meshes already textured, and when i would save the clothing item, the material also saved as a default loaded with the clothing item. i dont even remember having an issue with the makeskin plugin, but something in my workflow must have changed, the textures are not saving with the clothing, the materials load with the clothing item, but go away during the save. if i try to check the texture view in blender, the clothing item becomes invisible, and in makehuman, the texture/material doesnt even show, the item in question is shiny white.

can someone explain very slow, step by stem, the process of making and saving texture/material presets for the clothing items we generate?!? i must have forgotten something in the process, its all a mess on this end. can we simply load a clothing item, apply textures and materials and save the preset w/o having to go thru the "make the clothes" process? i wanted to make several variations for the same clothing item, the practice will be good for me.

thanks in advance...
MatCreator
 
Posts: 35
Joined: Tue Jun 25, 2019 12:47 am
Location: the 4th dimension

Re: Creating texture/material presets for existing clothes

Postby woodcat » Sun Sep 26, 2021 10:46 pm

MatCreator wrote:i wanted to make several variations for the same clothing item

You can use the "Material Editor" tab in the Utilities section of MakeHuman to assign additional textures to the completed clothes.
Curiosity killed the cat, but satisfaction brought it back.
User avatar
woodcat
 
Posts: 72
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow

Re: Creating texture/material presets for existing clothes

Postby MatCreator » Mon Sep 27, 2021 4:59 am

the problem is that the texture/material i set up in blender using the makeskin plugin isnt transferring over when i save the clothing item. im hoping once i figure out what im doing wrong, i can then make several variations for the same item, and save those as presets for the clothes that i would be able to apply from the material editor in makehuman.

but my textures/materials arent saving at all. i load the clothing item in blender for makecloth2, and because ive already made the textures for it, the .mtl is read so the .obj loads with textures applied. i go thru the steps to create/save the item, but the textures arent saving so once in makehuman the item in question loads shiny white.

im hoping there is a way i can load the item in, apply textures/material settings, and save them as variations for the piece of clothing.

i havent upgraded my blender, so i dont know why it isnt working anymore, i didnt have this problem before and made material variations/presets in the past with no issue.
MatCreator
 
Posts: 35
Joined: Tue Jun 25, 2019 12:47 am
Location: the 4th dimension

Re: Creating texture/material presets for existing clothes

Postby punkduck » Mon Sep 27, 2021 9:19 pm

Hi

No texture colors applied or the shiny white normally means makeskin is not even called. Can you check your Blender logfile?

We print out some texts in the logfile like in line 128 (see link) ... we always print sth, like a "useful version is available" ,,

https://github.com/makehumancommunity/community-plugins-makeclothes/blob/48f8193496927978d5febd1d7fde57d0bde177cb/makeclothes/utils.py

We should figure out that first. And woodcat also is correct. It also works without makeskin. In a way makeskin is a helper and a possibility to make the texture visible in Blender before it is exported to MakeHuman.

In your case even an automatisation could be done. .mtl and .mhmat files are both ASCII files. If you compare some of these files you may notice that the rules to convert one file to the other are not too complicated. The things you have to check are the correct (relative) paths of the textures and some keywords and numbers. Both files describe more or less the same. The real work does the texture itself ;)


Greetings
Punkduck
User avatar
punkduck
 
Posts: 1135
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Creating texture/material presets for existing clothes

Postby MatCreator » Tue Sep 28, 2021 11:31 am

I was able to hack multiple copies of the material file to direct them to the various textures required for the presets, but for some reason saving them just wasn't working. I got one to work, but after that they would continue to show in MakeHuman with the "missing texture" texture... It got to a point where i just started taking out any spaces in the texture name and replacing with "_" just to make sure. Don't know if that's what actually did it, but they started working somehow =/

Thanks for the help, greatly appreciated =)
MatCreator
 
Posts: 35
Joined: Tue Jun 25, 2019 12:47 am
Location: the 4th dimension

Re: Creating texture/material presets for existing clothes

Postby MatCreator » Tue Sep 28, 2021 11:41 am

I did peek into the log, not that I know anything about it. I ""think"" it said something about the files where missing, but they were right there. the makehuman file called for them (without a path or directory, I assume this is because it reads from the same folder, and I always edit my .mtl files and remove the path, so the texture and object are read from and exit in the same folder) but i guess didnt follow their linking... I think the spaces in the texture name for example "red leather" wont work, but "red_leather" would, make the difference?!?
MatCreator
 
Posts: 35
Joined: Tue Jun 25, 2019 12:47 am
Location: the 4th dimension

Re: Creating texture/material presets for existing clothes

Postby punkduck » Tue Sep 28, 2021 4:02 pm

MatCreator wrote: I think the spaces in the texture name for example "red leather" wont work, but "red_leather" would, make the difference?!?


The name is "cleaned" in

https://github.com/makehumancommunity/community-plugins-makeclothes/blob/master/makeclothes/core_makeclothes_functionality.py
Line 429. We throw blanks out ...

Yes ... the reason is the syntax and rather simple interpreter inside MakeHuman for the .mhmat files.

I think this configuration file is simply split by "words" and so the file name ends at the first blank inside the name.

I never tried if the code is able to handle sth like this using "..." :
diffuseTexture "diffuse texture.png"

But I guess not. So we try to feed "MakeHuman" with a modified name without a blank. Unfortunately it is not documented.

So in a way "historic reasons".
User avatar
punkduck
 
Posts: 1135
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest