I reorganized the options in groups of 5 pairs. The first option in each pair controls the tangent and the second the normal. I also added 2 bias options to the 3 existing spacial randomness options.
Setting a negative uniform bias for the normal (second field of the pair) should be able to fill out the hollow bundles.
Hey, I really like your addon, it’s just amazing!
There is only one thing that would make it perfect:
How about one more option that does pretty much the same thing as Rand at root tangent, but does it for each hair vertex step (each “edge loop”) separate and relative to the middle point of the “edge loop” (just calculate the average point of the loop)? It would randomly distribute the Hair inside the cross-section of a 3d mesh (but would also work/not break with flat planes). This would basically allow us to generate volumetric hair from a single 3d mesh with volume…
You would just have to make the relative probability go down the further it gets to the middle, so it generates an evenly distributed slice from a cylinder and not many more hairs in the middle.
I don’t know if you are actually still maintaining this addon (2.90 support would be great ;D) or how fast you reply, so I will start testing if this could work by modifying the addon now, and if it actually does I can send you the modifications.
Hi, thanks for the proposal.
But, I am not sure if I understand correctly.
Can’t you already create volumetric hair from cylindric meshes using a negative uniform bias for the normal?
yeah, that’s what you wrote before, but the problem is that it doesn’t work with meshes that have a non-uniform thickness. I want to get a similar result as in the image i linked, which means that the ends should end in one point and in the middle it’s a bit thicker…
As you can see it works ok at the beginning, but the ends don’t line up in one point.
I hope I’m doing this right but an option like I mentioned would defenitly be a good solution ;D
We can work together a bit if you want… I just need to get the vertex positions from the current edge loop the hair is bending at for each of the loops the hair is using to bend, if you know how you could implement that.
nice, it works much better now!
Although I still think I’m going to tinker with the script a bit to see if I can get my method to work, because it still has some problems. Mainly, the hair goes quite a bit outside of the mesh with this method, especially with non-cylindrical meshes (which you stated it not working for). And also it looks very “rough”, even when you don’t add any other randomness.
Thanks for all your work!
edit: The API documentation is not very helpful with this, so just a quick question, at the line:
loop = loop.link_loop_next.link_loop_next
does this go around the face by 2 corners to get the next “edge loop” in the mesh?
And then how can I go to the next one in the other direction (around the edge loop)?
@lichtso
Wow! I didn’t think I could do this but I have successfully implemented exactly what I was talking about into your addon (even works with random length, but that was the trickiest part ;D). It works with any shape of mesh (didn’t test, but probably also curves etc as they internally get converted to meshes), it doesn’t go out of the mesh, no weird randomness if you don’t turn up randomness (all the options still work with this) and it’s 100% evenly distributed (at least in a cylinder, other shapes are of course not perfectly distributed, but if it’s at least somewhat of a “simple” closed shape it looks fine).
I’m from germany too, so I have to go to bed now, but maybe tomorrow we can discuss how you want to integrate the feature into your addon (don’t really want to go through all the github contributor hustle just for these some changed lines ;D). Also I could show you some results then, or you can just test it yourself.
Cool, I can integrate the feature into the addon after some testing.
You can send me the code if you don’t have a GitHub account. But then you will not be directly credited there.
Also: Some pics / images of your results would be nice!