tube groom (hair from geo) houdini

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's going on it's evan here today we're going to be taking a look at how to convert geometry to here and we're specifically going to be looking at tube groom this is what i used to do when i use xgen a while ago i would be given tubes and i would just convert them into guides and i would use that to generate the hair and so i wanted to figure out how to do that in houdini and so let's go to houdini really quick and so this is what i have here and this is what we're going to be creating so that we can see well we see we have the base tubes right here and then we're going to convert that into this nice beautiful looking mohawk thingy it's pretty amazing so let's get started alright so here we are in houdini and let's see today we're going to start all the way from scratch so i'm just going to make a geometry node and place it down and i'm just going to rename it to setup and i'm just going to save it really quick just give me one second all right so i have that saved and let's see let's go inside of our node network and the first thing i'm going to drop is a pig head it is the second best test geometry right behind the rubber toy we all know the rubber toy is the best anyway so i'm going to drop down a circle now so let's go put that down and let's see i'm going to put the display flag on it and i'm going to template this just so i can see it i'm going to switch it to the wrong one to the yz plane and let's put it on polygon and also i want it to be open i suppose i could do this with a line too well i'll just do with the circle all right so let's see i'm going to put the divisions i'm just going to up it just a little bit so it's a little bit higher res and i'm going to change the arc amount to just like 100 105. yeah there we go and then i'm going to rotate it just a little bit like so and i think i want to bring it just a little bit closer so i'm going to switch the handles tool and i'm going to bring it down and it's a little bit big so i'm going to scale it down it looks like i have to raise it up again let's see so i'm just going to go to the side view and reposition it there you go that looks a lot better i think i'm going to rotate it just a little bit more there we go that's looking good um i'm going to use a race op now and that's going to allow me to project this circle onto the pighead geometry so let's connect this together oh that's not right uh let's switch it from project raise to minimum distance and that's much better and i kind of want it i think i want the points to actually go inside the geometry a little bit so i'm going to go to the lift and i'm going to start using that push it in all right so that's a lot better so that's going inside the geometry and we'll see why later it's because later on we're going to be creating groups and so it kind of helps if the we're going to be creating groups from the what do you call the tubes that are coming out of here so the tubes actually need to be intersecting the geometry because we're going to be getting the groups on this pig based off of those tubes so it needs to actually intersect and so that's why i'm having this curve go inside the geometry and so now that i have that done i'm going to turn off the template well i mean because we can already see it from this node but regardless i'm going to type in resample and drop that down and i'm going to put it to four segments and let me turn on display points so i can see that and i'm going to turn off this and put it on maximum segments and then i'm just going to put it on four let me display that yeah that's looking good should be good alright so let's drop down a copy to points and i'm going to connect a line node to the geometry to copy so i'm going to drop down line really quick and put that in and we can see right away that it is not facing the right direction that's so that's okay it won't be too hard to fix but really quickly let's put the point count to like 50 so that it's a little bit higher res all right so let's put this back on what we want to happen is i want this i want i want each of the tubes to actually follow the curve because right now they're all just going straight up and so that's not what we want we can fix that pretty easily i'm going to drop down a poly frame node and really quickly i'm going to put the display flag on that and turn off the template and i'm going to turn on display normals so we can see the normals and yeah it's not right so i'm going to disable this one and for this i'm going to put and and that way we can get the normals based off of that and that should be good well actually it's probably going to be the opposite of what we need but that's fine too so yeah now we can see that it is going the right way or direction just like the wrong way and so we're going to flip that really easily i'm going to drop down well actually let me go to poly frame let me just put this to points so that we have that normal on the points all right so now we're going to do a point wrangle oops i think i did the wrong note yeah hold on there it is point wrangle and we just want to invert it or yeah we want to multiply it by negative one so i'm going to type in v at n and then i'm going to do times equals negative one and then put a semicolon and there we go we can see that it flipped it and now that is going the right way all right perfect and what i'm going to do is we're going to use these later on as clumping guides so i'm going to just type in null and i'm going to attach that right up and i'm going to type in let's see out and then clump guides perfect and now i'm going to drop down a sweep note because we need to actually create the tubes and oh actually that reminds me of something now that i think about it i don't want resolution coming from this node well actually it doesn't really matter because i need to drop a resample after it so i'm going to do a resample and i'm going to switch it to 50 so maximum segments or segments and then do 50. and the reason why i want to use a resample node well actually i mean i technically you could have just left it on 50 here and then when you go to the resample node you just don't choose anything and then it just won't change anything here but what i want is this curve u attribute and what this does is it gives a nice attribute going from zero on the root all the way to one at the tip and we can visualize that pretty easily i'm gonna do color and i'm going to connect that really quickly and then where it says constant i'm going to do ramp from attribute and i'll type in curve i spelled that wrong curve u and let me turn off display points and now we can see that we have a ramp and this ramp is going from black to white and we can see that it's doing the same thing over here oops in the viewport the root is black and then at the tip it's white and so if we change the color here we can see that it affects it over here and so we know our attribute is working as intended and so now let's make our tubes i'm going to connect the sweep node and put the display flag on it and select it and it's not working by default and that's just because we need to switch this to round tube and there we go i don't think i want my normal showing so i'm going to hide that and i'm going to turn on the geometry template for the pig head just so that we can see it really quickly there we go and i think the thicknesses is pretty good i'm going to make it just a little bit thicker so maybe like one five that's a little bit too much i'll do like one three there we go and i'll add an end caps i'll put that the single polygon and let's do scale along curve because we want to make it get thinner at the tip so i'm just going to drag this down until i get something that i like and this is looking pretty good i think that i want to give it some more resolution though so let's go scroll up and where it says columns i'm going to increase this amount i'm going to try 50 and yeah that seems to be enough so i'm going to leave that how it is and now what we need to do is we need to create groups for the base of this tube and we also need to create or when i say base i think a better way of saying it would be the root and then we also need to create a group for the tips and there are a few ways we can do this one way is we could just hit s to switch to our selection key and i could just select these different tips right here and then i could just type in group and then here we have a group here but since we have this curve u attribute there's actually a better way we can do it that's procedural so i'm going to type in group expression and connect that up and the curve u attribute i believe it's a point attribute so i'm going to switch this from primitives to points all right and let's see i'm going to name one of the groups well let's name the first one root because we're going to do the roots first and we're going to type in a very simple expression here i'm going to type in at curve u equals and then i'm going to do 0.2 and it's giving me error right now and so i did not mean to do that what i need meant to do is is less than there we go all right now we can see that we're selecting anything where curve u attribute has a value that is less than 0.2 and so it's selecting all of these points right here and so now we also want to make another group for the tips so i'm going to hit the plus icon and i'm going to name this this group tip and we're going to copy this expression right here and paste it right here and instead of less than 0.2 what i'm going to do is greater than 0.8 and let's see how that looks oh actually let me disable that really quick so i can see this one and yet we can see right here that we have the group and now it's selecting the tips of our tubes and so that's a nice procedural way to do that and a way to visualize that is let's go back to the resample node and i'm going to turn on display points if i type in visualize and connect that up and then put the display flag on it let's go to visual watch let me turn off update visualizer and then let's go to attribute and let's type in curve u and then instead of color let's do a marker and now we can actually see the values that it's getting and so we can see it's going all the way from zero all the way up until one and so that's how we were able to use curve u in our expression so we said anything less than a value of 0.2 will be in our group and so we can see that right here this is 0.204 or 0.204 yup and so anything less than that will be in the group and by the same token up at the top we said anything greater than 0.8 so that would be right here it says 0.81 so anything greater than this would be in the tip group and so that's how we're able to create the group so let me delete this really quickly because i don't need that and i think i disabled i re-enabled it okay good so now we have both of our groups right there and that is looking good and i think i'm actually going to promote that group really quickly so i'm going to type in group promote and connect that and let's see group name well let's do from points to primitives and let's do both of the groups so let me just do a star there we go and now it's going to promote both of them so basically what that's doing is it's just taking the point groups and promoting them to primitive groups all right so what we're going to be using to actually create these um well actually what we're going to do is we're going to be advecting guides and the thing is is that what we use to to get hair inside these tubes it doesn't actually create them it just advects curves that you already have so we actually need to create the curves before we can advect them and so i'm going to copy this uh peg geometry i'm just going to hit alt and drag it down so that i have a second copy right here and i'm going to subdivide it so that we have higher resolution and let me plug that in and now we have some higher resolution geometry and so i want to emit some here but i only want to emit it where the tubes are going to be so thankfully there's a cool way that we can do that i'm going to drop down the group node here we go and this method only works with points so what we're going to do is we're going to create a point group like we did before and then we're going to promote it to a primitive group so i'm going to connect this uh tube right here to group one and let's give this a better name i'm going to name this source and i want the group to have the same name as the node so i'm going to go to group name and type in dollar sign os and that just means operator string and that's just going to grab the number the name from that you type for the node name right here which is source and so if i middle mouse click this you can see that switches to source which just means it's evaluating that expression so you can see what it actually is going to be and so you can see that if i middle mouse click here and i look at the groups it says source right there so we can see that that's actually working now as i was saying we need to switch this over to a point point group and let's see there's keeping bounding region or keeping bounding regions so i'm going to enable that and switch it to bounding object and you can see it says points or vertices only so that's why we had to switch it to a point group and so right now we can see that we're selecting a whole bunch of points that are inside these tubes and that's perfect because we want to emit here only from those areas we'll not emit but we just want here in those areas which is perfect and so i'm going to promote this group so i'm going to do group promote and wire that in and we named it source and so i'm going to do from well auto and i'm just going to do the primitives and so now we can see we have a nice primitive group that we want our hair source to come from all right so it's time to actually create the here so i'm going to type in here generate and i'm going to place that node and connect it up and it's making here everywhere and that's not what we want so we're going to where it says group i'm going to select the group that we just made source and so now we can see that there is only here in the areas that we want the density is a bit high so i'm going to put it down to 500 and these aren't nearly long enough so i'm going to make them just a bit well actually the length doesn't really matter because when it gets advected it's going to make it longer but just to make it easier to see i'll just go ahead and make it a bit longer and the next thing that we need to do is create the velocity because the way the the guided vection works is it affects the curves based off of a velocity field so we're going to do velocity from surface and here's that node right here it's going to create the velocity for us and that's why we created the groups earlier because we need groups um we need to select groups in order to control the direction that this node creates a velocity so you can see right here it says divergence group so that's we're going to be adding the groups but it's a little bit low resolution so i'm going to type in 04 maybe o2 ah just go to 1 and that should be fine that's looking a lot better and so let me look at the velocity from surface and we're going to do two groups and one of them is going to be tip and one of them is going to be root so let's do the root first and then we're going to do the tip next and then for the tip i'm just going to put the value to positive like 0.5 we could adjust these later because we'll actually be able to see what it's doing later but for now i'm just going to type in um a few values just default values because i know for the root that it needs to be actually i think i put that in backwards for the root it needs to be a positive value and for the tip it needs to be a negative value perfect all right so let's type in guide effect and let's look at what we need we need guides and then we need skin and then we need skin vdb let's see we need a skin vdb so let's make that really quickly let's do vdb from polygons and let's connect that to the subdivide and it's a little bit low res so i'm going to do 0.02 and let's do fill interior and i'm just going to put exterior band voxels to like 10. there we go so now we should have all the information that we need so if we go here it says here curves and then this is guides so the the hair curves go into the guides and then let's see skin it goes into the skin from there then we have the collision vdb going into the skin vdb and then we're going to get our velocity and collision from this node that we just created a moment ago and so let's put the display flag there we can see that it's sort of working but it's not quite going it's not quite filling up the tubes as much as i'd like and so really quickly let's go over here and i find that for the pressure solve iterations 20 is really low the quality usually seems a lot better when you put it higher so i'm going to put it up to 150 and it does take a little bit more time but often you get better results and so let me disable these groups really quickly and actually let me change the resolution just so it goes a bit faster so if we enable one of these groups right here this is how i knew whether or not to put a positive or negative value so by default this is at zero so it's not doing anything if we put in a negative value you can see that it's going the wrong way it's getting sucked towards the root and we wanted it to go away and so that's how i know that i need to do 0.5 and by the same token we can do the same thing here with the roots or the tips rather if i type in 0.5 we can see that it's going the wrong way and so that's how i knew i needed to use a negative value for the tips and a positive value for the roots and so now that i have both of those on let's go back to the guided vector node and i don't usually use constrained infection i like to use fill collision field and what i want to do is i want to turn off stop on collision and that way it goes all the way to the top and you can see that it's creating all these additional here that i don't want but i can delete them very easily there's a section right here it says output group of affected primitives so i'm going to click that and what it's going to do is it's going to create a group that wasn't affected by the velocity field so i'm going to type in blast and i'm going to connect that into the guides and we're going to select affected and i'm going to delete non-selected and now that we can see it deleted all of the the areas that we don't want and it's generally looking pretty good there is something however that i would like to change i don't want all of these small little hairs growing up right here i only want the the bigger ones to show so we can delete those small ones really quickly and so the way we could do that is by dropping down a measure sop and connect that and we want to measure the perimeter and so that way we can find the length of each strand and so i'm going to type down primitive wrangle and and connect that up and what i want to do is i want to isolate all of the primitives that have a very short perimeter and delete them and that way i'm only left with the longer one so we can do that with the with the if statement and actually just to make it easier to type i'm going to go back to this to this measure node and let's just change the attribute to p for perimeter and that'll be easier to type in and so i'm going to type in if and i'm going to do f at p because it's a float value is less than 0.1 so i'm saying if the length is less than if the perimeter is less than 0.1 then we're going to do this next statement and so we want to remove it so i'm going to use the remove prim function and so i'm going to do parentheses and then 0 and then i'm just going to do at premnum and that will get the correct prim num for each one and then i'm going to do comma one and the reason why i put one instead of zero is because one will delete all the points because you can delete the parameters and keep the points or i'm sorry delete the primitives but keep the points but i want everything deleted and so then i'm just going to do a colon and voila it's working so if i disable this and enable it you can see all of these smaller primitives being deleted and that's exactly what we want all right so the next thing that we're going to do is generate the hair these are actually just the guides that we're going to grow the hair from and so i'm going to use guide skin attribute lookup and this is just going to give the guide some information that we need let's see it's just going to have a it's going to tell each primitive i'm sorry it's going to tell each hair which primitive on the skin it is attached to and so let's connect that up to the skin and so we have the attribute and then just for the sake of making sure it doesn't give us a warning i'm just going to put in a rest position and now let's do here jen let's see what is this one looking for oh that's the skin and this is the guide so we need to make sure that the first one is actually plugged into the skin so let's drag that out and grab the skin right here and nice we can see we're generating here and let's turn off grow unguided here and that way it'll only generate it next to where our guides are and this is good and i'm going to drop down a color note just to make it easier to see make it blue oh there's something else i'd like to say right now we're not actually viewing the thickness of the hair we're just seeing the curve if you actually want to see how it looks go back up to obj level and then go to miscellaneous and do shade open curves in viewport and now we can actually see the thickness and so we can see it's really thin so i'm going to go to attributes and appearance and i'm going to make it a little bit thicker there we go nice and i think i want some more here because that's not really a lot so i'm going to do 5000 all right that's looking a lot better and actually i'm going to put it down to 2000 for now and the one other thing that i will do on this node is for the influence radius i'm going to put this to like 1.5 there you go now i like to gain a little bit more control over the hair so that it's not just growing out everywhere so what i'm going to do is i'm going to actually clump i'm going to use clumping to fix that and so remember how we created those clumping guides earlier right here out clump guides let's go ahead and grab those again so i'm going to do object merge and what i'm going to do is i'm going to grab this right here oops let me do that i'm going to grab this and just drag it over here and that way if we come and look at this it's just going to be grabbing this right here but it's a tidier way of doing it so we don't have wires going everywhere and so here we are let's type in clumps that we can get our hair clump and let's see what it's asking for it's asking for guides and then it's asking for skin which we can get from right there and then it's asking for a skin vdb which is uh the last node that we have that has the skin vdb is right up there and so now it's looking a lot better but we want to we want each clump to be free we want there to be one clump for each tube right now we just have a whole bunch of clumps because if i move this around you can see that it's just changing the size of the clump so we can do that by using the clump guides so let's connect this together and it's giving us an error because we need to actually repeat this guide skin attribute lookup step again for the for the hair clump guides so let's type in skin and then let's grab this guide skin attribute and so let's plug the guides into the guides and then we need to grab the skin again so let's just grab the skin from over here from the guided vect and so there's a skin and now if i connect this it should work ah yes now it's working perfect and let me go to the hair clump node and instead of for the method instead of extrude and blend i'm just going to choose linear and let's see what other options do we have oh yeah this is really cool there's like a curve right here that you can use to control how the profile looks along the length of the of the guide and so let's see what else can i change oh yeah right so let's go back to the hair gen i'm just gonna make a little bit more here because there's not a lot right now and there we go we got a little bit more here and let's just mess around with this just a little bit and i just want to be just slightly open at the top and then let's go up and turn on curling and then turn up the amplitude and then turn down the frequency so it's not so much that's still a little bit too much there you go that's a little bit better and let's go back to the i actually got a fractal clumping and turn this up just a little bit and there you go we can see we're getting some nice separation there so it's not all the same and then we can mess around with straight hairs and so that just makes it so that some of the hair is straight around they're not also tightly clumped together and there's you can pretty much do anything from here whatever you want to do it's just it's just up to you let me pull over my other screen really quick and then put it on the display flag this is what i wound up doing for my original design but you can put in whatever settings you want so let me go back over here the last note that i added was just the frizz node and let's connect that and actually cool trick in houdini 18 is it's kind of cumbersome to drag all these wires together so if you just hit j and do that it'll automatically connect all them together then you can see that we just added a bit of frizz and something cool is if you go to the masking and then curve mask you can change the frizz along the curve so you can see that let's actually change this ramp so it's more frizzy at the base and then it's less frizzy at the top and i'm going to turn off visualize mass so i don't have to see that anymore and that's pretty much it i'm going to template this just so that we can see it and there we go that's that's basically the workflow it's a lot more complicated than what you can do with xgen like with xgen it's pretty simple you just select your tubes and then you select the base geometry then it generates it for you but here you have a lot more control and i find that the results that i get look a lot better too especially the hair that it generates on the inside of the the tube and the other thing that the other reason why this is better too is because this doesn't just work for tubes it pretty much it pretty much works for any type of mesh you could you could throw in any custom shape like if you want square or like like pretty like i said any shape and then you can you can uh adject your guides based off of whatever mesh you input all right well thanks for watching this tutorial i hope you found it helpful and i'm going to be making more tutorials in the future so stay tuned thank you
Info
Channel: Evan Robinson
Views: 963
Rating: 5 out of 5
Keywords:
Id: GBLd9oQMMmM
Channel Id: undefined
Length: 30min 28sec (1828 seconds)
Published: Thu May 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.