Unable to use some hair

Issue #467 closed
Former user created an issue

Hello,
I’ve been trying to use the “Side Swept ROse Hair” for G8 into Blender but when I try to make hair, it just crashes (definitely a RAM issue).

I’m not even able to separate the hair from the skull since there is no skull parts in the mesh. There is nothing I can do with it and it keeps crashing, what should I do?

Also, selecting strands by size didn’t help at all:

Comments (23)

  1. Domiek

    Idk about this specific hair so can’t offer advice. What I do know is that Daz assets vary wildly in quality. Some PA’s make stuff that is truly broken outside of Daz. You can see this in clothes often where some clothes have such bad topology that it becomes impossible to do a cloth simulation.

    Idk why this hair asset doesn’t have a hair cap. What you can try to do is make your own hair cap by selecting the faces of your characters skull and duplicating a separate mesh out of it.

  2. Former user Account Deleted reporter

    Thanks for the suggestion.
    I’ve tried creating a hair cap from the character but it didn’t work either. I also tried to remove some strands, decimating, pushing the mesh under 20k/10k vertices (sometimes less just for testing) but it still was too much and made Blender crash again. It doesn’t happen with other hair meshes I’ve used, they were all fine, but this one just doesn’t work.

  3. Domiek

    There are other conversion tools out there. I don’t expect this one to work but maybe give it a try. I’ve actually given up on converting Daz hair as the results are always questionable in any production setting and you can get decent results making your own particle hair with a couple weeks of practice.

    https://github.com/Jandals/HairNet

  4. Former user Account Deleted reporter

    HairNet is really good but it’s very difficult to use here since I have to select every root of each ring loop and add seams to each of them, which is impossible to do in a high poly mesh like this one. I guess I’ll either use another mesh or learn how to make mine and hope there will be a way to get around this. Thanks you very much for your help!

  5. Thomas Larsson repo owner

    Large hairs are taxing on the computer. Here are some ideas.

    Sometimes the hair mesh consists of several materials which are used for different parts of the hair. Separate the hair mesh by material and only make hair from submeshes that resemble hair guides.

    The Select Random Strands button selects a fraction of the strands. Delete those vertices to reduce the mesh size. You can compensate for the missing verts by adding children to the particle hair afterwards. Chosing a good fraction may be tricky, because you don’t want to end up with bald spots.

    The Print Statistics button lets you keep track of the number of vertices.

    Enable the Resize Strands option in the Make Hair dialog. Making multiple particle systems with few strands seems to take a lot longer than making a single one with many strands.

    A lot of time is spent on separating the hair mesh in loose parts. I added an option that let you disable that step, but that probably makes the nest step much worse.

    For some reason it takes a very long time (as in I didn’t wait until it finished) to delete temporary objects with the delete objects tool. The latest version only unlinks those objects from all collection, but does not actually deletes them. That can be done without calling an operator and is fast.

  6. Alessandro Padovani

    I can confirm this behaviour. I believe this is not due to the mesh complexity though since similar hair do convert fine. I guess this may be rather due to the fact that this particular hair uses both top-down and left-right uvs in the same mesh. That may confuse the plugin and crash.

    Thomas, this hair is free to download at renderosity if you may want to try to deal with it. For the purpose to improve the hair generator. There are 3 files part 1 + part 2 + update.

    https://www.renderosity.com/freestuff/items/79641

  7. Alessandro Padovani

    We can anyway look at the uv map and separate the hair by uv type. This should fit it for the hair tool to work. We can also select the uv edges to check if it is left-right or right-left for example.

    steps:

    1. enter edit mode
    2. from the uv map select the horizontal or vertical uvs
    3. separate the selection (mesh > separate > selection)

  8. Alessandro Padovani

    Below a screenshot where I separated and converted some hair by uv type, so the procedure above seems to work fine. The conversion was unusually slow and memory intensive though. It is a long time that I don’t play with hair by I remember it a lot faster. Not sure if it’s this particular hair or a bug. Will check.

    I worked with commit b4d48bf.

  9. Alessandro Padovani

    For what I can test other hairs work fine. There’s definitely something wrong with the Rose hair. I guess it’s the uv types that are mixed and so the hair tool goes south. See #468. In my example above I selected the horizontal uvs but they may be left-right and right-left mixed together for example.

    Then if the hair tool could avoid to stall it would be nice. For example it could check the memory and abort if it takes too much. The buffer could be decided by the user. In my test in #468 it takes only 1G ram even for complex hair.

    Then if the hair tool could manage mixed uv types it would be even better.

  10. Former user Account Deleted reporter

    So… From what I’ve read here and on your other post, this hair mesh is behaving in a really weird way…
    I’ve had similar issues with a lot of long hairs and was unable to work with most of them. They were all complex and curly, maybe it plays a role on the performance issues. That’s still a massive gap when you see the amount of RAM that ends up being used between each mesh.

    An other one I’ve had issues with was the Bronwyn Hair for G8, but this time, all of the UVs are vertical and there is a scalp. Pushing the mesh to 25k or even 10k still requires too much RAM and I can’t believe that 8G is not enough. But it’s also a complex mesh with wavy hair if that matters.

  11. Alessandro Padovani

    Willfre, I’m afraid I can’t do much. In #468 I converted the Monica hair that’s 170K vertices in 25 seconds with 1G ram, so your Bronwin example with 25K vertices should be a breeze. May be Thomas will take some time to look at the blend file I provided in #468 to try to find out what’s wrong.

    And I don’t have a monster PC here, it’s just a ryzen 2200 with 16G ram. So what I can do should be in the common range.

  12. Former user Account Deleted reporter

    Well then I’ll keep trying to make it work and see if there is something I can do about it, maybe I’m just doing something wrong. I’ll keep an eye out for anything new over here as well.

  13. jeroen b

    Willfre, you could try to use this hair as mesh-hair and create simulations with Blender’s cloth modifier. I think that could give very nice results. Thomas plugin has a handy tool for creating the pinning group in; “advanced/mesh/create pinning group”.

    The advantage of using mesh-hair is that you keep all the shading & morph options.

  14. Alessandro Padovani

    As explained in #468, the issue is that “separate loose parts“ is buggy and doesn’t work fine with some geometries. We can replace it with a multiple “select random” that works fine. But Thomas didn’t reply yet so I can’t tell what he’s thinking.

    Meanwhile you can use “select random” yourself, thus to split the hair in little chunks, then uncheck the “separate loose parts“ option when generating the hair. This should work. Then every chunk must get a single uv type as required by the hair tool.

  15. Thomas Larsson repo owner

    I will probably try to write python code for doing the separation. Python is slow of course, but if the algorithm is linear in the number of vertices it may be faster anyway. In a previous life I studied percolation and learned about an algorithm for finding the percolation clusters, and this seems to be the same problem.

  16. Alessandro Padovani

    Thomas you may also use the blender functions, that may be faster than pure python. Just avoid “separate loose parts”. For example the procedure below may work fine. Then I’d like to hear from @xin if he has suggestions.

    steps:

    1. while there’s geometry
    2. select random (select > select random)
    3. select connected (select > select linked > linked)
    4. separate (mesh > separate > selection)

  17. Thomas Larsson repo owner

    I made a quick implementation of the algorithm I had in mind, and it seems to run at good speed even if it is pure python, both for Toulouse and the stymied Rose hair you gave me. If the built-in tool does something wrong, it doesn’t help that it does it wrong in C.

    The separate tool is Advanced Panel > Mesh > Separate Loose Parts.

  18. Alessandro Padovani

    Thomas it’s only “separate loose parts” that doesn’t work (mesh > separate > by loose parts), you’re safe to use the other blender functions to speed up your implementation if you like.

    As for commit bf1e32e it seems to work great but with a couple of minor issues.

    1. The tool complains that there’s no collection if the hair is in the scene collection. This may not be an issue if a separate collection is specifically required by the tool.
    2. In my example rose-test.blend in #468 the tool seems to miss some strands when converting hair. Not sure why.

    edit. As for point 2, some strands seem to be missing even if I don’t use the “separate loose parts” option, so it seems not related, but would be nice to understand why if possible.

    edit. Also I tested the new tool with the Bronwyn hair reported by @Willfre that’s hi-res and didn’t work before. Now it works fine here and the speed seems good enough to me it takes about 45 seconds for the whole conversion. Though if you can improve it with some blender functions it’s always good of course.

    Thomas please let us know if you may want to investigate the missing strands and/or try to speedup further. In my opinion we may mark as resolved anyway this is working good.

  19. Thomas Larsson repo owner

    Now the separated meshes are added to all collections that the original mesh belonged to, including the scene collection. Materials are also added. They are not needed for hair conversion, but the extra time is neglible.

  20. Alessandro Padovani

    Commit 2cc1a9f works fine here. Out of curiosity I did a speed test with the Monica hair, that’s a hi-res working both with the old and new loose parts. So version 1.5.1 takes about 35 seconds for the whole conversion, while version 1.6.0 takes about 45 seconds so I believe the speed is good, considering that 1.6.0 works with all the geometries. Then without loose parts it takes forever I don’t have the patience to time it, it’s more than 3 minutes anyway.

    https://www.daz3d.com/monica-hair-for-genesis-8-females

    As a side note the loose parts option could be removed, that is, we always use loose parts now that it works fine. Also, if possible, adding an “abort” button would be useful if the conversion goes south for any reason. I mean so the user could press the abort button to end it.

    As for me we can mark as resolved. Thomas do you have any clue for the missing strands ?

  21. Thomas Larsson repo owner

    Not really. I separated the strand as a separate mesh and tried to convert only that, but no hair was created. Probably there is something wrong with the geometry, although nothing is immediately obvious.

  22. Log in to comment