Page 1 of 1

Hair with particle systems (a bit of a hack)

PostPosted: Sat Feb 19, 2022 4:52 pm
by joachip
Okay, so it's possible to specify a blender material that should be included when importing a human into blender. That's really cool. But it seems particle systems cannot be set up in the same way. So I made a crude hack to allow that. So now you can put this into the .mhmat file:

Code: Select all
blendMaterial short01_particles.blend/materials/short01_random
blendParticles short01_particles.blend/particles/short01_particles

The first line tells makehuman to use a specific blender material coming from a blender file. The Second line tells it to also get a particle system from that .blend file.

This way it's possible to have particle based hair set up in MakeHuman. You will not be able to see this inside MakeHuman itself, but once you use the "MakeHuman v1.1.0" plugin for Blender 3.0.0 and click "Import human" you will get paticle hair!

How to install:
Unpack the zip file into C:\Users\username\Documents\makehuman\v1py3\data\hair\
Then unpack the file into C:\Users\username\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\ and click "yes" to overwrite existing files.

Disclaimer: I am not a python developer, so there could easily be bugs in what I did. I hope someone better at python will know how to implement this more correctly and perhaps even put it in MH's source code somehow.

Re: Hair with particle systems (a bit of a hack)

PostPosted: Sun Feb 20, 2022 8:12 pm
by punkduck

I tested it and did a diff to find out the changes, you took the short hair and used the mesh as a basis for the emitter of the hair? The problem then is: there are faces perpendicular to the scalp itself. So from these faces the hair would start in the air and would grow "sideways". However it is possible just to do a scalp duplicate of the head itself. And use this instead of the given hairdo. Of course in MH it looks a bit odd then.

Better switch off the visibility of the emitter planes btw.

For short hairdos most would work out of the box. For more complicated hairdos it kinda works, but different. In these cases blender not only saves the particle parameters, but also the position of the strands.

However it would be limited: it is possible that the scalp resizes to a different head, but hair length then would stay the same, so for a smaller head the hair e.g. will disappear in the shoulder.

I can un-attach the hairdos from my characters and swap them, but usually a different character needs some fine-tuning with combing at least. So the principle itself is correct.

And yes, you made the material rather similar to the "blender-material" inside makeskin. So what python code concerns, my code wouldn't be better ;)

Greetings, punkduck

Re: Hair with particle systems (a bit of a hack)

PostPosted: Sun Feb 20, 2022 10:21 pm
by joachip
I know it's a bit rough. But the main idea is to introduce the "blendParticles" keyword that lets us set up a particle system for hair, clothes and what not - the same way as "blendMaterial" already does.

So if you like the idea, it would be cool to see this become a part of MakeHuman I think.