hair error

Issue #468 resolved
Alessandro Padovani created an issue

commit 89c7025

I get an error when importing the Monica hair. Version 1.5.1 works fine. I’d like to get this loaded into 1.6 to do tests for #467.

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

Comments (12)

  1. Alessandro Padovani reporter

    update. Then after the error the hair seems imported fine, but I can’t tell for sure.

  2. Alessandro Padovani reporter

    May be there’s something odd with the hair tool.

    Below the statistics for the Monica hair that converts fine. The mesh is about 170K vertices and it takes about 1G ram and 25 seconds for the conversion.

    Then below the statistics for the Rose hair in #467. I extracted just a part of the hair with the same uv type, at least for what I can see in the uv editor. The mesh is about 8K vertices and it takes about 12G ram and 106 seconds for the conversion. Also half the memory is not released after the conversion.

    My guess is that may be there are different uv types and the hair tool goes south in this case. See also #467 for reference.

  3. Alessandro Padovani reporter

    Thomas, I attached rose-test.blend, that’s some extracted Rose hair that gives the issue above. If you may like to give it a shot.

  4. Thomas Larsson repo owner

    This bug report has been made before, but only for 2.93 which I cannot start, and in 2.92 everything worked ok for that person. I don’t get the same error as you when I import the Monica hair, but instead Blender makes a hard crash. The reason turned out to be that some operations, namely the correction of the bump and emit areas, were made after the node tree had been pruned. In particular, the plugin generates a top coat group which for some reason is not connected to anything (why?), and when the plugin tries to update the Distance socket of that node it is gone.

    The fix moves the pruning after everything else is done.

    As for the UV types, there is an option for that in the Make Hair tool, although I have only tested up-down and down-up. Mixed UV types will not work, however. Try to separate the hair into separate meshes with a well-defined uv type, perhaps by separating the mesh by material.

  5. Alessandro Padovani reporter

    Commit 4a4ce1e works fine for the Monica hair. Thank you Thomas for the fast fix. I’ll leave this open for you to try with Rose if you like. Or let me know if you’re not interested so I’ll close this one.

    Then the user is aware that the hair must have a uniform uv type for the conversion to work. So dealing with mixed uv types would be a nice enhancement for the hair tool.

    edit. Yes I tried separating the uv types but it is not so easy to distinguish for example top-down and bottom-up when they mix in the same mesh with overlapped uvs. Again let me know if you may like to try to improve the hair tool, or I’ll close this one.

  6. Thomas Larsson repo owner

    The Rose hair seems to work fine, provided that you set Strand Orientation to Left-RIght in two cases and to Top-Down for the third mesh. It may also be a good idea to resize the hairs to a common value, since it seems much more costly to create many particle systems with a few strands than a single system with many strands.

  7. Thomas Larsson repo owner

    Trying to automatically figure out the uv type is going to be too complex, I think. The plugin uses the uv coordinates to figure out the coordinates along the strand, and I don’t see how it could distinguish between the root and tip if it cannot trust the uvs. E.g., it is quite possible that somebody makes a hair where the tip is closer to the scalp in world space than the root is.

  8. Alessandro Padovani reporter

    Yes rose-test.blend works fine for me too, I can generate the hair, that’s not the issue. The issue is that it uses 12G ram that’s not normal. While Monica that’s 170K vertices only takes 1G and it’s also much faster, as reported above. This doesn’t make sense and there must be something odd in the uvs or in the mesh I guess.

    So, what I mean is, even if we separate by uv type and use the right uv mapping, it seems there’s something odd that eat up huge chunks of ram. Specifically above I converted “Side Swept ROse Stray LR” with left-right mapping, in the rose-test.blend file. That takes 12G ram here.

    Or does it work for you fast and with normal ram usage ?

    edit. Thomas I tried splitting “Side Swept ROse Stray LR” in two parts, and they convert much faster and with just 3G ram. So it looks like for some reason the “separate loose part” option doesn’t work here. That is, it works if I separate by hand, but the plugin can’t. Please verify yourself and let me know if you can confirm.

    edit. Thomas I don’t know how actually the plugin separates loose parts, but what I used to split the hair is the “select random strands” tool in the hair panel. If this works may be you can use it, that is, calling it recursively about ten times at 50% gives 2**10 = 1024 pieces that should be enough to speed up most hair. You may try and see if it works with rose-test.blend or the Rose hair itself.

  9. Alessandro Padovani reporter

    As for your reason for automatic uv types, that can’t distinguish top from bottom, it’s the same when we try to figure it out by looking at the uv map. I select one side and see if it’s closer to the scalp to understand if it’s left-right or right-left for example. Then what’s the matter ? The plugin will generate a “reversed” strand in a dubious case.

    steps:

    1. separate loose parts to get the single strands, this is needed for performance reasons anyway
    2. for each strand try to “look” at the uv map to decide the uv type

    I mean, if I understand correctly what you explained. But I do understand it may be complex so of course it’s up to you to evaluate if it’s worth. As for the ram issue above it doesn’t seem related though and should be fixed if possible.

  10. Alessandro Padovani reporter

    blender 2.92, commit c4fd9ad

    Thomas that’s it. For some reason “separate by loose parts” goes south with the Rose test. While “select random strands” then mesh > separate > selection seems to work fine. So you may want to use it instead.

    steps:

    1. load rose-test.blend
    2. select “Side Swept ROse Stray LR” and enter edit mode
    3. select all and “separate by loose parts”, it will take 12G ram

    update. Just tested 2.93 and it does the same, so I guess this is a blender bug that’s not going to be fixed soon. May be @xin could also have some info ?

    update. Found some articles reporting similar issues with “separate loose parts”, but not a solution. The goemoetry seems fine here. I also deleted everything from addons to modifiers to vertex groups. It seems the tool is just buggy. It also works fine if I select random, then connected, then separate until there’s geometry. So may be this can be done instead of using “separate loose parts”.

  11. Log in to comment